{"openapi":"3.1.0","info":{"title":"Open Responses","version":"2026-04-24"},"tags":[],"paths":{"\/responses":{"post":{"operationId":"createResponse","summary":"Create response","description":"Creates a response.","parameters":[],"responses":{"200":{"description":"Success","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/ResponseResource"}},"text\/event-stream":{"schema":{"oneOf":[{"$ref":"#\/components\/schemas\/ResponseCreatedStreamingEvent"},{"$ref":"#\/components\/schemas\/ResponseQueuedStreamingEvent"},{"$ref":"#\/components\/schemas\/ResponseInProgressStreamingEvent"},{"$ref":"#\/components\/schemas\/ResponseCompletedStreamingEvent"},{"$ref":"#\/components\/schemas\/ResponseFailedStreamingEvent"},{"$ref":"#\/components\/schemas\/ResponseIncompleteStreamingEvent"},{"$ref":"#\/components\/schemas\/ResponseOutputItemAddedStreamingEvent"},{"$ref":"#\/components\/schemas\/ResponseOutputItemDoneStreamingEvent"},{"$ref":"#\/components\/schemas\/ResponseReasoningSummaryPartAddedStreamingEvent"},{"$ref":"#\/components\/schemas\/ResponseReasoningSummaryPartDoneStreamingEvent"},{"$ref":"#\/components\/schemas\/ResponseContentPartAddedStreamingEvent"},{"$ref":"#\/components\/schemas\/ResponseContentPartDoneStreamingEvent"},{"$ref":"#\/components\/schemas\/ResponseOutputTextDeltaStreamingEvent"},{"$ref":"#\/components\/schemas\/ResponseOutputTextDoneStreamingEvent"},{"$ref":"#\/components\/schemas\/ResponseRefusalDeltaStreamingEvent"},{"$ref":"#\/components\/schemas\/ResponseRefusalDoneStreamingEvent"},{"$ref":"#\/components\/schemas\/ResponseReasoningDeltaStreamingEvent"},{"$ref":"#\/components\/schemas\/ResponseReasoningDoneStreamingEvent"},{"$ref":"#\/components\/schemas\/ResponseReasoningSummaryDeltaStreamingEvent"},{"$ref":"#\/components\/schemas\/ResponseReasoningSummaryDoneStreamingEvent"},{"$ref":"#\/components\/schemas\/ResponseOutputTextAnnotationAddedStreamingEvent"},{"$ref":"#\/components\/schemas\/ResponseFunctionCallArgumentsDeltaStreamingEvent"},{"$ref":"#\/components\/schemas\/ResponseFunctionCallArgumentsDoneStreamingEvent"},{"$ref":"#\/components\/schemas\/ErrorStreamingEvent"}],"discriminator":{"propertyName":"type"}}}}}},"requestBody":{"required":false,"content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/CreateResponseBody"}},"application\/x-www-form-urlencoded":{"schema":{"$ref":"#\/components\/schemas\/CreateResponseBody"}}}}},"x-openresponses-websocket":{"description":"Open a WebSocket connection to `\/v1\/responses`. Send client events using the WebSocketResponseCreateEvent schema. Server progress messages use the same streaming event schemas as `text\/event-stream` responses. WebSocket failures use the WebSocketErrorEvent schema.","clientMessage":{"$ref":"#\/components\/schemas\/WebSocketResponseCreateEvent"},"errorMessage":{"$ref":"#\/components\/schemas\/WebSocketErrorEvent"},"x-openresponses-added-in":"2026-04-24"}},"\/responses\/compact":{"post":{"operationId":"compactResponse","summary":"Compact a response","description":"Compact a conversation. Returns a compacted response object.","parameters":[],"responses":{"200":{"description":"Success","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/CompactResource"}}}}},"requestBody":{"required":false,"content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/CompactResponseMethodPublicBody"}}}},"x-openresponses-added-in":"2026-04-24"}}},"components":{"schemas":{"IncompleteDetails":{"type":"object","required":["reason"],"properties":{"reason":{"type":"string","description":"The reason the response could not be completed."}},"description":"Details about why the response was incomplete.","title":"Incomplete details"},"MessageStatus":{"type":"string","enum":["in_progress","completed","incomplete"],"x-enumDescriptions":{"completed":"Model has finished sampling this item.","in_progress":"Model is currently sampling this item.","incomplete":"Model was interrupted from sampling this item partway through. This can occur, for example, if the model encounters a stop token or exhausts its output_token budget."}},"MessageRole":{"type":"string","enum":["user","assistant","system","developer"],"x-enumDescriptions":{"assistant":"Model-generated content in the conversation.","developer":"Developer-supplied guidance that shapes the assistant\u2019s behavior.","system":"System-level instructions that set global behavior.","user":"End\u2011user input in the conversation."}},"InputTextContent":{"type":"object","required":["type","text"],"properties":{"type":{"type":"string","enum":["input_text"],"description":"The type of the input item. Always `input_text`.","default":"input_text"},"text":{"type":"string","description":"The text input to the model."}},"description":"A text input to the model.","title":"Input text"},"UrlCitationBody":{"type":"object","required":["type","url","start_index","end_index","title"],"properties":{"type":{"type":"string","enum":["url_citation"],"description":"The type of the URL citation. Always `url_citation`.","default":"url_citation"},"url":{"type":"string","description":"The URL of the web resource."},"start_index":{"type":"integer","description":"The index of the first character of the URL citation in the message."},"end_index":{"type":"integer","description":"The index of the last character of the URL citation in the message."},"title":{"type":"string","description":"The title of the web resource."}},"description":"A citation for a web resource used to generate a model response.","title":"URL citation"},"Annotation":{"$ref":"#\/components\/schemas\/UrlCitationBody","description":"An annotation that applies to a span of output text.","discriminator":{"propertyName":"type"}},"TopLogProb":{"type":"object","required":["token","logprob","bytes"],"properties":{"token":{"type":"string"},"logprob":{"type":"number"},"bytes":{"type":"array","items":{"type":"integer"}}},"description":"The top log probability of a token.","title":"Top log probability"},"LogProb":{"type":"object","required":["token","logprob","bytes","top_logprobs"],"properties":{"token":{"type":"string"},"logprob":{"type":"number"},"bytes":{"type":"array","items":{"type":"integer"}},"top_logprobs":{"type":"array","items":{"$ref":"#\/components\/schemas\/TopLogProb"}}},"description":"The log probability of a token.","title":"Log probability"},"OutputTextContent":{"type":"object","required":["type","text","annotations"],"properties":{"type":{"type":"string","enum":["output_text"],"description":"The type of the output text. Always `output_text`.","default":"output_text"},"text":{"type":"string","description":"The text output from the model."},"annotations":{"type":"array","items":{"$ref":"#\/components\/schemas\/Annotation"},"description":"The annotations of the text output."},"logprobs":{"type":"array","items":{"$ref":"#\/components\/schemas\/LogProb"}}},"description":"A text output from the model.","title":"Output text"},"TextContent":{"type":"object","required":["type","text"],"properties":{"type":{"type":"string","enum":["text"],"default":"text"},"text":{"type":"string"}},"description":"A text content.","title":"Text Content"},"SummaryTextContent":{"type":"object","required":["type","text"],"properties":{"type":{"type":"string","enum":["summary_text"],"description":"The type of the object. Always `summary_text`.","default":"summary_text"},"text":{"type":"string","description":"A summary of the reasoning output from the model so far."}},"description":"A summary text from the model.","title":"Summary text"},"ReasoningTextContent":{"type":"object","required":["type","text"],"properties":{"type":{"type":"string","enum":["reasoning_text"],"description":"The type of the reasoning text. Always `reasoning_text`.","default":"reasoning_text"},"text":{"type":"string","description":"The reasoning text from the model."}},"description":"Reasoning text from the model.","title":"Reasoning text"},"RefusalContent":{"type":"object","required":["type","refusal"],"properties":{"type":{"type":"string","enum":["refusal"],"description":"The type of the refusal. Always `refusal`.","default":"refusal"},"refusal":{"type":"string","description":"The refusal explanation from the model."}},"description":"A refusal from the model.","title":"Refusal"},"ImageDetail":{"type":"string","enum":["low","high","auto"],"x-enumDescriptions":{"auto":"Choose the detail level automatically.","high":"Allows the model to \"see\" a higher-resolution version of the image, usually increasing input token costs.","low":"Restricts the model to a lower-resolution version of the image."}},"InputImageContent":{"type":"object","required":["type","image_url","detail"],"properties":{"type":{"type":"string","enum":["input_image"],"description":"The type of the input item. Always `input_image`.","default":"input_image"},"image_url":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"The URL of the image to be sent to the model. A fully qualified URL or base64\nencoded image in a data URL."},"detail":{"$ref":"#\/components\/schemas\/ImageDetail","description":"The detail level of the image to be sent to the model. One of `high`, `low`, or\n`auto`. Defaults to `auto`."}},"description":"An image input to the model. Learn about [image inputs](\/docs\/guides\/vision).","title":"Input image"},"InputFileContent":{"type":"object","required":["type"],"properties":{"type":{"type":"string","enum":["input_file"],"description":"The type of the input item. Always `input_file`.","default":"input_file"},"filename":{"type":"string","description":"The name of the file to be sent to the model."},"file_url":{"type":"string","description":"The URL of the file to be sent to the model."}},"description":"A file input to the model.","title":"Input file"},"InputVideoContent":{"type":"object","required":["type","video_url"],"properties":{"type":{"type":"string","enum":["input_video"],"description":"The type of the input content. Always `input_video`."},"video_url":{"type":"string","description":"A base64 or remote url that resolves to a video file."}},"description":"A content block representing a video input to the model."},"Message":{"type":"object","required":["type","id","status","role","content"],"properties":{"type":{"type":"string","enum":["message"],"description":"The type of the message. Always set to `message`.","default":"message"},"id":{"type":"string","description":"The unique ID of the message."},"status":{"$ref":"#\/components\/schemas\/MessageStatus","description":"The status of item. One of `in_progress`, `completed`, or `incomplete`. Populated\nwhen items are returned via API."},"role":{"$ref":"#\/components\/schemas\/MessageRole","description":"The role of the message. One of `unknown`, `user`, `assistant`, `system`, `critic`,\n`discriminator`, `developer`, or `tool`."},"content":{"type":"array","items":{"oneOf":[{"$ref":"#\/components\/schemas\/InputTextContent"},{"$ref":"#\/components\/schemas\/OutputTextContent"},{"$ref":"#\/components\/schemas\/TextContent"},{"$ref":"#\/components\/schemas\/SummaryTextContent"},{"$ref":"#\/components\/schemas\/ReasoningTextContent"},{"$ref":"#\/components\/schemas\/RefusalContent"},{"$ref":"#\/components\/schemas\/InputImageContent"},{"$ref":"#\/components\/schemas\/InputFileContent"},{"$ref":"#\/components\/schemas\/InputVideoContent"}],"description":"A content part that makes up an input or output item.","discriminator":{"propertyName":"type"}},"description":"The content of the message"},"phase":{"type":"string","enum":["commentary","final_answer"],"description":"Labels an `assistant` message as intermediate commentary (`commentary`) or the\nfinal answer (`final_answer`). For models like `gpt-5.3-codex` and beyond, when\nsending follow-up requests, preserve and resend phase on all assistant messages.\nOmitting it can degrade performance. Not used for user messages.","x-openresponses-added-in":"2026-04-24"}},"description":"A message to or from the model.","title":"Message"},"FunctionCallStatus":{"type":"string","enum":["in_progress","completed","incomplete"],"x-enumDescriptions":{"completed":"Model has finished sampling this item.","in_progress":"Model is currently sampling this item.","incomplete":"Model was interrupted from sampling this item partway through. This can occur, for example, if the model encounters a stop token or exhausts its output_token budget."}},"FunctionCall":{"type":"object","required":["type","id","call_id","name","arguments","status"],"properties":{"type":{"type":"string","enum":["function_call"],"description":"The type of the item. Always `function_call`.","default":"function_call"},"id":{"type":"string","description":"The unique ID of the function call item."},"call_id":{"type":"string","description":"The unique ID of the function tool call that was generated."},"name":{"type":"string","description":"The name of the function that was called."},"arguments":{"type":"string","description":"The arguments JSON string that was generated."},"status":{"$ref":"#\/components\/schemas\/FunctionCallStatus","description":"The status of the function call item that was recorded."}},"description":"A function tool call that was generated by the model.","title":"Function call"},"FunctionCallOutputStatusEnum":{"type":"string","enum":["in_progress","completed","incomplete"],"description":"Similar to `FunctionCallStatus`. All three options are allowed here for\ncompatibility, but because in practice these items will be provided by developers,\nonly `completed` should be used."},"FunctionCallOutput":{"type":"object","required":["type","id","call_id","output","status"],"properties":{"type":{"type":"string","enum":["function_call_output"],"description":"The type of the function tool call output. Always `function_call_output`.","default":"function_call_output"},"id":{"type":"string","description":"The unique ID of the function tool call output. Populated when this item is\nreturned via API."},"call_id":{"type":"string","description":"The unique ID of the function tool call generated by the model."},"output":{"oneOf":[{"type":"string"},{"type":"array","items":{"oneOf":[{"$ref":"#\/components\/schemas\/InputTextContent"},{"$ref":"#\/components\/schemas\/InputImageContent"},{"$ref":"#\/components\/schemas\/InputFileContent"}],"description":"A content part that makes up an input or output item.","discriminator":{"propertyName":"type"}}}],"description":"The function tool call output, as a JSON string or an array of text, image,\nor file content."},"status":{"$ref":"#\/components\/schemas\/FunctionCallOutputStatusEnum","description":"The status of the item. One of `in_progress`, `completed`, or `incomplete`.\nPopulated when items are returned via API."}},"description":"A function tool call output that was returned by the tool.","title":"Function call output"},"ReasoningBody":{"type":"object","required":["type","id","summary"],"properties":{"type":{"type":"string","enum":["reasoning"],"description":"The type of the item. Always `reasoning`.","default":"reasoning"},"id":{"type":"string","description":"The unique ID of the reasoning item."},"content":{"type":"array","items":{"oneOf":[{"$ref":"#\/components\/schemas\/InputTextContent"},{"$ref":"#\/components\/schemas\/OutputTextContent"},{"$ref":"#\/components\/schemas\/TextContent"},{"$ref":"#\/components\/schemas\/SummaryTextContent"},{"$ref":"#\/components\/schemas\/ReasoningTextContent"},{"$ref":"#\/components\/schemas\/RefusalContent"},{"$ref":"#\/components\/schemas\/InputImageContent"},{"$ref":"#\/components\/schemas\/InputFileContent"}],"description":"A content part that makes up an input or output item.","discriminator":{"propertyName":"type"}},"description":"The reasoning content that was generated."},"summary":{"type":"array","items":{"oneOf":[{"$ref":"#\/components\/schemas\/InputTextContent"},{"$ref":"#\/components\/schemas\/OutputTextContent"},{"$ref":"#\/components\/schemas\/TextContent"},{"$ref":"#\/components\/schemas\/SummaryTextContent"},{"$ref":"#\/components\/schemas\/ReasoningTextContent"},{"$ref":"#\/components\/schemas\/RefusalContent"},{"$ref":"#\/components\/schemas\/InputImageContent"},{"$ref":"#\/components\/schemas\/InputFileContent"}],"description":"A content part that makes up an input or output item.","discriminator":{"propertyName":"type"}},"description":"The reasoning summary content that was generated."},"encrypted_content":{"type":"string","description":"The encrypted reasoning content that was generated."}},"description":"A reasoning item that was generated by the model.","title":"Reasoning item"},"CompactionBody":{"type":"object","required":["type","id","encrypted_content"],"properties":{"type":{"type":"string","enum":["compaction"],"description":"The type of the item. Always `compaction`.","default":"compaction"},"id":{"type":"string","description":"The unique ID of the compaction item."},"encrypted_content":{"type":"string","description":"The encrypted content that was produced by compaction."},"created_by":{"type":"string","description":"The identifier of the actor that created the item."}},"description":"A compaction item generated by the [`v1\/responses\/compact`\nAPI](\/docs\/api-reference\/responses\/compact).","title":"Compaction item","x-openresponses-added-in":"2026-04-24"},"ItemField":{"oneOf":[{"$ref":"#\/components\/schemas\/Message"},{"$ref":"#\/components\/schemas\/FunctionCall"},{"$ref":"#\/components\/schemas\/FunctionCallOutput"},{"$ref":"#\/components\/schemas\/ReasoningBody"},{"$ref":"#\/components\/schemas\/CompactionBody"}],"description":"An item representing a message, tool call, tool output, reasoning, or other response\nelement.","discriminator":{"propertyName":"type"}},"Error":{"type":"object","required":["code","message"],"properties":{"code":{"type":"string","description":"A machine-readable error code that was returned."},"message":{"type":"string","description":"A human-readable description of the error that was returned."}},"description":"An error that occurred while generating the response.","title":"Error"},"FunctionTool":{"type":"object","required":["type","name","description","parameters","strict"],"properties":{"type":{"type":"string","enum":["function"],"description":"The type of the function tool. Always `function`.","default":"function"},"name":{"type":"string","description":"The name of the function to call."},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"A description of the function. Used by the model to determine whether or not to\ncall the function."},"parameters":{"anyOf":[{"type":"object","additionalProperties":{}},{"type":"null"}],"description":"A JSON schema object describing the parameters of the function."},"strict":{"anyOf":[{"type":"boolean"},{"type":"null"}],"description":"Whether to enforce strict parameter validation. Default `true`."}},"description":"Defines a function in your own code the model can choose to call. Learn more about\n[function calling](https:\/\/platform.openai.com\/docs\/guides\/function-calling).","title":"Function"},"Tool":{"$ref":"#\/components\/schemas\/FunctionTool","description":"A tool that can be used to generate a response.","discriminator":{"propertyName":"type"}},"FunctionToolChoice":{"type":"object","required":["type"],"properties":{"type":{"type":"string","enum":["function"],"default":"function"},"name":{"type":"string"}}},"ToolChoiceValueEnum":{"type":"string","enum":["none","auto","required"],"x-enumDescriptions":{"auto":"Let the model choose the tools from among the provided set.","none":"Restrict the model from calling any tools.","required":"Require the model to call a tool."}},"AllowedToolChoice":{"type":"object","required":["type","tools","mode"],"properties":{"type":{"type":"string","enum":["allowed_tools"],"default":"allowed_tools"},"tools":{"type":"array","items":{"$ref":"#\/components\/schemas\/FunctionToolChoice"}},"mode":{"$ref":"#\/components\/schemas\/ToolChoiceValueEnum"}}},"TruncationEnum":{"type":"string","enum":["auto","disabled"],"x-enumDescriptions":{"auto":"Let the service decide how to truncate.","disabled":"Disable service truncation. Context over the model's context limit will result in a 400 error."}},"TextResponseFormat":{"type":"object","required":["type"],"properties":{"type":{"type":"string","enum":["text"],"default":"text"}}},"JsonObjectResponseFormat":{"type":"object","required":["type"],"properties":{"type":{"type":"string","enum":["json_object"],"default":"json_object"}}},"JsonSchemaResponseFormat":{"type":"object","required":["type","name","description","schema","strict"],"properties":{"type":{"type":"string","enum":["json_schema"],"default":"json_schema"},"name":{"type":"string"},"description":{"anyOf":[{"type":"string"},{"type":"null"}]},"schema":{"type":"null"},"strict":{"type":"boolean"}}},"VerbosityEnum":{"type":"string","enum":["low","medium","high"],"x-enumDescriptions":{"high":"Instruct the model to emit more verbose final responses.","low":"Instruct the model to emit less verbose final responses.","medium":"Use the model's default verbosity setting."}},"TextField":{"type":"object","required":["format"],"properties":{"format":{"oneOf":[{"$ref":"#\/components\/schemas\/TextResponseFormat"},{"$ref":"#\/components\/schemas\/JsonObjectResponseFormat"},{"$ref":"#\/components\/schemas\/JsonSchemaResponseFormat"}]},"verbosity":{"$ref":"#\/components\/schemas\/VerbosityEnum"}}},"ReasoningEffortEnum":{"type":"string","enum":["none","low","medium","high","xhigh"],"x-enumDescriptions":{"high":"Use a higher reasoning effort to improve answer quality.","medium":"Use a balanced reasoning effort.","low":"Use a lower reasoning effort for faster responses.","minimal":"Use the lowest non-zero reasoning effort.","none":"Restrict the model from performing any reasoning before emitting a final answer.","xhigh":"Use the maximum reasoning effort available."}},"ReasoningSummaryEnum":{"type":"string","enum":["concise","detailed","auto"],"x-enumDescriptions":{"auto":"Allow the model to decide when to summarize.","concise":"Emit concise summaries of reasoning content.","detailed":"Emit details summaries of reasoning content."}},"Reasoning":{"type":"object","required":["effort","summary"],"properties":{"effort":{"anyOf":[{"$ref":"#\/components\/schemas\/ReasoningEffortEnum"},{"type":"null"}],"description":"The reasoning effort that was requested for the model, if specified."},"summary":{"anyOf":[{"$ref":"#\/components\/schemas\/ReasoningSummaryEnum"},{"type":"null"}],"description":"A model-generated summary of its reasoning that was produced, if available."}},"description":"Reasoning configuration and metadata that were used for the response.","title":"Reasoning"},"InputTokensDetails":{"type":"object","required":["cached_tokens"],"properties":{"cached_tokens":{"type":"integer","description":"The number of input tokens that were served from cache."}},"description":"A breakdown of input token usage that was recorded.","title":"Input tokens details"},"OutputTokensDetails":{"type":"object","required":["reasoning_tokens"],"properties":{"reasoning_tokens":{"type":"integer","description":"The number of output tokens that were attributed to reasoning."}},"description":"A breakdown of output token usage that was recorded.","title":"Output tokens details"},"Usage":{"type":"object","required":["input_tokens","output_tokens","total_tokens","input_tokens_details","output_tokens_details"],"properties":{"input_tokens":{"type":"integer","description":"The number of input tokens that were used to generate the response."},"output_tokens":{"type":"integer","description":"The number of output tokens that were generated by the model."},"total_tokens":{"type":"integer","description":"The total number of tokens that were used."},"input_tokens_details":{"$ref":"#\/components\/schemas\/InputTokensDetails","description":"A breakdown of input token usage that was recorded."},"output_tokens_details":{"$ref":"#\/components\/schemas\/OutputTokensDetails","description":"A breakdown of output token usage that was recorded."}},"description":"Token usage statistics that were recorded for the response.","title":"Usage"},"ResponseResource":{"type":"object","required":["id","object","created_at","completed_at","status","incomplete_details","model","previous_response_id","instructions","output","error","tools","tool_choice","truncation","parallel_tool_calls","text","top_p","presence_penalty","frequency_penalty","top_logprobs","temperature","reasoning","usage","max_output_tokens","max_tool_calls","store","background","service_tier","metadata","safety_identifier","prompt_cache_key"],"properties":{"id":{"type":"string","description":"The unique ID of the response that was created."},"object":{"type":"string","enum":["response"],"description":"The object type, which was always `response`.","default":"response"},"created_at":{"type":"integer","description":"The Unix timestamp (in seconds) for when the response was created."},"completed_at":{"anyOf":[{"type":"integer"},{"type":"null"}],"description":"The Unix timestamp (in seconds) for when the response was completed, if it was\ncompleted."},"status":{"type":"string","description":"The status that was set for the response."},"incomplete_details":{"anyOf":[{"$ref":"#\/components\/schemas\/IncompleteDetails"},{"type":"null"}],"description":"Details about why the response was incomplete, if applicable."},"model":{"type":"string","description":"The model that generated this response."},"previous_response_id":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"The ID of the previous response in the chain that was referenced, if any."},"instructions":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Additional instructions that were used to guide the model for this response."},"output":{"type":"array","items":{"$ref":"#\/components\/schemas\/ItemField"},"description":"The output items that were generated by the model."},"error":{"anyOf":[{"$ref":"#\/components\/schemas\/Error"},{"type":"null"}],"description":"The error that occurred, if the response failed."},"tools":{"type":"array","items":{"$ref":"#\/components\/schemas\/Tool"},"description":"The tools that were available to the model during response generation."},"tool_choice":{"oneOf":[{"$ref":"#\/components\/schemas\/FunctionToolChoice"},{"$ref":"#\/components\/schemas\/ToolChoiceValueEnum"},{"$ref":"#\/components\/schemas\/AllowedToolChoice"}]},"truncation":{"$ref":"#\/components\/schemas\/TruncationEnum","description":"How the input was truncated by the service when it exceeded the model context\nwindow."},"parallel_tool_calls":{"type":"boolean","description":"Whether the model was allowed to call multiple tools in parallel."},"text":{"$ref":"#\/components\/schemas\/TextField","description":"Configuration options for text output that were used."},"top_p":{"type":"number","description":"The nucleus sampling parameter that was used for this response."},"presence_penalty":{"type":"number","description":"The presence penalty that was used to penalize new tokens based on whether they\nappear in the text so far."},"frequency_penalty":{"type":"number","description":"The frequency penalty that was used to penalize new tokens based on their frequency\nin the text so far."},"top_logprobs":{"type":"integer","description":"The number of most likely tokens that were returned at each position, along with\ntheir log probabilities."},"temperature":{"type":"number","description":"The sampling temperature that was used for this response."},"reasoning":{"anyOf":[{"$ref":"#\/components\/schemas\/Reasoning"},{"type":"null"}],"description":"Reasoning configuration and outputs that were produced for this response."},"usage":{"anyOf":[{"$ref":"#\/components\/schemas\/Usage"},{"type":"null"}],"description":"Token usage statistics that were recorded for the response, if available."},"max_output_tokens":{"anyOf":[{"type":"integer"},{"type":"null"}],"description":"The maximum number of tokens the model was allowed to generate for this response."},"max_tool_calls":{"anyOf":[{"type":"integer"},{"type":"null"}],"description":"The maximum number of tool calls the model was allowed to make while generating the\nresponse."},"store":{"type":"boolean","description":"Whether this response was stored so it can be retrieved later."},"background":{"type":"boolean","description":"Whether this request was run in the background."},"service_tier":{"type":"string","description":"The service tier that was used for this response."},"metadata":{"description":"Developer-defined metadata that was associated with the response."},"safety_identifier":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"A stable identifier that was used for safety monitoring and abuse detection."},"prompt_cache_key":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"A key that was used to read from or write to the prompt cache."}},"description":"The complete response object that was returned by the Responses API.","title":"The response object","example":{"id":"resp_67ccd3a9da748190baa7f1570fe91ac604becb25c45c1d41","object":"response","created_at":1741476777,"status":"completed","completed_at":1741476778,"model":"gpt-4o-2024-08-06","output":[{"type":"message","id":"msg_67ccd3acc8d48190a77525dc6de64b4104becb25c45c1d41","status":"completed","role":"assistant","content":[{"type":"output_text","text":"The image depicts a scenic landscape with a wooden boardwalk or pathway leading through lush, green grass under a blue sky with some clouds. The setting suggests a peaceful natural area, possibly a park or nature reserve. There are trees and shrubs in the background.","annotations":[]}]}],"parallel_tool_calls":true,"reasoning":{},"store":true,"background":false,"temperature":1,"presence_penalty":0,"frequency_penalty":0,"text":{"format":{"type":"text"}},"tool_choice":"auto","tools":[],"top_p":1,"truncation":"disabled","usage":{"input_tokens":328,"input_tokens_details":{"cached_tokens":0},"output_tokens":52,"output_tokens_details":{"reasoning_tokens":0},"total_tokens":380},"metadata":{},"service_tier":"default","top_logprobs":0}},"ResponseCreatedStreamingEvent":{"type":"object","required":["type","sequence_number","response"],"properties":{"type":{"type":"string","enum":["response.created"],"description":"The type of the event, always `response.created`.","default":"response.created"},"sequence_number":{"type":"integer","description":"The sequence number of the event that was emitted."},"response":{"$ref":"#\/components\/schemas\/ResponseResource","description":"The response snapshot that was emitted with the event."}},"description":"A streaming event that indicated the response was created.","title":"Response created event"},"ResponseQueuedStreamingEvent":{"type":"object","required":["type","sequence_number","response"],"properties":{"type":{"type":"string","enum":["response.queued"],"description":"The type of the event, always `response.queued`.","default":"response.queued"},"sequence_number":{"type":"integer","description":"The sequence number of the event that was emitted."},"response":{"$ref":"#\/components\/schemas\/ResponseResource","description":"The response snapshot that was emitted with the event."}},"description":"A streaming event that indicated the response was queued.","title":"Response queued event"},"ResponseInProgressStreamingEvent":{"type":"object","required":["type","sequence_number","response"],"properties":{"type":{"type":"string","enum":["response.in_progress"],"description":"The type of the event, always `response.in_progress`.","default":"response.in_progress"},"sequence_number":{"type":"integer","description":"The sequence number of the event that was emitted."},"response":{"$ref":"#\/components\/schemas\/ResponseResource","description":"The response snapshot that was emitted with the event."}},"description":"A streaming event that indicated the response was in progress.","title":"Response in progress event"},"ResponseCompletedStreamingEvent":{"type":"object","required":["type","sequence_number","response"],"properties":{"type":{"type":"string","enum":["response.completed"],"description":"The type of the event, always `response.completed`.","default":"response.completed"},"sequence_number":{"type":"integer","description":"The sequence number of the event that was emitted."},"response":{"$ref":"#\/components\/schemas\/ResponseResource","description":"The response snapshot that was emitted with the event."}},"description":"A streaming event that indicated the response was completed.","title":"Response completed event"},"ResponseFailedStreamingEvent":{"type":"object","required":["type","sequence_number","response"],"properties":{"type":{"type":"string","enum":["response.failed"],"description":"The type of the event, always `response.failed`.","default":"response.failed"},"sequence_number":{"type":"integer","description":"The sequence number of the event that was emitted."},"response":{"$ref":"#\/components\/schemas\/ResponseResource","description":"The response snapshot that was emitted with the event."}},"description":"A streaming event that indicated the response had failed.","title":"Response failed event"},"ResponseIncompleteStreamingEvent":{"type":"object","required":["type","sequence_number","response"],"properties":{"type":{"type":"string","enum":["response.incomplete"],"description":"The type of the event, always `response.incomplete`.","default":"response.incomplete"},"sequence_number":{"type":"integer","description":"The sequence number of the event that was emitted."},"response":{"$ref":"#\/components\/schemas\/ResponseResource","description":"The response snapshot that was emitted with the event."}},"description":"A streaming event that indicated the response was incomplete.","title":"Response incomplete event"},"ResponseOutputItemAddedStreamingEvent":{"type":"object","required":["type","sequence_number","output_index","item"],"properties":{"type":{"type":"string","enum":["response.output_item.added"],"description":"The type of the event, always `response.output_item.added`.","default":"response.output_item.added"},"sequence_number":{"type":"integer","description":"The sequence number of the event that was emitted."},"output_index":{"type":"integer","description":"The index of the output item that was added."},"item":{"anyOf":[{"$ref":"#\/components\/schemas\/ItemField"},{"type":"null"}],"description":"An item representing a message, tool call, tool output, reasoning, or other\nresponse element."}},"description":"A streaming event that indicated an output item was added to the response.","title":"Response output item added event"},"ResponseOutputItemDoneStreamingEvent":{"type":"object","required":["type","sequence_number","output_index","item"],"properties":{"type":{"type":"string","enum":["response.output_item.done"],"description":"The type of the event, always `response.output_item.done`.","default":"response.output_item.done"},"sequence_number":{"type":"integer","description":"The sequence number of the event that was emitted."},"output_index":{"type":"integer","description":"The index of the output item that was completed."},"item":{"anyOf":[{"$ref":"#\/components\/schemas\/ItemField"},{"type":"null"}],"description":"An item representing a message, tool call, tool output, reasoning, or other\nresponse element."}},"description":"A streaming event that indicated an output item was completed.","title":"Response output item done event"},"ResponseReasoningSummaryPartAddedStreamingEvent":{"type":"object","required":["type","sequence_number","item_id","output_index","summary_index","part"],"properties":{"type":{"type":"string","enum":["response.reasoning_summary_part.added"],"description":"The type of the event, always `response.reasoning_summary_part.added`.","default":"response.reasoning_summary_part.added"},"sequence_number":{"type":"integer","description":"The sequence number of the event that was emitted."},"item_id":{"type":"string","description":"The ID of the item that was updated."},"output_index":{"type":"integer","description":"The index of the output item that was updated."},"summary_index":{"type":"integer","description":"The index of the summary part that was added."},"part":{"oneOf":[{"$ref":"#\/components\/schemas\/InputTextContent"},{"$ref":"#\/components\/schemas\/OutputTextContent"},{"$ref":"#\/components\/schemas\/TextContent"},{"$ref":"#\/components\/schemas\/SummaryTextContent"},{"$ref":"#\/components\/schemas\/ReasoningTextContent"},{"$ref":"#\/components\/schemas\/RefusalContent"},{"$ref":"#\/components\/schemas\/InputImageContent"},{"$ref":"#\/components\/schemas\/InputFileContent"}],"description":"A content part that makes up an input or output item.","discriminator":{"propertyName":"type"}}},"description":"A streaming event that indicated a reasoning summary part was added.","title":"Response reasoning summary part added event"},"ResponseReasoningSummaryPartDoneStreamingEvent":{"type":"object","required":["type","sequence_number","item_id","output_index","summary_index","part"],"properties":{"type":{"type":"string","enum":["response.reasoning_summary_part.done"],"description":"The type of the event, always `response.reasoning_summary_part.done`.","default":"response.reasoning_summary_part.done"},"sequence_number":{"type":"integer","description":"The sequence number of the event that was emitted."},"item_id":{"type":"string","description":"The ID of the item that was updated."},"output_index":{"type":"integer","description":"The index of the output item that was updated."},"summary_index":{"type":"integer","description":"The index of the summary part that was completed."},"part":{"oneOf":[{"$ref":"#\/components\/schemas\/InputTextContent"},{"$ref":"#\/components\/schemas\/OutputTextContent"},{"$ref":"#\/components\/schemas\/TextContent"},{"$ref":"#\/components\/schemas\/SummaryTextContent"},{"$ref":"#\/components\/schemas\/ReasoningTextContent"},{"$ref":"#\/components\/schemas\/RefusalContent"},{"$ref":"#\/components\/schemas\/InputImageContent"},{"$ref":"#\/components\/schemas\/InputFileContent"}],"description":"A content part that makes up an input or output item.","discriminator":{"propertyName":"type"}}},"description":"A streaming event that indicated a reasoning summary part was completed.","title":"Response reasoning summary part done event"},"ResponseContentPartAddedStreamingEvent":{"type":"object","required":["type","sequence_number","item_id","output_index","content_index","part"],"properties":{"type":{"type":"string","enum":["response.content_part.added"],"description":"The type of the event, always `response.content_part.added`.","default":"response.content_part.added"},"sequence_number":{"type":"integer","description":"The sequence number of the event that was emitted."},"item_id":{"type":"string","description":"The ID of the item that was updated."},"output_index":{"type":"integer","description":"The index of the output item that was updated."},"content_index":{"type":"integer","description":"The index of the content part that was added."},"part":{"oneOf":[{"$ref":"#\/components\/schemas\/InputTextContent"},{"$ref":"#\/components\/schemas\/OutputTextContent"},{"$ref":"#\/components\/schemas\/TextContent"},{"$ref":"#\/components\/schemas\/SummaryTextContent"},{"$ref":"#\/components\/schemas\/ReasoningTextContent"},{"$ref":"#\/components\/schemas\/RefusalContent"},{"$ref":"#\/components\/schemas\/InputImageContent"},{"$ref":"#\/components\/schemas\/InputFileContent"}],"description":"A content part that makes up an input or output item.","discriminator":{"propertyName":"type"}}},"description":"A streaming event that indicated a content part was added.","title":"Response content part added event"},"ResponseContentPartDoneStreamingEvent":{"type":"object","required":["type","sequence_number","item_id","output_index","content_index","part"],"properties":{"type":{"type":"string","enum":["response.content_part.done"],"description":"The type of the event, always `response.content_part.done`.","default":"response.content_part.done"},"sequence_number":{"type":"integer","description":"The sequence number of the event that was emitted."},"item_id":{"type":"string","description":"The ID of the item that was updated."},"output_index":{"type":"integer","description":"The index of the output item that was updated."},"content_index":{"type":"integer","description":"The index of the content part that was completed."},"part":{"oneOf":[{"$ref":"#\/components\/schemas\/InputTextContent"},{"$ref":"#\/components\/schemas\/OutputTextContent"},{"$ref":"#\/components\/schemas\/TextContent"},{"$ref":"#\/components\/schemas\/SummaryTextContent"},{"$ref":"#\/components\/schemas\/ReasoningTextContent"},{"$ref":"#\/components\/schemas\/RefusalContent"},{"$ref":"#\/components\/schemas\/InputImageContent"},{"$ref":"#\/components\/schemas\/InputFileContent"}],"description":"A content part that makes up an input or output item.","discriminator":{"propertyName":"type"}}},"description":"A streaming event that indicated a content part was completed.","title":"Response content part done event"},"ResponseOutputTextDeltaStreamingEvent":{"type":"object","required":["type","sequence_number","item_id","output_index","content_index","delta"],"properties":{"type":{"type":"string","enum":["response.output_text.delta"],"description":"The type of the event, always `response.output_text.delta`.","default":"response.output_text.delta"},"sequence_number":{"type":"integer","description":"The sequence number of the event that was emitted."},"item_id":{"type":"string","description":"The ID of the item that was updated."},"output_index":{"type":"integer","description":"The index of the output item that was updated."},"content_index":{"type":"integer","description":"The index of the content part that was updated."},"delta":{"type":"string","description":"The text delta that was appended."},"logprobs":{"type":"array","items":{"$ref":"#\/components\/schemas\/LogProb"},"description":"The token log probabilities that were emitted with the delta, if any."},"obfuscation":{"type":"string","description":"An obfuscation string that was added to pad the event payload."}},"description":"A streaming event that indicated output text was incrementally added.","title":"Response output text delta event"},"ResponseOutputTextDoneStreamingEvent":{"type":"object","required":["type","sequence_number","item_id","output_index","content_index","text"],"properties":{"type":{"type":"string","enum":["response.output_text.done"],"description":"The type of the event, always `response.output_text.done`.","default":"response.output_text.done"},"sequence_number":{"type":"integer","description":"The sequence number of the event that was emitted."},"item_id":{"type":"string","description":"The ID of the item that was updated."},"output_index":{"type":"integer","description":"The index of the output item that was updated."},"content_index":{"type":"integer","description":"The index of the content part that was completed."},"text":{"type":"string","description":"The final text that was emitted."},"logprobs":{"type":"array","items":{"$ref":"#\/components\/schemas\/LogProb"},"description":"The token log probabilities that were emitted with the final text, if any."}},"description":"A streaming event that indicated output text was completed.","title":"Response output text done event"},"ResponseRefusalDeltaStreamingEvent":{"type":"object","required":["type","sequence_number","item_id","output_index","content_index","delta"],"properties":{"type":{"type":"string","enum":["response.refusal.delta"],"description":"The type of the event, always `response.refusal.delta`.","default":"response.refusal.delta"},"sequence_number":{"type":"integer","description":"The sequence number of the event that was emitted."},"item_id":{"type":"string","description":"The ID of the item that was updated."},"output_index":{"type":"integer","description":"The index of the output item that was updated."},"content_index":{"type":"integer","description":"The index of the refusal content that was updated."},"delta":{"type":"string","description":"The refusal text delta that was appended."}},"description":"A streaming event that indicated refusal text was incrementally added.","title":"Response refusal delta event"},"ResponseRefusalDoneStreamingEvent":{"type":"object","required":["type","sequence_number","item_id","output_index","content_index","refusal"],"properties":{"type":{"type":"string","enum":["response.refusal.done"],"description":"The type of the event, always `response.refusal.done`.","default":"response.refusal.done"},"sequence_number":{"type":"integer","description":"The sequence number of the event that was emitted."},"item_id":{"type":"string","description":"The ID of the item that was updated."},"output_index":{"type":"integer","description":"The index of the output item that was updated."},"content_index":{"type":"integer","description":"The index of the refusal content that was completed."},"refusal":{"type":"string","description":"The final refusal text that was emitted."}},"description":"A streaming event that indicated refusal text was completed.","title":"Response refusal done event"},"ResponseReasoningDeltaStreamingEvent":{"type":"object","required":["type","sequence_number","item_id","output_index","content_index","delta"],"properties":{"type":{"type":"string","enum":["response.reasoning.delta"],"description":"The type of the event, always `response.reasoning.delta`.","default":"response.reasoning.delta"},"sequence_number":{"type":"integer","description":"The sequence number of the event that was emitted."},"item_id":{"type":"string","description":"The ID of the item that was updated."},"output_index":{"type":"integer","description":"The index of the output item that was updated."},"content_index":{"type":"integer","description":"The index of the reasoning content that was updated."},"delta":{"type":"string","description":"The reasoning text delta that was appended."},"obfuscation":{"type":"string","description":"An obfuscation string that was added to pad the event payload."}},"description":"A streaming event that indicated reasoning text was incrementally added.","title":"Response reasoning delta event"},"ResponseReasoningDoneStreamingEvent":{"type":"object","required":["type","sequence_number","item_id","output_index","content_index","text"],"properties":{"type":{"type":"string","enum":["response.reasoning.done"],"description":"The type of the event, always `response.reasoning.done`.","default":"response.reasoning.done"},"sequence_number":{"type":"integer","description":"The sequence number of the event that was emitted."},"item_id":{"type":"string","description":"The ID of the item that was updated."},"output_index":{"type":"integer","description":"The index of the output item that was updated."},"content_index":{"type":"integer","description":"The index of the reasoning content that was completed."},"text":{"type":"string","description":"The final reasoning text that was emitted."}},"description":"A streaming event that indicated reasoning text was completed.","title":"Response reasoning done event"},"ResponseReasoningSummaryDeltaStreamingEvent":{"type":"object","required":["type","sequence_number","item_id","output_index","summary_index","delta"],"properties":{"type":{"type":"string","enum":["response.reasoning_summary_text.delta"],"description":"The type of the event, always `response.reasoning_summary.delta`.","default":"response.reasoning_summary_text.delta"},"sequence_number":{"type":"integer","description":"The sequence number of the event that was emitted."},"item_id":{"type":"string","description":"The ID of the item that was updated."},"output_index":{"type":"integer","description":"The index of the output item that was updated."},"summary_index":{"type":"integer","description":"The index of the summary content that was updated."},"delta":{"type":"string","description":"The summary text delta that was appended."},"obfuscation":{"type":"string","description":"An obfuscation string that was added to pad the event payload."}},"description":"A streaming event that indicated a reasoning summary was incrementally added.","title":"Response reasoning summary delta event"},"ResponseReasoningSummaryDoneStreamingEvent":{"type":"object","required":["type","sequence_number","item_id","output_index","summary_index","text"],"properties":{"type":{"type":"string","enum":["response.reasoning_summary_text.done"],"description":"The type of the event, always `response.reasoning_summary.done`.","default":"response.reasoning_summary_text.done"},"sequence_number":{"type":"integer","description":"The sequence number of the event that was emitted."},"item_id":{"type":"string","description":"The ID of the item that was updated."},"output_index":{"type":"integer","description":"The index of the output item that was updated."},"summary_index":{"type":"integer","description":"The index of the summary content that was completed."},"text":{"type":"string","description":"The final summary text that was emitted."}},"description":"A streaming event that indicated a reasoning summary was completed.","title":"Response reasoning summary done event"},"ResponseOutputTextAnnotationAddedStreamingEvent":{"type":"object","required":["type","sequence_number","item_id","output_index","content_index","annotation_index","annotation"],"properties":{"type":{"type":"string","enum":["response.output_text.annotation.added"],"description":"The type of the event, always `response.output_text.annotation.added`.","default":"response.output_text.annotation.added"},"sequence_number":{"type":"integer","description":"The sequence number of the event that was emitted."},"item_id":{"type":"string","description":"The ID of the item that was updated."},"output_index":{"type":"integer","description":"The index of the output item that was updated."},"content_index":{"type":"integer","description":"The index of the output text content that was updated."},"annotation_index":{"type":"integer","description":"The index of the annotation that was added."},"annotation":{"anyOf":[{"$ref":"#\/components\/schemas\/Annotation"},{"type":"null"}],"description":"An annotation that applies to a span of output text."}},"description":"A streaming event that indicated an output text annotation was added.","title":"Response output text annotation added event"},"ResponseFunctionCallArgumentsDeltaStreamingEvent":{"type":"object","required":["type","sequence_number","item_id","output_index","delta"],"properties":{"type":{"type":"string","enum":["response.function_call_arguments.delta"],"description":"The type of the event, always `response.function_call_arguments.delta`.","default":"response.function_call_arguments.delta"},"sequence_number":{"type":"integer","description":"The sequence number of the event that was emitted."},"item_id":{"type":"string","description":"The ID of the tool call item that was updated."},"output_index":{"type":"integer","description":"The index of the output item that was updated."},"delta":{"type":"string","description":"The arguments delta that was appended."},"obfuscation":{"type":"string","description":"An obfuscation string that was added to pad the event payload."}},"description":"A streaming event that indicated function call arguments were incrementally added.","title":"Response function call arguments delta event"},"ResponseFunctionCallArgumentsDoneStreamingEvent":{"type":"object","required":["type","sequence_number","item_id","output_index","arguments"],"properties":{"type":{"type":"string","enum":["response.function_call_arguments.done"],"description":"The type of the event, always `response.function_call_arguments.done`.","default":"response.function_call_arguments.done"},"sequence_number":{"type":"integer","description":"The sequence number of the event that was emitted."},"item_id":{"type":"string","description":"The ID of the tool call item that was updated."},"output_index":{"type":"integer","description":"The index of the output item that was updated."},"arguments":{"type":"string","description":"The final arguments string that was emitted."}},"description":"A streaming event that indicated function call arguments were completed.","title":"Response function call arguments done event"},"ErrorPayload":{"type":"object","required":["type","code","message","param"],"properties":{"type":{"type":"string","description":"The error type that was emitted."},"code":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"The error code that was emitted, if any."},"message":{"type":"string","description":"The human-readable error message that was emitted."},"param":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"The parameter name that was associated with the error, if any."},"headers":{"type":"object","description":"The response headers that were emitted with the error, if any.","additionalProperties":{"type":"string"}}},"description":"An error payload that was emitted for a streaming error event.","title":"Error payload"},"ErrorStreamingEvent":{"type":"object","required":["type","sequence_number","error"],"properties":{"type":{"type":"string","enum":["error"],"description":"The type of the event, always `error`.","default":"error"},"sequence_number":{"type":"integer","description":"The sequence number of the event that was emitted."},"error":{"$ref":"#\/components\/schemas\/ErrorPayload","description":"The error payload that was emitted."}},"description":"A streaming event that indicated an error was emitted.","title":"Error event"},"ItemReferenceParam":{"type":"object","required":["id"],"properties":{"type":{"anyOf":[{"type":"string","default":"item_reference","enum":["item_reference"]},{"type":"null"}],"description":"The type of item to reference. Always `item_reference`."},"id":{"type":"string","description":"The ID of the item to reference."}},"description":"An internal identifier for an item to reference.","title":"Item reference"},"ReasoningSummaryContentParam":{"type":"object","required":["type","text"],"properties":{"type":{"type":"string","enum":["summary_text"],"description":"The content type. Always `summary_text`.","default":"summary_text"},"text":{"type":"string","maxLength":10485760,"description":"The reasoning summary text."}}},"ReasoningItemParam":{"type":"object","required":["type","summary"],"properties":{"id":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"The unique ID of this reasoning item.","example":"rs_123"},"type":{"type":"string","enum":["reasoning"],"description":"The item type. Always `reasoning`.","default":"reasoning"},"summary":{"type":"array","items":{"$ref":"#\/components\/schemas\/ReasoningSummaryContentParam"},"description":"Reasoning summary content associated with this item."},"content":{"type":"null"},"encrypted_content":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"An encrypted representation of the reasoning content."}}},"CompactionSummaryItemParam":{"type":"object","required":["type","encrypted_content"],"properties":{"id":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"The ID of the compaction item.","example":"cmp_123"},"type":{"type":"string","enum":["compaction"],"description":"The type of the item. Always `compaction`.","default":"compaction"},"encrypted_content":{"type":"string","maxLength":10485760,"description":"The encrypted content of the compaction summary."}},"description":"A compaction item generated by the [`v1\/responses\/compact`\nAPI](\/docs\/api-reference\/responses\/compact).","title":"Compaction item","x-openresponses-added-in":"2026-04-24"},"InputTextContentParam":{"type":"object","required":["type","text"],"properties":{"type":{"type":"string","enum":["input_text"],"description":"The type of the input item. Always `input_text`.","default":"input_text"},"text":{"type":"string","maxLength":10485760,"description":"The text input to the model."}},"description":"A text input to the model.","title":"Input text","x-unionTitle":"Content Type","x-unionDisplay":"section"},"InputImageContentParamAutoParam":{"type":"object","required":["type"],"properties":{"type":{"type":"string","enum":["input_image"],"description":"The type of the input item. Always `input_image`.","default":"input_image"},"image_url":{"anyOf":[{"type":"string","maxLength":20971520},{"type":"null"}],"description":"The URL of the image to be sent to the model. A fully qualified URL or base64\nencoded image in a data URL."},"detail":{"anyOf":[{"$ref":"#\/components\/schemas\/ImageDetail"},{"type":"null"}],"description":"The detail level of the image to be sent to the model. One of `high`, `low`, or\n`auto`. Defaults to `auto`."}},"description":"An image input to the model. Learn about [image inputs](\/docs\/guides\/vision)","title":"Input image"},"InputFileContentParam":{"type":"object","required":["type"],"properties":{"type":{"type":"string","enum":["input_file"],"description":"The type of the input item. Always `input_file`.","default":"input_file"},"filename":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"The name of the file to be sent to the model."},"file_data":{"anyOf":[{"type":"string","maxLength":33554432},{"type":"null"}],"description":"The base64-encoded data of the file to be sent to the model."},"file_url":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"The URL of the file to be sent to the model."}},"description":"A file input to the model.","title":"Input file"},"UserMessageItemParam":{"type":"object","required":["type","role","content"],"properties":{"id":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"The unique ID of this message item.","example":"msg_123"},"type":{"type":"string","enum":["message"],"description":"The item type. Always `message`.","default":"message"},"role":{"type":"string","enum":["user"],"description":"The message role. Always `user`.","default":"user"},"content":{"oneOf":[{"type":"array","items":{"oneOf":[{"$ref":"#\/components\/schemas\/InputTextContentParam"},{"$ref":"#\/components\/schemas\/InputImageContentParamAutoParam"},{"$ref":"#\/components\/schemas\/InputFileContentParam"}],"description":"A piece of message content, such as text, an image, or a file.","discriminator":{"propertyName":"type"}}},{"type":"string","maxLength":10485760}],"description":"The message content, as a string or an array of content parts."},"status":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"The status of the message item."}}},"SystemMessageItemParam":{"type":"object","required":["type","role","content"],"properties":{"id":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"The unique ID of this message item.","example":"msg_123"},"type":{"type":"string","enum":["message"],"description":"The item type. Always `message`.","default":"message"},"role":{"type":"string","enum":["system"],"description":"The message role. Always `system`.","default":"system"},"content":{"oneOf":[{"type":"array","items":{"$ref":"#\/components\/schemas\/InputTextContentParam","discriminator":{"propertyName":"type"}}},{"type":"string","maxLength":10485760}],"description":"The message content, as a string or an array of content parts."},"status":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"The status of the message item."}}},"DeveloperMessageItemParam":{"type":"object","required":["type","role","content"],"properties":{"id":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"The unique ID of this message item.","example":"msg_123"},"type":{"type":"string","enum":["message"],"description":"The item type. Always `message`.","default":"message"},"role":{"type":"string","enum":["developer"],"description":"The message role. Always `developer`.","default":"developer"},"content":{"oneOf":[{"type":"array","items":{"$ref":"#\/components\/schemas\/InputTextContentParam","discriminator":{"propertyName":"type"}}},{"type":"string","maxLength":10485760}],"description":"The message content, as a string or an array of content parts."},"status":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"The status of the message item."}}},"UrlCitationParam":{"type":"object","required":["type","start_index","end_index","url","title"],"properties":{"type":{"type":"string","enum":["url_citation"],"description":"The citation type. Always `url_citation`.","default":"url_citation"},"start_index":{"type":"integer","minimum":0,"description":"The index of the first character of the citation in the message."},"end_index":{"type":"integer","minimum":0,"description":"The index of the last character of the citation in the message."},"url":{"type":"string","description":"The URL of the cited resource."},"title":{"type":"string","description":"The title of the cited resource."}}},"OutputTextContentParam":{"type":"object","required":["type","text"],"properties":{"type":{"type":"string","enum":["output_text"],"description":"The content type. Always `output_text`.","default":"output_text"},"text":{"type":"string","maxLength":10485760,"description":"The text content."},"annotations":{"type":"array","items":{"$ref":"#\/components\/schemas\/UrlCitationParam"},"description":"Citations associated with the text content."}}},"RefusalContentParam":{"type":"object","required":["type","refusal"],"properties":{"type":{"type":"string","enum":["refusal"],"description":"The content type. Always `refusal`.","default":"refusal"},"refusal":{"type":"string","maxLength":10485760,"description":"The refusal text."}}},"AssistantMessageItemParam":{"type":"object","required":["type","role","content"],"properties":{"id":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"The unique ID of this message item.","example":"msg_123"},"type":{"type":"string","enum":["message"],"description":"The item type. Always `message`.","default":"message"},"role":{"type":"string","enum":["assistant"],"description":"The role of the message author. Always `assistant`.","default":"assistant"},"content":{"oneOf":[{"type":"array","items":{"oneOf":[{"$ref":"#\/components\/schemas\/OutputTextContentParam"},{"$ref":"#\/components\/schemas\/RefusalContentParam"}],"description":"A piece of assistant message content, such as text or a refusal.","discriminator":{"propertyName":"type"}}},{"type":"string","maxLength":10485760}],"description":"The message content, as a string or an array of content parts."},"phase":{"type":"string","enum":["commentary","final_answer"],"description":"Labels an `assistant` message as intermediate commentary (`commentary`) or the\nfinal answer (`final_answer`). For models like `gpt-5.3-codex` and beyond, when\nsending follow-up requests, preserve and resend phase on all assistant messages.\nOmitting it can degrade performance. Not used for user messages.","x-openresponses-added-in":"2026-04-24"},"status":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"The status of the message item."}}},"FunctionCallItemParam":{"type":"object","required":["call_id","type","name","arguments"],"properties":{"id":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"The unique ID of this function tool call.","example":"fc_123"},"call_id":{"type":"string","minLength":1,"maxLength":64,"description":"The unique ID of the function tool call generated by the model."},"type":{"type":"string","enum":["function_call"],"description":"The item type. Always `function_call`.","default":"function_call"},"name":{"type":"string","minLength":1,"maxLength":64,"pattern":"^[a-zA-Z0-9_-]+$","description":"The name of the function to call."},"arguments":{"type":"string","description":"The function arguments as a JSON string."},"status":{"anyOf":[{"$ref":"#\/components\/schemas\/FunctionCallStatus"},{"type":"null"}],"description":"The status of the function tool call."}}},"FunctionCallOutputItemParam":{"type":"object","required":["call_id","type","output"],"properties":{"id":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"The unique ID of the function tool call output. Populated when this item is\nreturned via API.","example":"fc_123"},"call_id":{"type":"string","minLength":1,"maxLength":64,"description":"The unique ID of the function tool call generated by the model."},"type":{"type":"string","enum":["function_call_output"],"description":"The type of the function tool call output. Always `function_call_output`.","default":"function_call_output"},"output":{"oneOf":[{"type":"string","maxLength":10485760},{"type":"array","items":{"oneOf":[{"$ref":"#\/components\/schemas\/InputTextContentParam"},{"$ref":"#\/components\/schemas\/InputImageContentParamAutoParam"},{"$ref":"#\/components\/schemas\/InputFileContentParam"},{"$ref":"#\/components\/schemas\/InputVideoContent"}],"description":"A piece of message content, such as text, an image, or a file.","discriminator":{"propertyName":"type"}}}],"description":"The function tool call output, as a JSON string or an array of text, image,\nor file content."},"status":{"anyOf":[{"$ref":"#\/components\/schemas\/FunctionCallStatus"},{"type":"null"}],"description":"The status of the item. One of `in_progress`, `completed`, or `incomplete`.\nPopulated when items are returned via API."}},"description":"The output of a function tool call.","title":"Function tool call output"},"ItemParam":{"oneOf":[{"$ref":"#\/components\/schemas\/ItemReferenceParam"},{"$ref":"#\/components\/schemas\/ReasoningItemParam"},{"$ref":"#\/components\/schemas\/CompactionSummaryItemParam"},{"$ref":"#\/components\/schemas\/UserMessageItemParam"},{"$ref":"#\/components\/schemas\/SystemMessageItemParam"},{"$ref":"#\/components\/schemas\/DeveloperMessageItemParam"},{"$ref":"#\/components\/schemas\/AssistantMessageItemParam"},{"$ref":"#\/components\/schemas\/FunctionCallItemParam"},{"$ref":"#\/components\/schemas\/FunctionCallOutputItemParam"}],"x-unionTitle":"Input Item Types","x-unionDisplay":"section","discriminator":{"propertyName":"type"}},"IncludeEnum":{"type":"string","enum":["reasoning.encrypted_content","message.output_text.logprobs"],"x-enumDescriptions":{"message.output_text.logprobs":"includes sampled logprobs in assistant messages.","reasoning.encrypted_content":"includes encrypted reasoning content so that it may be rehydrated on a subsequent request."}},"EmptyModelParam":{"type":"object"},"FunctionToolParam":{"type":"object","required":["name","type"],"properties":{"name":{"type":"string","minLength":1,"maxLength":64,"pattern":"^[a-zA-Z0-9_-]+$"},"description":{"anyOf":[{"type":"string"},{"type":"null"}]},"parameters":{"anyOf":[{"$ref":"#\/components\/schemas\/EmptyModelParam"},{"type":"null"}]},"strict":{"type":"boolean"},"type":{"type":"string","enum":["function"],"default":"function"}}},"ResponsesToolParam":{"$ref":"#\/components\/schemas\/FunctionToolParam","x-unionTitle":"Tool Types","x-unionDisplay":"section","discriminator":{"propertyName":"type"}},"SpecificFunctionParam":{"type":"object","required":["type","name"],"properties":{"type":{"type":"string","enum":["function"],"description":"The tool to call. Always `function`.","default":"function"},"name":{"type":"string","description":"The name of the function tool to call."}}},"SpecificToolChoiceParam":{"$ref":"#\/components\/schemas\/SpecificFunctionParam"},"AllowedToolsParam":{"type":"object","required":["type","tools"],"properties":{"type":{"type":"string","enum":["allowed_tools"],"description":"The tool choice type. Always `allowed_tools`.","default":"allowed_tools"},"tools":{"type":"array","items":{"$ref":"#\/components\/schemas\/SpecificToolChoiceParam"},"minItems":1,"maxItems":128,"description":"The list of tools that are permitted for this request."},"mode":{"$ref":"#\/components\/schemas\/ToolChoiceValueEnum","description":"How to select a tool from the allowed set."}}},"ToolChoiceParam":{"oneOf":[{"$ref":"#\/components\/schemas\/SpecificToolChoiceParam"},{"$ref":"#\/components\/schemas\/ToolChoiceValueEnum"},{"$ref":"#\/components\/schemas\/AllowedToolsParam"}],"description":"Controls which tool the model should use, if any."},"MetadataParam":{"type":"object","description":"Set of 16 key-value pairs that can be attached to an object. This can be useful for\nstoring additional information about the object in a structured format, and querying\nfor objects via API or the dashboard. Keys are strings with a maximum length of 64\ncharacters. Values are strings with a maximum length of 512 characters.","maxProperties":16,"additionalProperties":{"type":"string","maxLength":512}},"JsonSchemaResponseFormatParam":{"type":"object","properties":{"type":{"type":"string","enum":["json_schema"],"description":"The type of response format being defined. Always `json_schema`."},"description":{"type":"string","description":"A description of what the response format is for, used by the model to determine\nhow to respond in the format."},"name":{"type":"string","description":"The name of the response format. Must be a-z, A-Z, 0-9, or contain underscores and\ndashes, with a maximum length of 64."},"schema":{"type":"object","description":"The schema for the response format, described as a JSON Schema object.","title":"JSON schema","additionalProperties":{}},"strict":{"anyOf":[{"type":"boolean","default":false},{"type":"null"}],"description":"Whether to enable strict schema adherence when generating the output. If set to\ntrue, the model will always follow the exact schema defined in the `schema` field.\nOnly a subset of JSON Schema is supported when `strict` is `true`."}}},"TextFormatParam":{"oneOf":[{"$ref":"#\/components\/schemas\/TextResponseFormat"},{"$ref":"#\/components\/schemas\/JsonSchemaResponseFormatParam"}]},"TextParam":{"type":"object","properties":{"format":{"oneOf":[{"$ref":"#\/components\/schemas\/TextFormatParam"},{"type":"null"}],"description":"The format configuration for text output."},"verbosity":{"$ref":"#\/components\/schemas\/VerbosityEnum","description":"Controls the level of detail in generated text output."}}},"StreamOptionsParam":{"type":"object","properties":{"include_obfuscation":{"type":"boolean","description":"Whether to obfuscate sensitive information in streamed output. Defaults to `true`."}},"description":"Options that control streamed response behavior."},"ReasoningParam":{"type":"object","properties":{"effort":{"anyOf":[{"$ref":"#\/components\/schemas\/ReasoningEffortEnum"},{"type":"null"}],"description":"Controls the level of reasoning effort the model should apply. Higher effort may\nincrease latency and cost."},"summary":{"anyOf":[{"$ref":"#\/components\/schemas\/ReasoningSummaryEnum"},{"type":"null"}],"description":"Controls whether the response includes a reasoning summary."}},"description":"**gpt-5 and o-series models only** Configuration options for [reasoning\nmodels](https:\/\/platform.openai.com\/docs\/guides\/reasoning)."},"ServiceTierEnum":{"type":"string","enum":["auto","default","flex","priority"],"x-enumDescriptions":{"auto":"Choose a service tier automatically based on current account state.","default":"Choose the default service tier.","flex":"Choose the flex service tier.","priority":"Choose the priority service tier."}},"CreateResponseBody":{"type":"object","properties":{"model":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"The model to use for this request, e.g. 'gpt-5.2'."},"input":{"anyOf":[{"oneOf":[{"type":"string","maxLength":10485760},{"type":"array","items":{"$ref":"#\/components\/schemas\/ItemParam"}}]},{"type":"null"}],"description":"Context to provide to the model for the scope of this request. May either be a\nstring or an array of input items. If a string is provided, it is interpreted as a\nuser message."},"previous_response_id":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"The ID of the response to use as the prior turn for this request.","example":"resp_123"},"include":{"type":"array","items":{"$ref":"#\/components\/schemas\/IncludeEnum"}},"tools":{"anyOf":[{"type":"array","items":{"$ref":"#\/components\/schemas\/ResponsesToolParam"}},{"type":"null"}],"description":"A list of tools that the model may call while generating the response."},"tool_choice":{"anyOf":[{"$ref":"#\/components\/schemas\/ToolChoiceParam"},{"type":"null"}],"description":"Controls which tool the model should use, if any.","x-unionTitle":"ToolChoiceParam"},"metadata":{"anyOf":[{"$ref":"#\/components\/schemas\/MetadataParam"},{"type":"null"}],"description":"Set of 16 key-value pairs that can be attached to an object. This can be useful for\nstoring additional information about the object in a structured format, and\nquerying for objects via API or the dashboard. Keys are strings with a maximum\nlength of 64 characters. Values are strings with a maximum length of 512\ncharacters."},"text":{"anyOf":[{"$ref":"#\/components\/schemas\/TextParam"},{"type":"null"}],"description":"Configuration options for text output."},"temperature":{"anyOf":[{"type":"number"},{"type":"null"}],"description":"Sampling temperature to use, between 0 and 2. Higher values make the output more\nrandom."},"top_p":{"anyOf":[{"type":"number"},{"type":"null"}],"description":"Nucleus sampling parameter, between 0 and 1. The model considers only the tokens\nwith the top cumulative probability."},"presence_penalty":{"anyOf":[{"type":"number"},{"type":"null"}],"description":"Penalizes new tokens based on whether they appear in the text so far."},"frequency_penalty":{"anyOf":[{"type":"number"},{"type":"null"}],"description":"Penalizes new tokens based on their frequency in the text so far."},"parallel_tool_calls":{"anyOf":[{"type":"boolean"},{"type":"null"}],"description":"Whether the model may call multiple tools in parallel."},"stream":{"type":"boolean","description":"Whether to stream response events as server-sent events."},"stream_options":{"anyOf":[{"$ref":"#\/components\/schemas\/StreamOptionsParam"},{"type":"null"}],"description":"Options that control streamed response behavior."},"background":{"type":"boolean","description":"Whether to run the request in the background and return immediately."},"max_output_tokens":{"anyOf":[{"type":"integer","minimum":16},{"type":"null"}],"description":"The maximum number of tokens the model may generate for this response."},"max_tool_calls":{"anyOf":[{"type":"integer","minimum":1},{"type":"null"}],"description":"The maximum number of tool calls the model may make while generating the response."},"reasoning":{"anyOf":[{"$ref":"#\/components\/schemas\/ReasoningParam"},{"type":"null"}],"description":"Configuration options for reasoning behavior."},"safety_identifier":{"anyOf":[{"type":"string","maxLength":64},{"type":"null"}],"description":"A stable identifier used for safety monitoring and abuse detection."},"prompt_cache_key":{"anyOf":[{"type":"string","maxLength":64},{"type":"null"}],"description":"A key to use when reading from or writing to the prompt cache."},"truncation":{"$ref":"#\/components\/schemas\/TruncationEnum","description":"Controls how the service truncates the input when it exceeds the model context\nwindow."},"instructions":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Additional instructions to guide the model for this request."},"store":{"type":"boolean","description":"Whether to store the response so it can be retrieved later."},"service_tier":{"$ref":"#\/components\/schemas\/ServiceTierEnum","description":"The service tier to use for this request."},"top_logprobs":{"anyOf":[{"type":"integer","minimum":0,"maximum":20},{"type":"null"}],"description":"The number of most likely tokens to return at each position, along with their log\nprobabilities."}}},"CompactResource":{"type":"object","required":["id","object","output","created_at","usage"],"properties":{"id":{"type":"string","description":"The unique identifier for the compacted response."},"object":{"type":"string","enum":["response.compaction"],"description":"The object type. Always `response.compaction`.","default":"response.compaction"},"output":{"type":"array","items":{"$ref":"#\/components\/schemas\/ItemField"},"description":"The compacted list of output items."},"created_at":{"type":"integer","description":"Unix timestamp (in seconds) when the compacted conversation was created."},"usage":{"$ref":"#\/components\/schemas\/Usage","description":"Token accounting for the compaction pass, including cached, reasoning, and total\ntokens."}},"title":"The compacted response object","x-openresponses-added-in":"2026-04-24","example":{"id":"resp_001","object":"response.compaction","created_at":1764967971,"output":[{"id":"msg_000","type":"message","status":"completed","content":[{"type":"input_text","text":"Create a simple landing page for a dog petting cafe."}],"role":"user"},{"id":"cmp_001","type":"compaction","encrypted_content":"gAAAAABpM0Yj-...="}],"usage":{"input_tokens":139,"input_tokens_details":{"cached_tokens":0},"output_tokens":438,"output_tokens_details":{"reasoning_tokens":64},"total_tokens":577}}},"CompactResponseMethodPublicBody":{"type":"object","required":["model"],"properties":{"model":{"type":"string","description":"Model ID used to generate the response, like `gpt-5` or `o3`. OpenAI offers a wide\nrange of models with different capabilities, performance characteristics, and price\npoints. Refer to the [model guide](\/docs\/models) to browse and compare available\nmodels."},"input":{"anyOf":[{"oneOf":[{"type":"string","maxLength":10485760},{"type":"array","items":{"$ref":"#\/components\/schemas\/ItemParam"}}]},{"type":"null"}],"description":"Text, image, or file inputs to the model, used to generate a response.\nA string is treated as text input with the `user` role. An array can contain\none or more input items with different content types."},"previous_response_id":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"The unique ID of the previous response to the model. Use this to create multi-turn\nconversations. Learn more about [conversation\nstate](\/docs\/guides\/conversation-state). Cannot be used in conjunction with\n`conversation`.","example":"resp_123"},"instructions":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"A system (or developer) message inserted into the model's context. When used along\nwith `previous_response_id`, the instructions from a previous response will not be\ncarried over to the next response. This makes it simple to swap out system (or\ndeveloper) messages in new responses."},"prompt_cache_key":{"anyOf":[{"type":"string","maxLength":64},{"type":"null"}],"description":"A key to use when reading from or writing to the prompt cache."}},"x-openresponses-added-in":"2026-04-24"},"WebSocketResponseCreateEvent":{"allOf":[{"type":"object","properties":{"type":{"type":"string","enum":["response.create"],"description":"The client event type. Always `response.create`.","default":"response.create"},"stream":{"type":"string","description":"This HTTP streaming field MUST NOT be sent in WebSocket `response.create` messages.","maxLength":0,"minLength":1,"x-openresponses-disallowed":true},"stream_options":{"type":"string","description":"This HTTP streaming options field MUST NOT be sent in WebSocket `response.create`\nmessages.","maxLength":0,"minLength":1,"x-openresponses-disallowed":true},"background":{"type":"string","description":"This HTTP background-mode field MUST NOT be sent in WebSocket `response.create`\nmessages.","maxLength":0,"minLength":1,"x-openresponses-disallowed":true}},"required":["type"]},{"$ref":"#\/components\/schemas\/CreateResponseBody"}],"description":"A client-sent WebSocket event that starts a Responses turn. It uses the normal\nresponse-create body plus a required `type` field.","title":"WebSocket response create event","x-openresponses-added-in":"2026-04-24"},"WebSocketErrorEvent":{"type":"object","required":["type","status","error"],"properties":{"type":{"type":"string","enum":["error"],"description":"The event type. Always `error`.","default":"error"},"status":{"type":"integer","description":"The HTTP-style status code for the WebSocket error."},"error":{"type":"object","properties":{"type":{"type":"string","description":"The error type, when supplied."},"code":{"type":"string","description":"A machine-readable error code."},"message":{"type":"string","description":"A human-readable error message."},"param":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"The request parameter associated with the error, when supplied."}},"required":["code","message"],"description":"The WebSocket error payload.","additionalProperties":{}}},"description":"A WebSocket error envelope returned for Responses WebSocket mode failures.","title":"WebSocket error event","x-openresponses-added-in":"2026-04-24"},"DetailEnum":{"type":"string","enum":["low","high","auto"],"x-enumDescriptions":{"auto":"Choose the detail level automatically.","high":"Allows the model to \"see\" a higher-resolution version of the image, usually increasing input token costs.","low":"Restricts the model to a lower-resolution version of the image."}},"FunctionCallItemStatus":{"type":"string","enum":["in_progress","completed","incomplete"]}},"securitySchemes":{"ApiKeyAuth":{"type":"http","scheme":"bearer","in":"header"}}},"servers":[{"url":"https:\/\/api.openai.com\/v1","description":"","variables":{}}]}