Package-level declarations

Types

Link copied to clipboard
@Serializable
data class Response(val id: ResponseId, val objectType: String? = null, val createdAt: Long? = null, val status: String? = null, val error: OpenAIErrorDetails? = null, val incompleteDetails: JsonObject? = null, val instructions: String? = null, val maxOutputTokens: Int? = null, val model: ModelId? = null, val output: List<ResponseOutputItem> = emptyList(), val parallelToolCalls: Boolean? = null, val previousResponseId: ResponseId? = null, val reasoning: ResponseReasoning? = null, val store: Boolean? = null, val temperature: Double? = null, val text: JsonObject? = null, val toolChoice: JsonElement? = null, val tools: JsonElement? = null, val topP: Double? = null, val truncation: String? = null, val usage: ResponseUsage? = null, val user: String? = null, val metadata: Map<String, String>? = null, val outputText: String? = null)

A model response object.

Link copied to clipboard
@Serializable
data class ResponseAccessPrograms(val cyber: String? = null)

Restricted access programs.

Link copied to clipboard
@Serializable
data class ResponseAnnotation(val type: String, val url: String? = null, val title: String? = null, val startIndex: Int? = null, val endIndex: Int? = null, val text: String? = null, val fileId: String? = null, val filename: String? = null, val index: Int? = null, val containerId: String? = null)

URL, file or container citation in Responses output.

Link copied to clipboard
@Serializable
data class ResponseCacheBreakpoint(val mode: String = "explicit", val ttl: String? = null)

Reusable prefix boundary.

Link copied to clipboard
@Serializable
data class ResponseCompaction(val id: String, val output: List<JsonObject>, val objectType: String? = null, val createdAt: Long? = null, val usage: ResponseUsage? = null)

Compacted context items that can be supplied on subsequent turns.

Link copied to clipboard
@Serializable
data class ResponseCompactRequest(val model: ModelId, val input: ResponseInput? = null, val instructions: String? = null, val previousResponseId: ResponseId? = null, val promptCacheKey: String? = null, val promptCacheOptions: ResponsePromptCacheOptions? = null, val serviceTier: String? = null)

Input for compacting accumulated conversation context.

Link copied to clipboard
@Serializable
data class ResponseContextManagement(val type: String? = null, val compactThreshold: Int? = null)

Automatic context management entry.

Link copied to clipboard
@Serializable
data class ResponseCreateRequest(val model: ModelId, val input: ResponseInput? = null, val instructions: String? = null, val maxOutputTokens: Int? = null, val metadata: Map<String, String>? = null, val parallelToolCalls: Boolean? = null, val previousResponseId: ResponseId? = null, val reasoning: ResponseReasoningOptions? = null, val store: Boolean? = null, val temperature: Double? = null, val text: ResponseTextOptions? = null, val toolChoice: JsonElement? = null, val tools: List<ResponseToolDefinition>? = null, val topP: Double? = null, val truncation: String? = null, val user: String? = null, val background: Boolean? = null, val contextManagement: List<ResponseContextManagement>? = null, val conversation: String? = null, val include: List<String>? = null, val maxToolCalls: Int? = null, val moderation: ResponseModeration? = null, val promptCacheKey: String? = null, val promptCacheOptions: ResponsePromptCacheOptions? = null, val safetyIdentifier: String? = null, val serviceTier: String? = null, val streamOptions: ResponseStreamOptions? = null, val topLogprobs: Int? = null, val accessPrograms: ResponseAccessPrograms? = null)

Creates a model response.

Link copied to clipboard
@Serializable
data class ResponseHybridSearch(val embeddingWeight: Double, val textWeight: Double)

Weights used to combine embedding and text search.

Link copied to clipboard
@Serializable
value class ResponseId(val id: String)

The response identifier.

Link copied to clipboard
@Serializable
data class ResponseImageMask(val fileId: String? = null, val imageUrl: String? = null)

Mask selected by uploaded file ID or image URL.

Link copied to clipboard
@Serializable(with = ResponseInput.Serializer::class)
data class ResponseInput(val value: JsonElement)

Input for a response request.

Link copied to clipboard
@Serializable
data class ResponseInputContent(val type: String, val text: String? = null, val imageUrl: String? = null, val fileId: String? = null, val fileData: String? = null, val fileUrl: String? = null, val filename: String? = null, val detail: String? = null, val promptCacheBreakpoint: ResponseCacheBreakpoint? = null)

Text, image or file content supplied to a response.

