pub struct Response {Show 33 fields
pub background: Option<bool>,
pub completed_at: Option<f64>,
pub conversation: Option<Conversation2>,
pub created_at: f64,
pub error: ResponseError,
pub id: String,
pub incomplete_details: ResponseIncompleteDetails,
pub instructions: ResponseInstructions,
pub max_output_tokens: Option<i64>,
pub max_tool_calls: Option<i64>,
pub metadata: Metadata,
pub model: ModelIdsResponses,
pub object: ResponseObject,
pub output: Vec<OutputItem>,
pub output_text: Option<String>,
pub parallel_tool_calls: bool,
pub previous_response_id: Option<String>,
pub prompt: Option<Prompt>,
pub prompt_cache_key: Option<String>,
pub prompt_cache_retention: Option<ResponsePromptCacheRetention>,
pub reasoning: Option<Reasoning>,
pub safety_identifier: Option<ResponseSafetyIdentifier>,
pub service_tier: Option<ServiceTier>,
pub status: Option<ResponseStatus>,
pub temperature: f64,
pub text: Option<ResponseTextParam>,
pub tool_choice: ToolChoiceParam,
pub tools: ToolsArray,
pub top_logprobs: Option<i64>,
pub top_p: f64,
pub truncation: Option<ResponseTruncation>,
pub usage: Option<ResponseUsage>,
pub user: Option<String>,
}Expand description
Response
JSON schema
{
"title": "The response object",
"allOf": [
{
"$ref": "#/components/schemas/ModelResponseProperties"
},
{
"$ref": "#/components/schemas/ResponseProperties"
},
{
"type": "object",
"required": [
"created_at",
"error",
"id",
"incomplete_details",
"instructions",
"metadata",
"model",
"object",
"output",
"parallel_tool_calls",
"temperature",
"tool_choice",
"tools",
"top_p"
],
"properties": {
"completed_at": {
"anyOf": [
{
"description": "Unix timestamp (in seconds) of when this Response was completed.\nOnly present when the status is `completed`.\n",
"type": "number",
"format": "unixtime"
}
]
},
"conversation": {
"anyOf": [
{
"$ref": "#/components/schemas/Conversation-2"
}
]
},
"created_at": {
"description": "Unix timestamp (in seconds) of when this Response was created.\n",
"type": "number",
"format": "unixtime"
},
"error": {
"$ref": "#/components/schemas/ResponseError"
},
"id": {
"description": "Unique identifier for this Response.\n",
"type": "string"
},
"incomplete_details": {
"anyOf": [
{
"description": "Details about why the response is incomplete.\n",
"type": "object",
"properties": {
"reason": {
"description": "The reason why the response is incomplete.",
"type": "string",
"enum": [
"max_output_tokens",
"content_filter"
]
}
}
}
]
},
"instructions": {
"anyOf": [
{
"description": "A system (or developer) message inserted into the model's context.\n\nWhen using along with `previous_response_id`, the instructions from a previous\nresponse will not be carried over to the next response. This makes it simple\nto swap out system (or developer) messages in new responses.\n",
"oneOf": [
{
"description": "A text input to the model, equivalent to a text input with the\n`developer` role.\n",
"type": "string"
},
{
"title": "Input item list",
"description": "A list of one or many input items to the model, containing\ndifferent content types.\n",
"type": "array",
"items": {
"$ref": "#/components/schemas/InputItem"
}
}
]
}
]
},
"max_output_tokens": {
"anyOf": [
{
"description": "An upper bound for the number of tokens that can be generated for a response, including visible output tokens and [reasoning tokens](/docs/guides/reasoning).\n",
"type": "integer"
}
]
},
"object": {
"description": "The object type of this resource - always set to `response`.\n",
"type": "string",
"enum": [
"response"
],
"x-stainless-const": true
},
"output": {
"description": "An array of content items generated by the model.\n\n- The length and order of items in the `output` array is dependent\n on the model's response.\n- Rather than accessing the first item in the `output` array and\n assuming it's an `assistant` message with the content generated by\n the model, you might consider using the `output_text` property where\n supported in SDKs.\n",
"type": "array",
"items": {
"$ref": "#/components/schemas/OutputItem"
}
},
"output_text": {
"anyOf": [
{
"description": "SDK-only convenience property that contains the aggregated text output\nfrom all `output_text` items in the `output` array, if any are present.\nSupported in the Python and JavaScript SDKs.\n",
"type": "string",
"x-oaiSupportedSDKs": [
"python",
"javascript"
]
}
]
},
"parallel_tool_calls": {
"description": "Whether to allow the model to run tool calls in parallel.\n",
"type": "boolean"
},
"status": {
"description": "The status of the response generation. One of `completed`, `failed`,\n`in_progress`, `cancelled`, `queued`, or `incomplete`.\n",
"type": "string",
"enum": [
"completed",
"failed",
"in_progress",
"cancelled",
"queued",
"incomplete"
]
},
"usage": {
"$ref": "#/components/schemas/ResponseUsage"
}
}
}
]
}Fields§
§background: Option<bool>§completed_at: Option<f64>§conversation: Option<Conversation2>§created_at: f64Unix timestamp (in seconds) of when this Response was created.
error: ResponseError§id: StringUnique identifier for this Response.
incomplete_details: ResponseIncompleteDetails§instructions: ResponseInstructions§max_output_tokens: Option<i64>§max_tool_calls: Option<i64>§metadata: Metadata§model: ModelIdsResponses§object: ResponseObjectThe object type of this resource - always set to response.
output: Vec<OutputItem>An array of content items generated by the model.
- The length and order of items in the
outputarray is dependent on the model’s response. - Rather than accessing the first item in the
outputarray and assuming it’s anassistantmessage with the content generated by the model, you might consider using theoutput_textproperty where supported in SDKs.
output_text: Option<String>§parallel_tool_calls: boolWhether to allow the model to run tool calls in parallel.
previous_response_id: Option<String>§prompt: Option<Prompt>§prompt_cache_key: Option<String>Used by OpenAI to cache responses for similar requests to optimize your cache hit rates. Replaces the user field. Learn more.
prompt_cache_retention: Option<ResponsePromptCacheRetention>§reasoning: Option<Reasoning>§safety_identifier: Option<ResponseSafetyIdentifier>A stable identifier used to help detect users of your application that may be violating OpenAI’s usage policies. The IDs should be a string that uniquely identifies each user, with a maximum length of 64 characters. We recommend hashing their username or email address, in order to avoid sending us any identifying information. Learn more.
service_tier: Option<ServiceTier>§status: Option<ResponseStatus>The status of the response generation. One of completed, failed,
in_progress, cancelled, queued, or incomplete.
temperature: f64§text: Option<ResponseTextParam>§tool_choice: ToolChoiceParam§tools: ToolsArray§top_logprobs: Option<i64>§top_p: f64§truncation: Option<ResponseTruncation>§usage: Option<ResponseUsage>§user: Option<String>This field is being replaced by safety_identifier and prompt_cache_key. Use prompt_cache_key instead to maintain caching optimizations.
A stable identifier for your end-users.
Used to boost cache hit rates by better bucketing similar requests and to help OpenAI detect and prevent abuse. Learn more.