Package-level declarations

Types

Link copied to clipboard
data class CreateResponseRequest(val model: String, val input: Input? = null, val metadata: Map<String, String>? = null, val temperature: Double? = 1.0, val topP: Double? = 1.0, val user: String? = null, val previousResponseId: String? = null, val reasoning: Reasoning? = null, val maxOutputTokens: Int? = null, val instructions: String? = null, val text: TextConfig? = null, val tools: List<Tool>? = null, val toolChoice: String? = null, val truncation: Truncation? = Truncation.DISABLED, val include: List<String>? = null, val parallelToolCalls: Boolean? = true, val store: Boolean? = true, val stream: Boolean? = false) : Record

Represents a request to create a response in the OpenAI API.

Link copied to clipboard

Details about why the response is incomplete.

Link copied to clipboard
sealed interface Input
Link copied to clipboard
data class InputAudio(val type: String = "input_audio", val data: String, val format: InputAudio.Format) : InputContent

Represents an audio input to the model.

Link copied to clipboard

Sealed interface representing input content elements in the OpenAI responses API. This is the base interface for all input content types.

Link copied to clipboard

Serializer for InputContent that handles polymorphic serialization based on the "type" field.

Link copied to clipboard
data class InputFile(val type: String = "input_file", val fileId: String? = null, val filename: String? = null, val fileData: String? = null) : InputContent

Represents a file input to the model.

Link copied to clipboard
data class InputImage(val type: String = "input_image", val detail: InputImage.Detail = Detail.AUTO, val imageUrl: String? = null, val fileId: String? = null) : InputContent

Represents an image input to the model.

Link copied to clipboard
data class InputMessageResource(val role: InputMessageResource.Role, val content: List<InputContent>, val id: String? = null, val type: InputMessageResource.Type? = null, val status: InputMessageResource.Status? = null)

Represents a message input resource in the OpenAI API.

Link copied to clipboard
data class InputText(val type: String = "input_text", val text: String) : InputContent, Record

Represents a text input to the model.

Link copied to clipboard
data class InputTokensDetails(val cachedTokens: Int) : Record
Link copied to clipboard
data class OutputTokensDetails(val reasoningTokens: Int) : Record
Link copied to clipboard
data class Response(val metadata: Map<String, String>?, val temperature: Double? = 1.0, val topP: Double? = 1.0, val model: String, val instructions: String?, val tools: List<Tool> = emptyList(), val toolChoice: String = "auto", val id: String, val objectType: String = "response", val createdAt: Long, val output: List<OutputMessage>, val parallelToolCalls: Boolean = true, val user: String? = null, val previousResponseId: String? = null, val reasoning: Reasoning? = null, val maxOutputTokens: Int? = null, val truncation: Truncation? = Truncation.DISABLED, val status: Response.Status? = null, val outputText: String? = null, val text: TextConfig? = null, val store: Boolean? = null, val incompleteDetails: IncompleteDetails? = null, val usage: Usage, val error: ResponseError? = null) : Record

Represents a response from the OpenAI API.

Link copied to clipboard
Link copied to clipboard

Represents the text configuration for the response.

Link copied to clipboard
data class TextFormat(val type: String, val name: String? = null, val schema: JsonSchema? = null, val strict: Boolean? = null) : Record

Represents the format configuration for text output.

Link copied to clipboard

The truncation strategy to use for the model response.

Link copied to clipboard
data class Usage(val inputTokens: Int, val inputTokensDetails: InputTokensDetails, val outputTokens: Int, val outputTokensDetails: OutputTokensDetails, val totalTokens: Int) : Record

Represents token usage details including input tokens, output tokens, a breakdown of output tokens, and the total tokens used.