Link copied to clipboard
@Serializable
data class ResponseInputEntry(val type: String, val id: String? = null, val role: String? = null, val content: JsonElement? = null, val callId: String? = null, val output: JsonElement? = null, val approvalRequestId: String? = null, val approve: Boolean? = null, val encryptedContent: String? = null, val name: String? = null, val arguments: String? = null, val status: String? = null, val serverLabel: String? = null, val error: JsonElement? = null, val action: JsonElement? = null, val result: String? = null, val summary: JsonElement? = null)

A structured message, tool result, approval or encrypted context item.

Link copied to clipboard
@Serializable
data class ResponseInputItem(val id: String? = null, val type: String? = null, val status: String? = null, val role: String? = null, val content: JsonElement? = null)

Structured response input item.

Link copied to clipboard
@Serializable
data class ResponseInputTokensDetails(val cachedTokens: Int? = null)

Input token details.

Link copied to clipboard
@Serializable
data class ResponseModeration(val model: String? = null, val policy: ResponseModerationPolicy? = null)

Moderation configuration.

Link copied to clipboard
@Serializable
data class ResponseModerationMode(val mode: String)

Whether moderation scores content or blocks it.

Link copied to clipboard
@Serializable
data class ResponseModerationPolicy(val input: ResponseModerationMode? = null, val output: ResponseModerationMode? = null)

Per-direction moderation policies.

Link copied to clipboard
@Serializable
data class ResponseOutputContent(val type: String? = null, val text: String? = null, val annotations: List<ChatAnnotation>? = null, val refusal: String? = null, val reasoning: JsonElement? = null, val reasoningContent: String? = null)

Content item inside a response output message.

Link copied to clipboard
@Serializable
data class ResponseOutputItem(val id: String? = null, val type: String? = null, val status: String? = null, val role: String? = null, val content: List<ResponseOutputContent>? = null, val name: String? = null, val arguments: String? = null, val callId: String? = null, val summary: JsonElement? = null)

Output item from a response.

Link copied to clipboard
@Serializable
data class ResponseOutputTokensDetails(val reasoningTokens: Int? = null)

Output token details.

Link copied to clipboard
@Serializable
data class ResponsePromptCacheOptions(val mode: String? = null, val ttl: String? = null, val prewarm: Boolean? = null, val comparisonResponseId: String? = null)

Prompt cache configuration.

Link copied to clipboard
@Serializable
data class ResponseRankingOptions(val ranker: String? = null, val scoreThreshold: Double? = null, val hybridSearch: ResponseHybridSearch? = null)

File-search ranking configuration.

Link copied to clipboard
@Serializable
data class ResponseReasoning(val effort: Effort? = null)

Reasoning configuration for response requests.

Link copied to clipboard
@Serializable
data class ResponseReasoningOptions(val effort: Effort? = null, val summary: String? = null, val context: String? = null, val mode: String? = null)

Reasoning configuration for response requests.

Link copied to clipboard
@Serializable
data class ResponseRequest(val model: ModelId, val input: ResponseInput? = null, val instructions: String? = null, val maxOutputTokens: Int? = null, val metadata: Map<String, String>? = null, val parallelToolCalls: Boolean? = null, val previousResponseId: ResponseId? = null, val reasoning: ResponseReasoning? = null, val store: Boolean? = null, val temperature: Double? = null, val text: ResponseText? = null, val toolChoice: JsonElement? = null, val tools: List<ResponseTool>? = null, val topP: Double? = null, val truncation: String? = null, val user: String? = null)

Creates a model response.

Link copied to clipboard
@Serializable(with = ResponseResultSerializer::class)
data class ResponseResult(val id: ResponseId, val objectType: String? = null, val createdAt: Long? = null, val status: String? = null, val error: OpenAIErrorDetails? = null, val incompleteDetails: JsonObject? = null, val instructions: String? = null, val maxOutputTokens: Int? = null, val model: ModelId? = null, val output: List<ResponseResultItem> = emptyList(), val parallelToolCalls: Boolean? = null, val previousResponseId: ResponseId? = null, val reasoning: ResponseReasoningOptions? = null, val store: Boolean? = null, val temperature: Double? = null, val text: JsonObject? = null, val toolChoice: JsonElement? = null, val tools: JsonElement? = null, val topP: Double? = null, val truncation: String? = null, val usage: ResponseUsage? = null, val user: String? = null, val metadata: Map<String, String>? = null, val outputText: String? = null, val background: Boolean? = null, val conversation: JsonObject? = null, val serviceTier: String? = null, val completedAt: Long? = null, val maxToolCalls: Int? = null, val promptCacheKey: String? = null, val promptCacheOptions: ResponsePromptCacheOptions? = null, val contextManagement: List<ResponseContextManagement>? = null, val accessPrograms: ResponseAccessPrograms? = null, val safetyIdentifier: String? = null, val topLogprobs: Int? = null, val moderation: JsonElement? = null, val rawData: JsonObject? = null)

