ResponseCreateRequest

@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.

Constructors

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

Properties

Link copied to clipboard
@SerialName(value = "access_programs")
val accessPrograms: ResponseAccessPrograms? = null

Restricted program configuration.

Link copied to clipboard
@SerialName(value = "background")
val background: Boolean? = null

Run asynchronously in the background.

Link copied to clipboard
@SerialName(value = "context_management")
val contextManagement: List<ResponseContextManagement>? = null

Context compaction configuration.

Link copied to clipboard
@SerialName(value = "conversation")
val conversation: String? = null

Conversation whose items are prepended and updated.

Link copied to clipboard
@SerialName(value = "include")
val include: List<String>? = null

Additional response fields to include.

Link copied to clipboard
@SerialName(value = "input")
val input: ResponseInput? = null

Text or structured input.

Link copied to clipboard
@SerialName(value = "instructions")
val instructions: String? = null

Optional instructions that prepended to model context.

Link copied to clipboard
@SerialName(value = "max_output_tokens")
val maxOutputTokens: Int? = null

Upper bound for generated output tokens.

Link copied to clipboard
@SerialName(value = "max_tool_calls")
val maxToolCalls: Int? = null

Maximum hosted-tool calls.

Link copied to clipboard
@SerialName(value = "metadata")
val metadata: Map<String, String>? = null

Arbitrary metadata for this response.

Link copied to clipboard
@SerialName(value = "model")
val model: ModelId

Model to use for this response.

Link copied to clipboard
@SerialName(value = "moderation")
val moderation: ResponseModeration? = null

Moderation policy.

Link copied to clipboard
@SerialName(value = "parallel_tool_calls")
val parallelToolCalls: Boolean? = null

Whether the model can execute multiple tool calls in parallel.

Link copied to clipboard
@SerialName(value = "previous_response_id")
val previousResponseId: ResponseId? = null

Continue from a previous response.

Link copied to clipboard
@SerialName(value = "prompt_cache_key")
val promptCacheKey: String? = null

Stable cache routing key.

Link copied to clipboard
@SerialName(value = "prompt_cache_options")
val promptCacheOptions: ResponsePromptCacheOptions? = null

Prompt caching controls.

Link copied to clipboard
@SerialName(value = "reasoning")
val reasoning: ResponseReasoningOptions? = null

Reasoning configuration.

Link copied to clipboard
@SerialName(value = "safety_identifier")
val safetyIdentifier: String? = null

Stable end-user safety identifier.

Link copied to clipboard
@SerialName(value = "service_tier")
val serviceTier: String? = null

Requested processing tier.

Link copied to clipboard
@SerialName(value = "store")
val store: Boolean? = null

Whether to store this response for evals/distillation products.

Link copied to clipboard
@SerialName(value = "stream_options")
val streamOptions: ResponseStreamOptions? = null

Streaming payload options.

Link copied to clipboard
@SerialName(value = "temperature")
val temperature: Double? = null

Sampling temperature.

Link copied to clipboard
@SerialName(value = "text")
val text: ResponseTextOptions? = null

Text output format configuration.

Link copied to clipboard
@SerialName(value = "tool_choice")
val toolChoice: JsonElement? = null

Tool choice strategy.

Link copied to clipboard
@SerialName(value = "tools")
val tools: List<ResponseToolDefinition>? = null

Tools available to the model.

Link copied to clipboard
@SerialName(value = "top_logprobs")
val topLogprobs: Int? = null

Number of output token log probabilities.

Link copied to clipboard
@SerialName(value = "top_p")
val topP: Double? = null

Nucleus sampling parameter.

Link copied to clipboard
@SerialName(value = "truncation")
val truncation: String? = null

Truncation strategy.

Link copied to clipboard
@SerialName(value = "user")
val user: String? = null

End-user identifier.