ResponseTokenCountRequest

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

Constructors

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

Properties

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

Conversation supplying context.

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

Text or structured context.

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

Instructions to include.

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

Model whose tokenizer is used.

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

Whether tools can execute in parallel.

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

Personality configuration included in the estimate.

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

Prior stored response supplying context.

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

Reasoning configuration included in the estimate.

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

Output format included in the estimate.

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

Tool selection configuration.

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

Available tools included in the estimate.

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

Context truncation strategy.