A model response object.

Link copied to clipboard
@Serializable
data class ResponseResultContent(val type: String? = null, val text: String? = null, val annotations: List<ResponseAnnotation>? = null, val refusal: String? = null, val reasoning: JsonElement? = null, val reasoningContent: String? = null, val logprobs: JsonElement? = null)

Content item inside a response output message.

Link copied to clipboard
@Serializable
data class ResponseResultItem(val id: String? = null, val type: String? = null, val status: String? = null, val role: String? = null, val content: List<ResponseResultContent>? = null, val name: String? = null, val arguments: String? = null, val callId: String? = null, val summary: JsonElement? = null, val encryptedContent: String? = null, val result: String? = null, val serverLabel: String? = null, val output: JsonElement? = null, val approvalRequestId: String? = null, val action: JsonElement? = null, val error: JsonElement? = null, val tools: JsonElement? = null, val queries: List<String>? = null, val results: JsonElement? = null, val containerId: String? = null, val code: String? = null, val outputs: JsonElement? = null)

Output item from a response.

Link copied to clipboard
data class ResponseStreamEvent(val data: JsonObject)

A Responses stream event, retaining the complete payload for newly introduced event kinds.

Link copied to clipboard
@Serializable
data class ResponseStreamOptions(val includeObfuscation: Boolean? = null)

Streaming payload configuration.

Link copied to clipboard
@Serializable
data class ResponseText(val format: ChatResponseFormat? = null)

Text output configuration for response requests.

Link copied to clipboard
@Serializable
data class ResponseTextOptions(val format: ChatResponseFormat? = null, val verbosity: String? = null)

Text output configuration for response requests.

Link copied to clipboard
@Serializable
data class ResponseTokenCount(val inputTokens: Int, val objectType: String? = null)

Token estimate for a prospective response.

Link copied to clipboard
@Serializable
data class ResponseTokenCountRequest(val model: ModelId? = null, val input: ResponseInput? = null, val instructions: String? = null, val conversation: String? = null, val previousResponseId: ResponseId? = null, val parallelToolCalls: Boolean? = null, val reasoning: ResponseReasoningOptions? = null, val text: ResponseTextOptions? = null, val toolChoice: JsonElement? = null, val tools: List<ResponseToolDefinition>? = null, val truncation: String? = null, val personality: String? = null)

Input whose token count is estimated without generating a response.

Link copied to clipboard
@Serializable
data class ResponseTool(val type: String, val name: String? = null, val description: String? = null, val parameters: Parameters? = null, val strict: Boolean? = null, val searchContextSize: SearchContextSize? = null, val userLocation: UserLocation? = null)

Tool declaration for response requests.

Link copied to clipboard
@Serializable
data class ResponseToolDefinition(val type: String, val name: String? = null, val description: String? = null, val parameters: Parameters? = null, val strict: Boolean? = null, val searchContextSize: SearchContextSize? = null, val userLocation: UserLocation? = null, val vectorStoreIds: List<String>? = null, val filters: JsonElement? = null, val rankingOptions: ResponseRankingOptions? = null, val maxNumResults: Int? = null, val serverLabel: String? = null, val serverUrl: String? = null, val connectorId: String? = null, val serverDescription: String? = null, val headers: Map<String, String>? = null, val authorization: String? = null, val allowedTools: JsonElement? = null, val requireApproval: JsonElement? = null, val container: JsonElement? = null, val format: JsonElement? = null, val background: String? = null, val quality: String? = null, val size: String? = null, val outputFormat: String? = null, val outputCompression: Int? = null, val partialImages: Int? = null, val moderation: String? = null, val model: String? = null, val allowedCallers: List<String>? = null, val async: Boolean? = null, val deferLoading: Boolean? = null, val outputSchema: JsonElement? = null, val displayHeight: Int? = null, val displayWidth: Int? = null, val environment: JsonElement? = null, val externalWebAccess: Boolean? = null, val tunnelId: String? = null, val action: String? = null, val inputFidelity: String? = null, val inputImageMask: ResponseImageMask? = null, val tools: List<ResponseToolDefinition>? = null, val execution: String? = null, val searchContentTypes: List<String>? = null)

Tool declaration for response requests.

Link copied to clipboard
@Serializable
data class ResponseUsage(val inputTokens: Int? = null, val inputTokensDetails: ResponseInputTokensDetails? = null, val outputTokens: Int? = null, val outputTokensDetails: ResponseOutputTokensDetails? = null, val totalTokens: Int? = null)

Token usage for a response.

Functions

Link copied to clipboard

Creates response input from typed messages, tool results or encrypted context.