# SPDX-License-Identifier: CC-BY-NC-SA-4.0 openapi: 3.1.0 info: title: The OpenAI Interface — API Commons profile summary: The interoperable surface of the OpenAI API, as adopters actually implement it. description: 'A **profile**, not a copy. The OpenAI API became a de facto standard by being implemented by other people; this describes the part of it that the industry actually built, with every operation graded `x-tier` core or extended by measured adoption. Vendor-tier operations are documented in `profile.yml` and deliberately excluded here. Derived from https://github.com/openai/openai-openapi at commit `38170fdddbb6a1813eae6c6587ee17cf2987185b` (MIT). Not published by, affiliated with, or endorsed by OpenAI. See https://github.com/api-commons/models for the profile and the adopter registry.' version: 2.3.0 contact: name: API Commons url: https://apicommons.org license: name: CC-BY-NC-SA-4.0 url: https://creativecommons.org/licenses/by-nc-sa/4.0/ externalDocs: description: The profile on API Commons url: https://apicommons.org/standards/models/ servers: - url: https://api.openai.com/v1 paths: /audio/speech: post: operationId: createSpeech tags: - Audio summary: Create speech description: 'Generates audio from the input text. Returns the audio file content, or a stream of audio events. ' requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/CreateSpeechRequest' responses: '200': description: OK headers: Transfer-Encoding: schema: type: string description: chunked content: application/octet-stream: schema: type: string format: binary text/event-stream: schema: $ref: '#/components/schemas/CreateSpeechResponseStreamEvent' '429': $ref: '#/components/responses/InferenceRateLimited' '503': $ref: '#/components/responses/InferenceServiceUnavailable' x-oaiMeta: group: audio examples: - title: Default request: curl: "curl https://api.openai.com/v1/audio/speech \\\n -H \"Authorization: Bearer $OPENAI_API_KEY\" \\\n -H \"Content-Type: application/json\" \\\n -d '{\n \"model\": \"gpt-4o-mini-tts\",\n \ \"input\": \"The quick brown fox jumped over the lazy dog.\",\n \"voice\": \"alloy\"\n \ }' \\\n --output speech.mp3\n" python: "from pathlib import Path\nimport openai\n\nspeech_file_path = Path(__file__).parent / \"speech.mp3\"\nwith openai.audio.speech.with_streaming_response.create(\n model=\"gpt-4o-mini-tts\",\n \ voice=\"alloy\",\n input=\"The quick brown fox jumped over the lazy dog.\"\n) as response:\n \ response.stream_to_file(speech_file_path)\n" javascript: "import fs from \"fs\";\nimport path from \"path\";\nimport OpenAI from \"openai\";\n\nconst openai = new OpenAI();\n\nconst speechFile = path.resolve(\"./speech.mp3\");\n\nasync function main() {\n const mp3 = await openai.audio.speech.create({\n model: \"gpt-4o-mini-tts\",\n \ voice: \"alloy\",\n input: \"Today is a wonderful day to build something people love!\",\n \ });\n console.log(speechFile);\n const buffer = Buffer.from(await mp3.arrayBuffer());\n \ await fs.promises.writeFile(speechFile, buffer);\n}\nmain();\n" csharp: "using System;\nusing System.IO;\n\nusing OpenAI.Audio;\n\nAudioClient client = new(\n \ model: \"gpt-4o-mini-tts\",\n apiKey: Environment.GetEnvironmentVariable(\"OPENAI_API_KEY\")\n);\n\nBinaryData speech = client.GenerateSpeech(\n text: \"The quick brown fox jumped over the lazy dog.\",\n \ voice: GeneratedSpeechVoice.Alloy\n);\n\nusing FileStream stream = File.OpenWrite(\"speech.mp3\");\nspeech.ToStream().CopyTo(stream);\n" - title: SSE Stream Format request: curl: "curl https://api.openai.com/v1/audio/speech \\\n -H \"Authorization: Bearer $OPENAI_API_KEY\" \\\n -H \"Content-Type: application/json\" \\\n -d '{\n \"model\": \"gpt-4o-mini-tts\",\n \ \"input\": \"The quick brown fox jumped over the lazy dog.\",\n \"voice\": \"alloy\",\n \ \"stream_format\": \"sse\"\n }'\n" x-tier: extended /audio/transcriptions: post: operationId: createTranscription tags: - Audio summary: Create transcription description: 'Transcribes audio into the input language. Returns a transcription object in `json`, `diarized_json`, or `verbose_json` format, or a stream of transcript events. ' requestBody: required: true content: multipart/form-data: schema: $ref: '#/components/schemas/CreateTranscriptionRequest' responses: '200': description: OK content: application/json: schema: oneOf: - $ref: '#/components/schemas/CreateTranscriptionResponseJson' - $ref: '#/components/schemas/CreateTranscriptionResponseDiarizedJson' - $ref: '#/components/schemas/CreateTranscriptionResponseVerboseJson' text/event-stream: schema: $ref: '#/components/schemas/CreateTranscriptionResponseStreamEvent' '429': $ref: '#/components/responses/InferenceRateLimited' '503': $ref: '#/components/responses/InferenceServiceUnavailable' x-oaiMeta: group: audio examples: - title: Default request: curl: "curl https://api.openai.com/v1/audio/transcriptions \\\n -H \"Authorization: Bearer $OPENAI_API_KEY\" \\\n -H \"Content-Type: multipart/form-data\" \\\n -F file=\"@/path/to/file/audio.mp3\" \\\n -F model=\"gpt-4o-transcribe\"\n" python: "from openai import OpenAI\nclient = OpenAI()\n\naudio_file = open(\"speech.mp3\", \"rb\")\ntranscript = client.audio.transcriptions.create(\n model=\"gpt-4o-transcribe\",\n \ file=audio_file\n)\n" javascript: "import fs from \"fs\";\nimport OpenAI from \"openai\";\n\nconst openai = new OpenAI();\n\nasync function main() {\n const transcription = await openai.audio.transcriptions.create({\n \ file: fs.createReadStream(\"audio.mp3\"),\n model: \"gpt-4o-transcribe\",\n });\n\n \ console.log(transcription.text);\n}\nmain();\n" csharp: "using System;\n\nusing OpenAI.Audio;\nstring audioFilePath = \"audio.mp3\";\n\nAudioClient client = new(\n model: \"gpt-4o-transcribe\",\n apiKey: Environment.GetEnvironmentVariable(\"OPENAI_API_KEY\")\n);\n\nAudioTranscription transcription = client.TranscribeAudio(audioFilePath);\n\nConsole.WriteLine($\"{transcription.Text}\");\n" response: "{\n \"text\": \"Imagine the wildest idea that you've ever had, and you're curious about how it might scale to something that's a 100, a 1,000 times bigger. This is a place where you can get to do that.\",\n \"usage\": {\n \"type\": \"tokens\",\n \"input_tokens\": 14,\n \"input_token_details\": {\n \"text_tokens\": 0,\n \"audio_tokens\": 14\n \ },\n \"output_tokens\": 45,\n \"total_tokens\": 59\n }\n}\n" - title: Diarization request: curl: "curl https://api.openai.com/v1/audio/transcriptions \\\n -H \"Authorization: Bearer $OPENAI_API_KEY\" \\\n -H \"Content-Type: multipart/form-data\" \\\n -F file=\"@/path/to/file/meeting.wav\" \\\n -F model=\"gpt-4o-transcribe-diarize\" \\\n -F response_format=\"diarized_json\" \\\n -F chunking_strategy=auto \\\n -F 'known_speaker_names[]=agent' \\\n -F 'known_speaker_references[]=data:audio/wav;base64,AAA...'\n" python: "import base64\nfrom openai import OpenAI\n\nclient = OpenAI()\n\ndef to_data_url(path: str) -> str:\n with open(path, \"rb\") as fh:\n return \"data:audio/wav;base64,\" + base64.b64encode(fh.read()).decode(\"utf-8\")\n\nwith open(\"meeting.wav\", \"rb\") as audio_file:\n \ transcript = client.audio.transcriptions.create(\n model=\"gpt-4o-transcribe-diarize\",\n \ file=audio_file,\n response_format=\"diarized_json\",\n chunking_strategy=\"auto\",\n \ extra_body={\n \"known_speaker_names\": [\"agent\"],\n \"known_speaker_references\": [to_data_url(\"agent.wav\")],\n },\n )\n\nprint(transcript.segments)\n" javascript: "import fs from \"fs\";\nimport OpenAI from \"openai\";\n\nconst openai = new OpenAI();\n\nconst speakerRef = fs.readFileSync(\"agent.wav\").toString(\"base64\");\n\nconst transcript = await openai.audio.transcriptions.create({\n file: fs.createReadStream(\"meeting.wav\"),\n \ model: \"gpt-4o-transcribe-diarize\",\n response_format: \"diarized_json\",\n chunking_strategy: \"auto\",\n extra_body: {\n known_speaker_names: [\"agent\"],\n known_speaker_references: [`data:audio/wav;base64,${speakerRef}`],\n },\n});\n\nconsole.log(transcript.segments);\n" response: "{\n \"task\": \"transcribe\",\n \"duration\": 27.4,\n \"text\": \"Agent: Thanks for calling OpenAI support.\\nA: Hi, I'm trying to enable diarization.\\nAgent: Happy to walk you through the steps.\",\n \"segments\": [\n {\n \"type\": \"transcript.text.segment\",\n \ \"id\": \"seg_001\",\n \"start\": 0.0,\n \"end\": 4.7,\n \"text\": \"Thanks for calling OpenAI support.\",\n \"speaker\": \"agent\"\n },\n {\n \"type\": \"transcript.text.segment\",\n \"id\": \"seg_002\",\n \"start\": 4.7,\n \"end\": 11.8,\n \"text\": \"Hi, I'm trying to enable diarization.\",\n \"speaker\": \"A\"\n \ },\n {\n \"type\": \"transcript.text.segment\",\n \"id\": \"seg_003\",\n \ \"start\": 12.1,\n \"end\": 18.5,\n \"text\": \"Happy to walk you through the steps.\",\n \"speaker\": \"agent\"\n }\n ],\n \"usage\": {\n \"type\": \"duration\",\n \ \"seconds\": 27\n }\n}\n" - title: Streaming request: curl: "curl https://api.openai.com/v1/audio/transcriptions \\\n -H \"Authorization: Bearer $OPENAI_API_KEY\" \\\n -H \"Content-Type: multipart/form-data\" \\\n -F file=\"@/path/to/file/audio.mp3\" \\\n -F model=\"gpt-4o-mini-transcribe\" \\\n -F stream=true\n" python: "from openai import OpenAI\nclient = OpenAI()\n\naudio_file = open(\"speech.mp3\", \"rb\")\nstream = client.audio.transcriptions.create(\n file=audio_file,\n model=\"gpt-4o-mini-transcribe\",\n \ stream=True\n)\n\nfor event in stream:\n print(event)\n" javascript: "import fs from \"fs\";\nimport OpenAI from \"openai\";\n\nconst openai = new OpenAI();\n\nconst stream = await openai.audio.transcriptions.create({\n file: fs.createReadStream(\"audio.mp3\"),\n \ model: \"gpt-4o-mini-transcribe\",\n stream: true,\n});\n\nfor await (const event of stream) {\n console.log(event);\n}\n" response: 'data: {"type":"transcript.text.delta","delta":"I","logprobs":[{"token":"I","logprob":-0.00007588794,"bytes":[73]}]} data: {"type":"transcript.text.delta","delta":" see","logprobs":[{"token":" see","logprob":-3.1281633e-7,"bytes":[32,115,101,101]}]} data: {"type":"transcript.text.delta","delta":" skies","logprobs":[{"token":" skies","logprob":-2.3392786e-6,"bytes":[32,115,107,105,101,115]}]} data: {"type":"transcript.text.delta","delta":" of","logprobs":[{"token":" of","logprob":-3.1281633e-7,"bytes":[32,111,102]}]} data: {"type":"transcript.text.delta","delta":" blue","logprobs":[{"token":" blue","logprob":-1.0280384e-6,"bytes":[32,98,108,117,101]}]} data: {"type":"transcript.text.delta","delta":" and","logprobs":[{"token":" and","logprob":-0.0005108566,"bytes":[32,97,110,100]}]} data: {"type":"transcript.text.delta","delta":" clouds","logprobs":[{"token":" clouds","logprob":-1.9361265e-7,"bytes":[32,99,108,111,117,100,115]}]} data: {"type":"transcript.text.delta","delta":" of","logprobs":[{"token":" of","logprob":-1.9361265e-7,"bytes":[32,111,102]}]} data: {"type":"transcript.text.delta","delta":" white","logprobs":[{"token":" white","logprob":-7.89631e-7,"bytes":[32,119,104,105,116,101]}]} data: {"type":"transcript.text.delta","delta":",","logprobs":[{"token":",","logprob":-0.0014890312,"bytes":[44]}]} data: {"type":"transcript.text.delta","delta":" the","logprobs":[{"token":" the","logprob":-0.0110956915,"bytes":[32,116,104,101]}]} data: {"type":"transcript.text.delta","delta":" bright","logprobs":[{"token":" bright","logprob":0.0,"bytes":[32,98,114,105,103,104,116]}]} data: {"type":"transcript.text.delta","delta":" blessed","logprobs":[{"token":" blessed","logprob":-0.000045848617,"bytes":[32,98,108,101,115,115,101,100]}]} data: {"type":"transcript.text.delta","delta":" days","logprobs":[{"token":" days","logprob":-0.000010802739,"bytes":[32,100,97,121,115]}]} data: {"type":"transcript.text.delta","delta":",","logprobs":[{"token":",","logprob":-0.00001700133,"bytes":[44]}]} data: {"type":"transcript.text.delta","delta":" the","logprobs":[{"token":" the","logprob":-0.0000118755715,"bytes":[32,116,104,101]}]} data: {"type":"transcript.text.delta","delta":" dark","logprobs":[{"token":" dark","logprob":-5.5122365e-7,"bytes":[32,100,97,114,107]}]} data: {"type":"transcript.text.delta","delta":" sacred","logprobs":[{"token":" sacred","logprob":-5.4385737e-6,"bytes":[32,115,97,99,114,101,100]}]} data: {"type":"transcript.text.delta","delta":" nights","logprobs":[{"token":" nights","logprob":-4.00813e-6,"bytes":[32,110,105,103,104,116,115]}]} data: {"type":"transcript.text.delta","delta":",","logprobs":[{"token":",","logprob":-0.0036910512,"bytes":[44]}]} data: {"type":"transcript.text.delta","delta":" and","logprobs":[{"token":" and","logprob":-0.0031903093,"bytes":[32,97,110,100]}]} data: {"type":"transcript.text.delta","delta":" I","logprobs":[{"token":" I","logprob":-1.504853e-6,"bytes":[32,73]}]} data: {"type":"transcript.text.delta","delta":" think","logprobs":[{"token":" think","logprob":-4.3202e-7,"bytes":[32,116,104,105,110,107]}]} data: {"type":"transcript.text.delta","delta":" to","logprobs":[{"token":" to","logprob":-1.9361265e-7,"bytes":[32,116,111]}]} data: {"type":"transcript.text.delta","delta":" myself","logprobs":[{"token":" myself","logprob":-1.7432603e-6,"bytes":[32,109,121,115,101,108,102]}]} data: {"type":"transcript.text.delta","delta":",","logprobs":[{"token":",","logprob":-0.29254505,"bytes":[44]}]} data: {"type":"transcript.text.delta","delta":" what","logprobs":[{"token":" what","logprob":-0.016815351,"bytes":[32,119,104,97,116]}]} data: {"type":"transcript.text.delta","delta":" a","logprobs":[{"token":" a","logprob":-3.1281633e-7,"bytes":[32,97]}]} data: {"type":"transcript.text.delta","delta":" wonderful","logprobs":[{"token":" wonderful","logprob":-2.1008714e-6,"bytes":[32,119,111,110,100,101,114,102,117,108]}]} data: {"type":"transcript.text.delta","delta":" world","logprobs":[{"token":" world","logprob":-8.180258e-6,"bytes":[32,119,111,114,108,100]}]} data: {"type":"transcript.text.delta","delta":".","logprobs":[{"token":".","logprob":-0.014231676,"bytes":[46]}]} data: {"type":"transcript.text.done","text":"I see skies of blue and clouds of white, the bright blessed days, the dark sacred nights, and I think to myself, what a wonderful world.","logprobs":[{"token":"I","logprob":-0.00007588794,"bytes":[73]},{"token":" see","logprob":-3.1281633e-7,"bytes":[32,115,101,101]},{"token":" skies","logprob":-2.3392786e-6,"bytes":[32,115,107,105,101,115]},{"token":" of","logprob":-3.1281633e-7,"bytes":[32,111,102]},{"token":" blue","logprob":-1.0280384e-6,"bytes":[32,98,108,117,101]},{"token":" and","logprob":-0.0005108566,"bytes":[32,97,110,100]},{"token":" clouds","logprob":-1.9361265e-7,"bytes":[32,99,108,111,117,100,115]},{"token":" of","logprob":-1.9361265e-7,"bytes":[32,111,102]},{"token":" white","logprob":-7.89631e-7,"bytes":[32,119,104,105,116,101]},{"token":",","logprob":-0.0014890312,"bytes":[44]},{"token":" the","logprob":-0.0110956915,"bytes":[32,116,104,101]},{"token":" bright","logprob":0.0,"bytes":[32,98,114,105,103,104,116]},{"token":" blessed","logprob":-0.000045848617,"bytes":[32,98,108,101,115,115,101,100]},{"token":" days","logprob":-0.000010802739,"bytes":[32,100,97,121,115]},{"token":",","logprob":-0.00001700133,"bytes":[44]},{"token":" the","logprob":-0.0000118755715,"bytes":[32,116,104,101]},{"token":" dark","logprob":-5.5122365e-7,"bytes":[32,100,97,114,107]},{"token":" sacred","logprob":-5.4385737e-6,"bytes":[32,115,97,99,114,101,100]},{"token":" nights","logprob":-4.00813e-6,"bytes":[32,110,105,103,104,116,115]},{"token":",","logprob":-0.0036910512,"bytes":[44]},{"token":" and","logprob":-0.0031903093,"bytes":[32,97,110,100]},{"token":" I","logprob":-1.504853e-6,"bytes":[32,73]},{"token":" think","logprob":-4.3202e-7,"bytes":[32,116,104,105,110,107]},{"token":" to","logprob":-1.9361265e-7,"bytes":[32,116,111]},{"token":" myself","logprob":-1.7432603e-6,"bytes":[32,109,121,115,101,108,102]},{"token":",","logprob":-0.29254505,"bytes":[44]},{"token":" what","logprob":-0.016815351,"bytes":[32,119,104,97,116]},{"token":" a","logprob":-3.1281633e-7,"bytes":[32,97]},{"token":" wonderful","logprob":-2.1008714e-6,"bytes":[32,119,111,110,100,101,114,102,117,108]},{"token":" world","logprob":-8.180258e-6,"bytes":[32,119,111,114,108,100]},{"token":".","logprob":-0.014231676,"bytes":[46]}],"usage":{"input_tokens":14,"input_token_details":{"text_tokens":0,"audio_tokens":14},"output_tokens":45,"total_tokens":59}} ' - title: Logprobs request: curl: "curl https://api.openai.com/v1/audio/transcriptions \\\n -H \"Authorization: Bearer $OPENAI_API_KEY\" \\\n -H \"Content-Type: multipart/form-data\" \\\n -F file=\"@/path/to/file/audio.mp3\" \\\n -F \"include[]=logprobs\" \\\n -F model=\"gpt-4o-transcribe\" \\\n -F response_format=\"json\"\n" python: "from openai import OpenAI\nclient = OpenAI()\n\naudio_file = open(\"speech.mp3\", \"rb\")\ntranscript = client.audio.transcriptions.create(\n file=audio_file,\n model=\"gpt-4o-transcribe\",\n \ response_format=\"json\",\n include=[\"logprobs\"]\n)\n\nprint(transcript)\n" javascript: "import fs from \"fs\";\nimport OpenAI from \"openai\";\n\nconst openai = new OpenAI();\n\nasync function main() {\n const transcription = await openai.audio.transcriptions.create({\n \ file: fs.createReadStream(\"audio.mp3\"),\n model: \"gpt-4o-transcribe\",\n response_format: \"json\",\n include: [\"logprobs\"]\n });\n\n console.log(transcription);\n}\nmain();\n" response: "{\n \"text\": \"Hey, my knee is hurting and I want to see the doctor tomorrow ideally.\",\n \ \"logprobs\": [\n { \"token\": \"Hey\", \"logprob\": -1.0415299, \"bytes\": [72, 101, 121] },\n { \"token\": \",\", \"logprob\": -9.805982e-5, \"bytes\": [44] },\n { \"token\": \" my\", \"logprob\": -0.00229799, \"bytes\": [32, 109, 121] },\n {\n \"token\": \" knee\",\n \"logprob\": -4.7159858e-5,\n \"bytes\": [32, 107, 110, 101, 101]\n },\n \ { \"token\": \" is\", \"logprob\": -0.043909557, \"bytes\": [32, 105, 115] },\n {\n \ \"token\": \" hurting\",\n \"logprob\": -1.1041146e-5,\n \"bytes\": [32, 104, 117, 114, 116, 105, 110, 103]\n },\n { \"token\": \" and\", \"logprob\": -0.011076359, \"bytes\": [32, 97, 110, 100] },\n { \"token\": \" I\", \"logprob\": -5.3193703e-6, \"bytes\": [32, 73] },\n {\n \"token\": \" want\",\n \"logprob\": -0.0017156356,\n \"bytes\": [32, 119, 97, 110, 116]\n },\n { \"token\": \" to\", \"logprob\": -7.89631e-7, \"bytes\": [32, 116, 111] },\n { \"token\": \" see\", \"logprob\": -5.5122365e-7, \"bytes\": [32, 115, 101, 101] },\n { \"token\": \" the\", \"logprob\": -0.0040786397, \"bytes\": [32, 116, 104, 101] },\n {\n \"token\": \" doctor\",\n \"logprob\": -2.3392786e-6,\n \ \"bytes\": [32, 100, 111, 99, 116, 111, 114]\n },\n {\n \"token\": \" tomorrow\",\n \ \"logprob\": -7.89631e-7,\n \"bytes\": [32, 116, 111, 109, 111, 114, 114, 111, 119]\n },\n {\n \"token\": \" ideally\",\n \"logprob\": -0.5800861,\n \"bytes\": [32, 105, 100, 101, 97, 108, 108, 121]\n },\n { \"token\": \".\", \"logprob\": -0.00011093382, \"bytes\": [46] }\n ],\n \"usage\": {\n \"type\": \"tokens\",\n \"input_tokens\": 14,\n \"input_token_details\": {\n \"text_tokens\": 0,\n \"audio_tokens\": 14\n \ },\n \"output_tokens\": 45,\n \"total_tokens\": 59\n }\n}\n" - title: Word timestamps request: curl: "curl https://api.openai.com/v1/audio/transcriptions \\\n -H \"Authorization: Bearer $OPENAI_API_KEY\" \\\n -H \"Content-Type: multipart/form-data\" \\\n -F file=\"@/path/to/file/audio.mp3\" \\\n -F \"timestamp_granularities[]=word\" \\\n -F model=\"whisper-1\" \\\n -F response_format=\"verbose_json\"\n" python: "from openai import OpenAI\nclient = OpenAI()\n\naudio_file = open(\"speech.mp3\", \"rb\")\ntranscript = client.audio.transcriptions.create(\n file=audio_file,\n model=\"whisper-1\",\n \ response_format=\"verbose_json\",\n timestamp_granularities=[\"word\"]\n)\n\nprint(transcript.words)\n" javascript: "import fs from \"fs\";\nimport OpenAI from \"openai\";\n\nconst openai = new OpenAI();\n\nasync function main() {\n const transcription = await openai.audio.transcriptions.create({\n \ file: fs.createReadStream(\"audio.mp3\"),\n model: \"whisper-1\",\n response_format: \"verbose_json\",\n timestamp_granularities: [\"word\"]\n });\n\n console.log(transcription.text);\n}\nmain();\n" csharp: "using System;\n\nusing OpenAI.Audio;\n\nstring audioFilePath = \"audio.mp3\";\n\nAudioClient client = new(\n model: \"whisper-1\",\n apiKey: Environment.GetEnvironmentVariable(\"OPENAI_API_KEY\")\n);\n\nAudioTranscriptionOptions options = new()\n{\n ResponseFormat = AudioTranscriptionFormat.Verbose,\n TimestampGranularities = AudioTimestampGranularities.Word,\n};\n\nAudioTranscription transcription = client.TranscribeAudio(audioFilePath, options);\n\nConsole.WriteLine($\"{transcription.Text}\");\n" response: "{\n \"task\": \"transcribe\",\n \"language\": \"english\",\n \"duration\": 8.470000267028809,\n \ \"text\": \"The beach was a popular spot on a hot summer day. People were swimming in the ocean, building sandcastles, and playing beach volleyball.\",\n \"words\": [\n {\n \"word\": \"The\",\n \"start\": 0.0,\n \"end\": 0.23999999463558197\n },\n ...\n {\n \ \"word\": \"volleyball\",\n \"start\": 7.400000095367432,\n \"end\": 7.900000095367432\n \ }\n ],\n \"usage\": {\n \"type\": \"duration\",\n \"seconds\": 9\n }\n}\n" - title: Segment timestamps request: curl: "curl https://api.openai.com/v1/audio/transcriptions \\\n -H \"Authorization: Bearer $OPENAI_API_KEY\" \\\n -H \"Content-Type: multipart/form-data\" \\\n -F file=\"@/path/to/file/audio.mp3\" \\\n -F \"timestamp_granularities[]=segment\" \\\n -F model=\"whisper-1\" \\\n -F response_format=\"verbose_json\"\n" python: "from openai import OpenAI\nclient = OpenAI()\n\naudio_file = open(\"speech.mp3\", \"rb\")\ntranscript = client.audio.transcriptions.create(\n file=audio_file,\n model=\"whisper-1\",\n \ response_format=\"verbose_json\",\n timestamp_granularities=[\"segment\"]\n)\n\nprint(transcript.words)\n" javascript: "import fs from \"fs\";\nimport OpenAI from \"openai\";\n\nconst openai = new OpenAI();\n\nasync function main() {\n const transcription = await openai.audio.transcriptions.create({\n \ file: fs.createReadStream(\"audio.mp3\"),\n model: \"whisper-1\",\n response_format: \"verbose_json\",\n timestamp_granularities: [\"segment\"]\n });\n\n console.log(transcription.text);\n}\nmain();\n" csharp: "using System;\n\nusing OpenAI.Audio;\n\nstring audioFilePath = \"audio.mp3\";\n\nAudioClient client = new(\n model: \"whisper-1\",\n apiKey: Environment.GetEnvironmentVariable(\"OPENAI_API_KEY\")\n);\n\nAudioTranscriptionOptions options = new()\n{\n ResponseFormat = AudioTranscriptionFormat.Verbose,\n TimestampGranularities = AudioTimestampGranularities.Segment,\n};\n\nAudioTranscription transcription = client.TranscribeAudio(audioFilePath, options);\n\nConsole.WriteLine($\"{transcription.Text}\");\n" response: "{\n \"task\": \"transcribe\",\n \"language\": \"english\",\n \"duration\": 8.470000267028809,\n \ \"text\": \"The beach was a popular spot on a hot summer day. People were swimming in the ocean, building sandcastles, and playing beach volleyball.\",\n \"segments\": [\n {\n \ \"id\": 0,\n \"seek\": 0,\n \"start\": 0.0,\n \"end\": 3.319999933242798,\n \ \"text\": \" The beach was a popular spot on a hot summer day.\",\n \"tokens\": [\n 50364, 440, 7534, 390, 257, 3743, 4008, 322, 257, 2368, 4266, 786, 13, 50530\n \ ],\n \"temperature\": 0.0,\n \"avg_logprob\": -0.2860786020755768,\n \"compression_ratio\": 1.2363636493682861,\n \"no_speech_prob\": 0.00985979475080967\n },\n ...\n ],\n \ \"usage\": {\n \"type\": \"duration\",\n \"seconds\": 9\n }\n}\n" x-tier: extended /audio/translations: post: operationId: createTranslation tags: - Audio summary: Create translation description: Translates audio into English. requestBody: required: true content: multipart/form-data: schema: $ref: '#/components/schemas/CreateTranslationRequest' responses: '200': description: OK content: application/json: schema: oneOf: - $ref: '#/components/schemas/CreateTranslationResponseJson' - $ref: '#/components/schemas/CreateTranslationResponseVerboseJson' '429': $ref: '#/components/responses/InferenceRateLimited' '503': $ref: '#/components/responses/InferenceServiceUnavailable' x-oaiMeta: group: audio examples: request: curl: "curl https://api.openai.com/v1/audio/translations \\\n -H \"Authorization: Bearer $OPENAI_API_KEY\" \\\n -H \"Content-Type: multipart/form-data\" \\\n -F file=\"@/path/to/file/german.m4a\" \\\n -F model=\"whisper-1\"\n" python: "from openai import OpenAI\nclient = OpenAI()\n\naudio_file = open(\"speech.mp3\", \"rb\")\ntranscript = client.audio.translations.create(\n model=\"whisper-1\",\n file=audio_file\n)\n" javascript: "import fs from \"fs\";\nimport OpenAI from \"openai\";\n\nconst openai = new OpenAI();\n\nasync function main() {\n const translation = await openai.audio.translations.create({\n \ file: fs.createReadStream(\"speech.mp3\"),\n model: \"whisper-1\",\n });\n\n \ console.log(translation.text);\n}\nmain();\n" csharp: "using System;\n\nusing OpenAI.Audio;\n\nstring audioFilePath = \"audio.mp3\";\n\nAudioClient client = new(\n model: \"whisper-1\",\n apiKey: Environment.GetEnvironmentVariable(\"OPENAI_API_KEY\")\n);\n\nAudioTranscription transcription = client.TranscribeAudio(audioFilePath);\n\nConsole.WriteLine($\"{transcription.Text}\");\n" response: "{\n \"text\": \"Hello, my name is Wolfgang and I come from Germany. Where are you heading today?\"\n}\n" x-tier: extended /batches: post: summary: Create batch description: Creates and executes a batch from an uploaded file of requests operationId: createBatch tags: - Batch requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/CreateBatchRequest' responses: '200': description: Batch created successfully. content: application/json: schema: $ref: '#/components/schemas/Batch' x-oaiMeta: group: batch examples: request: curl: "curl https://api.openai.com/v1/batches \\\n -H \"Authorization: Bearer $OPENAI_API_KEY\" \\\n -H \"Content-Type: application/json\" \\\n -d '{\n \"input_file_id\": \"file-abc123\",\n \ \"endpoint\": \"/v1/chat/completions\",\n \"completion_window\": \"24h\"\n }'\n" python: "from openai import OpenAI\nclient = OpenAI()\n\nclient.batches.create(\n input_file_id=\"file-abc123\",\n \ endpoint=\"/v1/chat/completions\",\n completion_window=\"24h\"\n)\n" javascript: "import OpenAI from \"openai\";\n\nconst openai = new OpenAI();\n\nasync function main() {\n const batch = await openai.batches.create({\n input_file_id: \"file-abc123\",\n \ endpoint: \"/v1/chat/completions\",\n completion_window: \"24h\"\n });\n\n console.log(batch);\n}\n\nmain();\n" response: "{\n \"id\": \"batch_abc123\",\n \"object\": \"batch\",\n \"endpoint\": \"/v1/chat/completions\",\n \ \"errors\": null,\n \"input_file_id\": \"file-abc123\",\n \"completion_window\": \"24h\",\n \ \"status\": \"validating\",\n \"output_file_id\": null,\n \"error_file_id\": null,\n \"created_at\": 1711471533,\n \"in_progress_at\": null,\n \"expires_at\": null,\n \"finalizing_at\": null,\n \ \"completed_at\": null,\n \"failed_at\": null,\n \"expired_at\": null,\n \"cancelling_at\": null,\n \"cancelled_at\": null,\n \"request_counts\": {\n \"total\": 0,\n \"completed\": 0,\n \"failed\": 0\n },\n \"metadata\": {\n \"customer_id\": \"user_123456789\",\n \ \"batch_description\": \"Nightly eval job\",\n }\n}\n" x-tier: extended get: operationId: listBatches tags: - Batch summary: List batches description: List your organization's batches. parameters: - in: query name: after required: false schema: type: string description: 'A cursor for use in pagination. `after` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with obj_foo, your subsequent call can include after=obj_foo in order to fetch the next page of the list. ' - name: limit in: query description: 'A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 20. ' required: false schema: type: integer default: 20 responses: '200': description: Batch listed successfully. content: application/json: schema: $ref: '#/components/schemas/ListBatchesResponse' x-oaiMeta: group: batch examples: request: curl: "curl https://api.openai.com/v1/batches?limit=2 \\\n -H \"Authorization: Bearer $OPENAI_API_KEY\" \\\n -H \"Content-Type: application/json\"\n" python: 'from openai import OpenAI client = OpenAI() client.batches.list() ' javascript: "import OpenAI from \"openai\";\n\nconst openai = new OpenAI();\n\nasync function main() {\n const list = await openai.batches.list();\n\n for await (const batch of list) {\n console.log(batch);\n }\n}\n\nmain();\n" response: "{\n \"object\": \"list\",\n \"data\": [\n {\n \"id\": \"batch_abc123\",\n \ \"object\": \"batch\",\n \"endpoint\": \"/v1/chat/completions\",\n \"errors\": null,\n \"input_file_id\": \"file-abc123\",\n \"completion_window\": \"24h\",\n \ \"status\": \"completed\",\n \"output_file_id\": \"file-cvaTdG\",\n \"error_file_id\": \"file-HOWS94\",\n \"created_at\": 1711471533,\n \"in_progress_at\": 1711471538,\n \ \"expires_at\": 1711557933,\n \"finalizing_at\": 1711493133,\n \"completed_at\": 1711493163,\n \"failed_at\": null,\n \"expired_at\": null,\n \"cancelling_at\": null,\n \"cancelled_at\": null,\n \"request_counts\": {\n \"total\": 100,\n \ \"completed\": 95,\n \"failed\": 5\n },\n \"metadata\": {\n \"customer_id\": \"user_123456789\",\n \"batch_description\": \"Nightly job\",\n }\n },\n { ... },\n ],\n \"first_id\": \"batch_abc123\",\n \"last_id\": \"batch_abc456\",\n \"has_more\": true\n}\n" x-tier: extended /batches/{batch_id}: get: operationId: retrieveBatch tags: - Batch summary: Retrieve batch description: Retrieves a batch. parameters: - in: path name: batch_id required: true schema: type: string description: The ID of the batch to retrieve. responses: '200': description: Batch retrieved successfully. content: application/json: schema: $ref: '#/components/schemas/Batch' x-oaiMeta: group: batch examples: request: curl: "curl https://api.openai.com/v1/batches/batch_abc123 \\\n -H \"Authorization: Bearer $OPENAI_API_KEY\" \\\n -H \"Content-Type: application/json\" \\\n" python: 'from openai import OpenAI client = OpenAI() client.batches.retrieve("batch_abc123") ' javascript: "import OpenAI from \"openai\";\n\nconst openai = new OpenAI();\n\nasync function main() {\n const batch = await openai.batches.retrieve(\"batch_abc123\");\n\n console.log(batch);\n}\n\nmain();\n" response: "{\n \"id\": \"batch_abc123\",\n \"object\": \"batch\",\n \"endpoint\": \"/v1/completions\",\n \ \"errors\": null,\n \"input_file_id\": \"file-abc123\",\n \"completion_window\": \"24h\",\n \ \"status\": \"completed\",\n \"output_file_id\": \"file-cvaTdG\",\n \"error_file_id\": \"file-HOWS94\",\n \"created_at\": 1711471533,\n \"in_progress_at\": 1711471538,\n \"expires_at\": 1711557933,\n \"finalizing_at\": 1711493133,\n \"completed_at\": 1711493163,\n \"failed_at\": null,\n \"expired_at\": null,\n \"cancelling_at\": null,\n \"cancelled_at\": null,\n \"request_counts\": {\n \"total\": 100,\n \"completed\": 95,\n \"failed\": 5\n },\n \"metadata\": {\n \ \"customer_id\": \"user_123456789\",\n \"batch_description\": \"Nightly eval job\",\n \ }\n}\n" x-tier: extended /batches/{batch_id}/cancel: post: operationId: cancelBatch tags: - Batch summary: Cancel batch description: Cancels an in-progress batch. The batch will be in status `cancelling` for up to 10 minutes, before changing to `cancelled`, where it will have partial results (if any) available in the output file. parameters: - in: path name: batch_id required: true schema: type: string description: The ID of the batch to cancel. responses: '200': description: Batch is cancelling. Returns the cancelling batch's details. content: application/json: schema: $ref: '#/components/schemas/Batch' x-oaiMeta: group: batch examples: request: curl: "curl https://api.openai.com/v1/batches/batch_abc123/cancel \\\n -H \"Authorization: Bearer $OPENAI_API_KEY\" \\\n -H \"Content-Type: application/json\" \\\n -X POST\n" python: 'from openai import OpenAI client = OpenAI() client.batches.cancel("batch_abc123") ' javascript: "import OpenAI from \"openai\";\n\nconst openai = new OpenAI();\n\nasync function main() {\n const batch = await openai.batches.cancel(\"batch_abc123\");\n\n console.log(batch);\n}\n\nmain();\n" response: "{\n \"id\": \"batch_abc123\",\n \"object\": \"batch\",\n \"endpoint\": \"/v1/chat/completions\",\n \ \"errors\": null,\n \"input_file_id\": \"file-abc123\",\n \"completion_window\": \"24h\",\n \ \"status\": \"cancelling\",\n \"output_file_id\": null,\n \"error_file_id\": null,\n \"created_at\": 1711471533,\n \"in_progress_at\": 1711471538,\n \"expires_at\": 1711557933,\n \"finalizing_at\": null,\n \"completed_at\": null,\n \"failed_at\": null,\n \"expired_at\": null,\n \"cancelling_at\": 1711475133,\n \"cancelled_at\": null,\n \"request_counts\": {\n \"total\": 100,\n \"completed\": 23,\n \"failed\": 1\n },\n \"metadata\": {\n \"customer_id\": \"user_123456789\",\n \ \"batch_description\": \"Nightly eval job\",\n }\n}\n" x-tier: extended /chat/completions: get: operationId: listChatCompletions tags: - Chat summary: List Chat Completions description: 'List stored Chat Completions. Only Chat Completions that have been stored with the `store` parameter set to `true` will be returned. ' parameters: - name: model in: query description: The model used to generate the Chat Completions. required: false schema: type: string - name: metadata in: query description: 'A list of metadata keys to filter the Chat Completions by. Example: `metadata[key1]=value1&metadata[key2]=value2` ' required: false schema: $ref: '#/components/schemas/Metadata' - name: after in: query description: Identifier for the last chat completion from the previous pagination request. required: false schema: type: string - name: limit in: query description: Number of Chat Completions to retrieve. required: false schema: type: integer default: 20 - name: order in: query description: Sort order for Chat Completions by timestamp. Use `asc` for ascending order or `desc` for descending order. Defaults to `asc`. required: false schema: type: string enum: - asc - desc default: asc responses: '200': description: A list of Chat Completions content: application/json: schema: $ref: '#/components/schemas/ChatCompletionList' x-oaiMeta: group: chat path: list examples: request: curl: "curl https://api.openai.com/v1/chat/completions \\\n -H \"Authorization: Bearer $OPENAI_API_KEY\" \\\n -H \"Content-Type: application/json\"\n" python: 'from openai import OpenAI client = OpenAI() completions = client.chat.completions.list() print(completions) ' response: "{\n \"object\": \"list\",\n \"data\": [\n {\n \"object\": \"chat.completion\",\n \ \"id\": \"chatcmpl-AyPNinnUqUDYo9SAdA52NobMflmj2\",\n \"model\": \"gpt-6-astra\",\n \ \"created\": 1738960610,\n \"request_id\": \"req_ded8ab984ec4bf840f37566c1011c417\",\n \ \"tool_choice\": null,\n \"usage\": {\n \"total_tokens\": 31,\n \"completion_tokens\": 18,\n \"prompt_tokens\": 13\n },\n \"seed\": 4944116822809979520,\n \"top_p\": 1.0,\n \"temperature\": 1.0,\n \"presence_penalty\": 0.0,\n \"frequency_penalty\": 0.0,\n \"system_fingerprint\": \"fp_50cad350e4\",\n \"input_user\": null,\n \"service_tier\": \"default\",\n \"tools\": null,\n \"metadata\": {},\n \"choices\": [\n {\n \ \"index\": 0,\n \"message\": {\n \"content\": \"Mind of circuits hum, \\nLearning patterns in silence— \\nFuture's quiet spark.\",\n \"role\": \"assistant\",\n \"tool_calls\": null,\n \"function_call\": null\n },\n \ \"finish_reason\": \"stop\",\n \"logprobs\": null\n }\n ],\n \ \"response_format\": null\n }\n ],\n \"first_id\": \"chatcmpl-AyPNinnUqUDYo9SAdA52NobMflmj2\",\n \ \"last_id\": \"chatcmpl-AyPNinnUqUDYo9SAdA52NobMflmj2\",\n \"has_more\": false\n}\n" x-tier: vendor post: operationId: createChatCompletion tags: - Chat summary: Create chat completion description: '**Starting a new project?** We recommend trying [Responses](https://developers.openai.com/api/reference/resources/responses) to take advantage of the latest OpenAI platform features. Compare [Chat Completions with Responses](https://developers.openai.com/api/docs/guides/migrate-to-responses?api-mode=responses). --- Creates a model response for the given chat conversation. Learn more in the [text generation](https://developers.openai.com/api/docs/guides/text), [vision](https://developers.openai.com/api/docs/guides/images-vision), and [audio](https://developers.openai.com/api/docs/guides/audio) guides. Parameter support can differ depending on the model used to generate the response, particularly for newer reasoning models. Parameters that are only supported for reasoning models are noted below. For the current state of unsupported parameters in reasoning models, [refer to the reasoning guide](https://developers.openai.com/api/docs/guides/reasoning). Returns a chat completion object, or a streamed sequence of chat completion chunk objects if the request is streamed. ' requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/CreateChatCompletionRequest' responses: '200': description: OK content: application/json: schema: $ref: '#/components/schemas/CreateChatCompletionResponse' text/event-stream: schema: $ref: '#/components/schemas/CreateChatCompletionStreamResponse' '429': $ref: '#/components/responses/InferenceRateLimited' '503': $ref: '#/components/responses/InferenceServiceUnavailable' x-oaiMeta: group: chat path: create examples: - title: Default request: curl: "curl https://api.openai.com/v1/chat/completions \\\n -H \"Content-Type: application/json\" \\\n -H \"Authorization: Bearer $OPENAI_API_KEY\" \\\n -d '{\n \"model\": \"gpt-6-astra\",\n \ \"messages\": [\n {\n \"role\": \"developer\",\n \"content\": \"You are a helpful assistant.\"\n },\n {\n \"role\": \"user\",\n \"content\": \"Hello!\"\n }\n ]\n }'\n" python: "from openai import OpenAI\nclient = OpenAI()\n\ncompletion = client.chat.completions.create(\n \ model=\"gpt-6-astra\",\n messages=[\n {\"role\": \"developer\", \"content\": \"You are a helpful assistant.\"},\n {\"role\": \"user\", \"content\": \"Hello!\"}\n ]\n)\n\nprint(completion.choices[0].message)\n" javascript: "import OpenAI from \"openai\";\n\nconst openai = new OpenAI();\n\nasync function main() {\n const completion = await openai.chat.completions.create({\n messages: [{ role: \"developer\", content: \"You are a helpful assistant.\" }],\n model: \"gpt-6-astra\",\n \ store: true,\n });\n\n console.log(completion.choices[0]);\n}\n\nmain();\n" csharp: "using System;\nusing System.Collections.Generic;\n\nusing OpenAI.Chat;\n\nChatClient client = new(\n model: \"gpt-6-astra\",\n apiKey: Environment.GetEnvironmentVariable(\"OPENAI_API_KEY\")\n);\n\nList messages =\n[\n new SystemChatMessage(\"You are a helpful assistant.\"),\n new UserChatMessage(\"Hello!\")\n];\n\nChatCompletion completion = client.CompleteChat(messages);\n\nConsole.WriteLine(completion.Content[0].Text);\n" response: "{\n \"id\": \"chatcmpl-B9MBs8CjcvOU2jLn4n570S5qMJKcT\",\n \"object\": \"chat.completion\",\n \ \"created\": 1741569952,\n \"model\": \"gpt-6-astra\",\n \"choices\": [\n {\n \"index\": 0,\n \"message\": {\n \"role\": \"assistant\",\n \"content\": \"Hello! How can I assist you today?\",\n \"refusal\": null,\n \"annotations\": []\n \ },\n \"logprobs\": null,\n \"finish_reason\": \"stop\"\n }\n ],\n \"usage\": {\n \"prompt_tokens\": 19,\n \"completion_tokens\": 10,\n \"total_tokens\": 29,\n \ \"prompt_tokens_details\": {\n \"cached_tokens\": 0,\n \"audio_tokens\": 0\n \ },\n \"completion_tokens_details\": {\n \"reasoning_tokens\": 0,\n \"audio_tokens\": 0,\n \"accepted_prediction_tokens\": 0,\n \"rejected_prediction_tokens\": 0\n }\n \ },\n \"service_tier\": \"default\"\n}\n" - title: Image input request: curl: "curl https://api.openai.com/v1/chat/completions \\\n -H \"Content-Type: application/json\" \\\n -H \"Authorization: Bearer $OPENAI_API_KEY\" \\\n -d '{\n \"model\": \"gpt-6-astra\",\n \ \"messages\": [\n {\n \"role\": \"user\",\n \"content\": [\n {\n \ \"type\": \"text\",\n \"text\": \"What is in this image?\"\n },\n \ {\n \"type\": \"image_url\",\n \"image_url\": {\n \"url\": \"https://upload.wikimedia.org/wikipedia/commons/thumb/d/dd/Gfp-wisconsin-madison-the-nature-boardwalk.jpg/2560px-Gfp-wisconsin-madison-the-nature-boardwalk.jpg\"\n \ }\n }\n ]\n }\n ],\n \"max_tokens\": 300\n }'\n" python: "from openai import OpenAI\n\nclient = OpenAI()\n\nresponse = client.chat.completions.create(\n \ model=\"gpt-6-astra\",\n messages=[\n {\n \"role\": \"user\",\n \ \"content\": [\n {\"type\": \"text\", \"text\": \"What's in this image?\"},\n {\n \"type\": \"image_url\",\n \"image_url\": {\n \"url\": \"https://upload.wikimedia.org/wikipedia/commons/thumb/d/dd/Gfp-wisconsin-madison-the-nature-boardwalk.jpg/2560px-Gfp-wisconsin-madison-the-nature-boardwalk.jpg\",\n \ }\n },\n ],\n }\n ],\n max_tokens=300,\n)\n\nprint(response.choices[0])\n" javascript: "import OpenAI from \"openai\";\n\nconst openai = new OpenAI();\n\nasync function main() {\n const response = await openai.chat.completions.create({\n model: \"gpt-6-astra\",\n \ messages: [\n {\n role: \"user\",\n content: [\n { type: \"text\", text: \"What's in this image?\" },\n {\n type: \"image_url\",\n \ image_url: {\n \"url\": \"https://upload.wikimedia.org/wikipedia/commons/thumb/d/dd/Gfp-wisconsin-madison-the-nature-boardwalk.jpg/2560px-Gfp-wisconsin-madison-the-nature-boardwalk.jpg\",\n \ },\n }\n ],\n },\n ],\n });\n console.log(response.choices[0]);\n}\nmain();\n" csharp: "using System;\nusing System.Collections.Generic;\n\nusing OpenAI.Chat;\n\nChatClient client = new(\n model: \"gpt-6-astra\",\n apiKey: Environment.GetEnvironmentVariable(\"OPENAI_API_KEY\")\n);\n\nList messages =\n[\n new UserChatMessage(\n [\n ChatMessageContentPart.CreateTextPart(\"What's in this image?\"),\n ChatMessageContentPart.CreateImagePart(new Uri(\"https://upload.wikimedia.org/wikipedia/commons/thumb/d/dd/Gfp-wisconsin-madison-the-nature-boardwalk.jpg/2560px-Gfp-wisconsin-madison-the-nature-boardwalk.jpg\"))\n \ ])\n];\n\nChatCompletion completion = client.CompleteChat(messages);\n\nConsole.WriteLine(completion.Content[0].Text);\n" response: "{\n \"id\": \"chatcmpl-B9MHDbslfkBeAs8l4bebGdFOJ6PeG\",\n \"object\": \"chat.completion\",\n \ \"created\": 1741570283,\n \"model\": \"gpt-6-astra\",\n \"choices\": [\n {\n \"index\": 0,\n \"message\": {\n \"role\": \"assistant\",\n \"content\": \"The image shows a wooden boardwalk path running through a lush green field or meadow. The sky is bright blue with some scattered clouds, giving the scene a serene and peaceful atmosphere. Trees and shrubs are visible in the background.\",\n \"refusal\": null,\n \"annotations\": []\n },\n \"logprobs\": null,\n \"finish_reason\": \"stop\"\n }\n ],\n \ \"usage\": {\n \"prompt_tokens\": 1117,\n \"completion_tokens\": 46,\n \"total_tokens\": 1163,\n \"prompt_tokens_details\": {\n \"cached_tokens\": 0,\n \"audio_tokens\": 0\n },\n \"completion_tokens_details\": {\n \"reasoning_tokens\": 0,\n \"audio_tokens\": 0,\n \"accepted_prediction_tokens\": 0,\n \"rejected_prediction_tokens\": 0\n }\n \ },\n \"service_tier\": \"default\"\n}\n" - title: Streaming request: curl: "curl https://api.openai.com/v1/chat/completions \\\n -H \"Content-Type: application/json\" \\\n -H \"Authorization: Bearer $OPENAI_API_KEY\" \\\n -d '{\n \"model\": \"gpt-6-astra\",\n \ \"messages\": [\n {\n \"role\": \"developer\",\n \"content\": \"You are a helpful assistant.\"\n },\n {\n \"role\": \"user\",\n \"content\": \"Hello!\"\n }\n ],\n \"stream\": true\n }'\n" python: "from openai import OpenAI\nclient = OpenAI()\n\ncompletion = client.chat.completions.create(\n \ model=\"gpt-6-astra\",\n messages=[\n {\"role\": \"developer\", \"content\": \"You are a helpful assistant.\"},\n {\"role\": \"user\", \"content\": \"Hello!\"}\n ],\n \ stream=True\n)\n\nfor chunk in completion:\n print(chunk.choices[0].delta)\n" javascript: "import OpenAI from \"openai\";\n\nconst openai = new OpenAI();\n\nasync function main() {\n const completion = await openai.chat.completions.create({\n model: \"gpt-6-astra\",\n \ messages: [\n {\"role\": \"developer\", \"content\": \"You are a helpful assistant.\"},\n \ {\"role\": \"user\", \"content\": \"Hello!\"}\n ],\n stream: true,\n });\n\n \ for await (const chunk of completion) {\n console.log(chunk.choices[0].delta.content);\n \ }\n}\n\nmain();\n" csharp: "using System;\nusing System.ClientModel;\nusing System.Collections.Generic;\nusing System.Threading.Tasks;\n\nusing OpenAI.Chat;\n\nChatClient client = new(\n model: \"gpt-6-astra\",\n \ apiKey: Environment.GetEnvironmentVariable(\"OPENAI_API_KEY\")\n);\n\nList messages =\n[\n new SystemChatMessage(\"You are a helpful assistant.\"),\n new UserChatMessage(\"Hello!\")\n];\n\nAsyncCollectionResult completionUpdates = client.CompleteChatStreamingAsync(messages);\n\nawait foreach (StreamingChatCompletionUpdate completionUpdate in completionUpdates)\n{\n if (completionUpdate.ContentUpdate.Count > 0)\n {\n Console.Write(completionUpdate.ContentUpdate[0].Text);\n }\n}\n" response: '{"id":"chatcmpl-123","object":"chat.completion.chunk","created":1694268190,"model":"gpt-6-astra", "system_fingerprint": "fp_44709d6fcb", "choices":[{"index":0,"delta":{"role":"assistant","content":""},"logprobs":null,"finish_reason":null}]} {"id":"chatcmpl-123","object":"chat.completion.chunk","created":1694268190,"model":"gpt-6-astra", "system_fingerprint": "fp_44709d6fcb", "choices":[{"index":0,"delta":{"content":"Hello"},"logprobs":null,"finish_reason":null}]} .... {"id":"chatcmpl-123","object":"chat.completion.chunk","created":1694268190,"model":"gpt-6-astra", "system_fingerprint": "fp_44709d6fcb", "choices":[{"index":0,"delta":{},"logprobs":null,"finish_reason":"stop"}]} ' - title: Functions request: curl: "curl https://api.openai.com/v1/chat/completions \\\n-H \"Content-Type: application/json\" \\\n-H \"Authorization: Bearer $OPENAI_API_KEY\" \\\n-d '{\n \"model\": \"gpt-6-astra\",\n \ \"messages\": [\n {\n \"role\": \"user\",\n \"content\": \"What is the weather like in Boston today?\"\n }\n ],\n \"tools\": [\n {\n \"type\": \"function\",\n \ \"function\": {\n \"name\": \"get_current_weather\",\n \"description\": \"Get the current weather in a given location\",\n \"parameters\": {\n \"type\": \"object\",\n \"properties\": {\n \"location\": {\n \"type\": \"string\",\n \"description\": \"The city and state, e.g. San Francisco, CA\"\n \ },\n \"unit\": {\n \"type\": \"string\",\n \"enum\": [\"celsius\", \"fahrenheit\"]\n }\n },\n \"required\": [\"location\"]\n \ }\n }\n }\n ],\n \"tool_choice\": \"auto\"\n}'\n" python: "from openai import OpenAI\nclient = OpenAI()\n\ntools = [\n {\n \"type\": \"function\",\n \ \"function\": {\n \"name\": \"get_current_weather\",\n \"description\": \"Get the current weather in a given location\",\n \"parameters\": {\n \"type\": \"object\",\n \ \"properties\": {\n \"location\": {\n \"type\": \"string\",\n \ \"description\": \"The city and state, e.g. San Francisco, CA\",\n },\n \ \"unit\": {\"type\": \"string\", \"enum\": [\"celsius\", \"fahrenheit\"]},\n },\n \ \"required\": [\"location\"],\n },\n }\n }\n]\nmessages = [{\"role\": \"user\", \"content\": \"What's the weather like in Boston today?\"}]\ncompletion = client.chat.completions.create(\n \ model=\"gpt-6-astra\",\n messages=messages,\n tools=tools,\n tool_choice=\"auto\"\n)\n\nprint(completion)\n" javascript: "import OpenAI from \"openai\";\n\nconst openai = new OpenAI();\n\nasync function main() {\n const messages = [{\"role\": \"user\", \"content\": \"What's the weather like in Boston today?\"}];\n const tools = [\n {\n \"type\": \"function\",\n \"function\": {\n \"name\": \"get_current_weather\",\n \"description\": \"Get the current weather in a given location\",\n \"parameters\": {\n \"type\": \"object\",\n \ \"properties\": {\n \"location\": {\n \"type\": \"string\",\n \"description\": \"The city and state, e.g. San Francisco, CA\",\n },\n \"unit\": {\"type\": \"string\", \"enum\": [\"celsius\", \"fahrenheit\"]},\n },\n \"required\": [\"location\"],\n },\n \ }\n }\n ];\n\n const response = await openai.chat.completions.create({\n \ model: \"gpt-6-astra\",\n messages: messages,\n tools: tools,\n tool_choice: \"auto\",\n });\n\n console.log(response);\n}\n\nmain();\n" csharp: "using System;\nusing System.Collections.Generic;\n\nusing OpenAI.Chat;\n\nChatClient client = new(\n model: \"gpt-6-astra\",\n apiKey: Environment.GetEnvironmentVariable(\"OPENAI_API_KEY\")\n);\n\nChatTool getCurrentWeatherTool = ChatTool.CreateFunctionTool(\n functionName: \"get_current_weather\",\n \ functionDescription: \"Get the current weather in a given location\",\n functionParameters: BinaryData.FromString(\"\"\"\n {\n \"type\": \"object\",\n \"properties\": {\n \"location\": {\n \"type\": \"string\",\n \"description\": \"The city and state, e.g. San Francisco, CA\"\n },\n \"unit\": {\n \"type\": \"string\",\n \"enum\": [ \"celsius\", \"fahrenheit\" ]\n }\n },\n \"required\": [ \"location\" ]\n }\n \"\"\")\n);\n\nList messages =\n[\n new UserChatMessage(\"What's the weather like in Boston today?\"),\n];\n\nChatCompletionOptions options = new()\n{\n \ Tools =\n {\n getCurrentWeatherTool\n },\n ToolChoice = ChatToolChoice.CreateAutoChoice(),\n};\n\nChatCompletion completion = client.CompleteChat(messages, options);\n" response: "{\n \"id\": \"chatcmpl-abc123\",\n \"object\": \"chat.completion\",\n \"created\": 1699896916,\n \"model\": \"gpt-6-astra\",\n \"choices\": [\n {\n \"index\": 0,\n \ \"message\": {\n \"role\": \"assistant\",\n \"content\": null,\n \"tool_calls\": [\n {\n \"id\": \"call_abc123\",\n \"type\": \"function\",\n \ \"function\": {\n \"name\": \"get_current_weather\",\n \"arguments\": \"{\\n\\\"location\\\": \\\"Boston, MA\\\"\\n}\"\n }\n }\n ]\n \ },\n \"logprobs\": null,\n \"finish_reason\": \"tool_calls\"\n }\n ],\n \ \"usage\": {\n \"prompt_tokens\": 82,\n \"completion_tokens\": 17,\n \"total_tokens\": 99,\n \"completion_tokens_details\": {\n \"reasoning_tokens\": 0,\n \"accepted_prediction_tokens\": 0,\n \"rejected_prediction_tokens\": 0\n }\n }\n}\n" - title: Logprobs request: curl: "curl https://api.openai.com/v1/chat/completions \\\n -H \"Content-Type: application/json\" \\\n -H \"Authorization: Bearer $OPENAI_API_KEY\" \\\n -d '{\n \"model\": \"gpt-6-astra\",\n \ \"messages\": [\n {\n \"role\": \"user\",\n \"content\": \"Hello!\"\n \ }\n ],\n \"reasoning_effort\": \"none\",\n \"logprobs\": true,\n \"top_logprobs\": 2\n }'\n" python: "from openai import OpenAI\nclient = OpenAI()\n\ncompletion = client.chat.completions.create(\n \ model=\"gpt-6-astra\",\n messages=[\n {\"role\": \"user\", \"content\": \"Hello!\"}\n \ ],\n reasoning_effort=\"none\",\n logprobs=True,\n top_logprobs=2\n)\n\nprint(completion.choices[0].message)\nprint(completion.choices[0].logprobs)\n" javascript: "import OpenAI from \"openai\";\n\nconst openai = new OpenAI();\n\nasync function main() {\n const completion = await openai.chat.completions.create({\n messages: [{ role: \"user\", content: \"Hello!\" }],\n model: \"gpt-6-astra\",\n reasoning_effort: \"none\",\n logprobs: true,\n top_logprobs: 2,\n });\n\n console.log(completion.choices[0]);\n}\n\nmain();\n" csharp: "using System;\nusing System.Collections.Generic;\n\nusing OpenAI.Chat;\n\nChatClient client = new(\n model: \"gpt-6-astra\",\n apiKey: Environment.GetEnvironmentVariable(\"OPENAI_API_KEY\")\n);\n\nList messages =\n[\n new UserChatMessage(\"Hello!\")\n];\n\nChatCompletionOptions options = new()\n{\n ReasoningEffortLevel = ChatReasoningEffortLevel.None,\n IncludeLogProbabilities = true,\n TopLogProbabilityCount = 2\n};\n\nChatCompletion completion = client.CompleteChat(messages, options);\n\nConsole.WriteLine(completion.Content[0].Text);\n" response: "{\n \"id\": \"chatcmpl-123\",\n \"object\": \"chat.completion\",\n \"created\": 1702685778,\n \"model\": \"gpt-6-astra\",\n \"choices\": [\n {\n \"index\": 0,\n \ \"message\": {\n \"role\": \"assistant\",\n \"content\": \"Hello! How can I assist you today?\"\n },\n \"logprobs\": {\n \"content\": [\n {\n \ \"token\": \"Hello\",\n \"logprob\": -0.31725305,\n \"bytes\": [72, 101, 108, 108, 111],\n \"top_logprobs\": [\n {\n \"token\": \"Hello\",\n \"logprob\": -0.31725305,\n \"bytes\": [72, 101, 108, 108, 111]\n },\n {\n \"token\": \"Hi\",\n \"logprob\": -1.3190403,\n \"bytes\": [72, 105]\n }\n ]\n },\n \ {\n \"token\": \"!\",\n \"logprob\": -0.02380986,\n \"bytes\": [\n 33\n ],\n \"top_logprobs\": [\n {\n \"token\": \"!\",\n \"logprob\": -0.02380986,\n \"bytes\": [33]\n },\n \ {\n \"token\": \" there\",\n \"logprob\": -3.787621,\n \ \"bytes\": [32, 116, 104, 101, 114, 101]\n }\n ]\n \ },\n {\n \"token\": \" How\",\n \"logprob\": -0.000054669687,\n \ \"bytes\": [32, 72, 111, 119],\n \"top_logprobs\": [\n {\n \ \"token\": \" How\",\n \"logprob\": -0.000054669687,\n \"bytes\": [32, 72, 111, 119]\n },\n {\n \"token\": \"<|end|>\",\n \ \"logprob\": -10.953937,\n \"bytes\": null\n }\n \ ]\n },\n {\n \"token\": \" can\",\n \"logprob\": -0.015801601,\n \"bytes\": [32, 99, 97, 110],\n \"top_logprobs\": [\n \ {\n \"token\": \" can\",\n \"logprob\": -0.015801601,\n \ \"bytes\": [32, 99, 97, 110]\n },\n {\n \"token\": \" may\",\n \"logprob\": -4.161023,\n \"bytes\": [32, 109, 97, 121]\n }\n ]\n },\n {\n \"token\": \" I\",\n \"logprob\": -3.7697225e-6,\n \"bytes\": [\n 32,\n \ 73\n ],\n \"top_logprobs\": [\n {\n \"token\": \" I\",\n \"logprob\": -3.7697225e-6,\n \"bytes\": [32, 73]\n \ },\n {\n \"token\": \" assist\",\n \"logprob\": -13.596657,\n \"bytes\": [32, 97, 115, 115, 105, 115, 116]\n }\n \ ]\n },\n {\n \"token\": \" assist\",\n \"logprob\": -0.04571125,\n \"bytes\": [32, 97, 115, 115, 105, 115, 116],\n \"top_logprobs\": [\n {\n \"token\": \" assist\",\n \"logprob\": -0.04571125,\n \"bytes\": [32, 97, 115, 115, 105, 115, 116]\n },\n \ {\n \"token\": \" help\",\n \"logprob\": -3.1089056,\n \ \"bytes\": [32, 104, 101, 108, 112]\n }\n ]\n },\n \ {\n \"token\": \" you\",\n \"logprob\": -5.4385737e-6,\n \"bytes\": [32, 121, 111, 117],\n \"top_logprobs\": [\n {\n \"token\": \" you\",\n \"logprob\": -5.4385737e-6,\n \"bytes\": [32, 121, 111, 117]\n },\n {\n \"token\": \" today\",\n \"logprob\": -12.807695,\n \"bytes\": [32, 116, 111, 100, 97, 121]\n }\n ]\n \ },\n {\n \"token\": \" today\",\n \"logprob\": -0.0040071653,\n \ \"bytes\": [32, 116, 111, 100, 97, 121],\n \"top_logprobs\": [\n {\n \ \"token\": \" today\",\n \"logprob\": -0.0040071653,\n \"bytes\": [32, 116, 111, 100, 97, 121]\n },\n {\n \"token\": \"?\",\n \"logprob\": -5.5247097,\n \"bytes\": [63]\n }\n \ ]\n },\n {\n \"token\": \"?\",\n \"logprob\": -0.0008108172,\n \"bytes\": [63],\n \"top_logprobs\": [\n {\n \ \"token\": \"?\",\n \"logprob\": -0.0008108172,\n \"bytes\": [63]\n },\n {\n \"token\": \"?\\n\",\n \"logprob\": -7.184561,\n \"bytes\": [63, 10]\n }\n ]\n }\n \ ]\n },\n \"finish_reason\": \"stop\"\n }\n ],\n \"usage\": {\n \"prompt_tokens\": 9,\n \"completion_tokens\": 9,\n \"total_tokens\": 18,\n \"completion_tokens_details\": {\n \"reasoning_tokens\": 0,\n \"accepted_prediction_tokens\": 0,\n \"rejected_prediction_tokens\": 0\n }\n },\n \"system_fingerprint\": null\n}\n" x-tier: core /completions: post: operationId: createCompletion tags: - Completions summary: Create completion description: 'Creates a completion for the provided prompt and parameters. Returns a completion object, or a sequence of completion objects if the request is streamed. ' requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/CreateCompletionRequest' responses: '200': description: OK content: application/json: schema: $ref: '#/components/schemas/CreateCompletionResponse' '429': $ref: '#/components/responses/InferenceRateLimited' '503': $ref: '#/components/responses/InferenceServiceUnavailable' x-oaiMeta: group: completions legacy: true examples: - title: No streaming request: curl: "curl https://api.openai.com/v1/completions \\\n -H \"Content-Type: application/json\" \\\n -H \"Authorization: Bearer $OPENAI_API_KEY\" \\\n -d '{\n \"model\": \"gpt-3.5-turbo-instruct\",\n \ \"prompt\": \"Say this is a test\",\n \"max_tokens\": 7,\n \"temperature\": 0\n \ }'\n" python: "from openai import OpenAI\nclient = OpenAI()\n\nclient.completions.create(\n model=\"gpt-3.5-turbo-instruct\",\n \ prompt=\"Say this is a test\",\n max_tokens=7,\n temperature=0\n)\n" javascript: "import OpenAI from \"openai\";\n\nconst openai = new OpenAI();\n\nasync function main() {\n const completion = await openai.completions.create({\n model: \"gpt-3.5-turbo-instruct\",\n \ prompt: \"Say this is a test.\",\n max_tokens: 7,\n temperature: 0,\n });\n\n \ console.log(completion);\n}\nmain();" response: "{\n \"id\": \"cmpl-uqkvlQyYK7bGYrRHQ0eXlWi7\",\n \"object\": \"text_completion\",\n \ \"created\": 1589478378,\n \"model\": \"gpt-3.5-turbo-instruct\",\n \"system_fingerprint\": \"fp_44709d6fcb\",\n \"choices\": [\n {\n \"text\": \"\\n\\nThis is indeed a test\",\n \ \"index\": 0,\n \"logprobs\": null,\n \"finish_reason\": \"length\"\n }\n \ ],\n \"usage\": {\n \"prompt_tokens\": 5,\n \"completion_tokens\": 7,\n \"total_tokens\": 12\n }\n}\n" - title: Streaming request: curl: "curl https://api.openai.com/v1/completions \\\n -H \"Content-Type: application/json\" \\\n -H \"Authorization: Bearer $OPENAI_API_KEY\" \\\n -d '{\n \"model\": \"gpt-3.5-turbo-instruct\",\n \ \"prompt\": \"Say this is a test\",\n \"max_tokens\": 7,\n \"temperature\": 0,\n \ \"stream\": true\n }'\n" python: "from openai import OpenAI\nclient = OpenAI()\n\nfor chunk in client.completions.create(\n \ model=\"gpt-3.5-turbo-instruct\",\n prompt=\"Say this is a test\",\n max_tokens=7,\n \ temperature=0,\n stream=True\n):\n print(chunk.choices[0].text)\n" javascript: "import OpenAI from \"openai\";\n\nconst openai = new OpenAI();\n\nasync function main() {\n const stream = await openai.completions.create({\n model: \"gpt-3.5-turbo-instruct\",\n \ prompt: \"Say this is a test.\",\n stream: true,\n });\n\n for await (const chunk of stream) {\n console.log(chunk.choices[0].text)\n }\n}\nmain();" response: "{\n \"id\": \"cmpl-7iA7iJjj8V2zOkCGvWF2hAkDWBQZe\",\n \"object\": \"text_completion\",\n \ \"created\": 1690759702,\n \"choices\": [\n {\n \"text\": \"This\",\n \"index\": 0,\n \"logprobs\": null,\n \"finish_reason\": null\n }\n ],\n \"model\": \"gpt-3.5-turbo-instruct\"\n \ \"system_fingerprint\": \"fp_44709d6fcb\",\n}\n" x-tier: extended /embeddings: post: operationId: createEmbedding tags: - Embeddings summary: Create embeddings description: Creates an embedding vector representing the input text. requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/CreateEmbeddingRequest' responses: '200': description: OK content: application/json: schema: $ref: '#/components/schemas/CreateEmbeddingResponse' '429': $ref: '#/components/responses/InferenceRateLimited' '503': $ref: '#/components/responses/InferenceServiceUnavailable' x-oaiMeta: group: embeddings examples: request: curl: "curl https://api.openai.com/v1/embeddings \\\n -H \"Authorization: Bearer $OPENAI_API_KEY\" \\\n -H \"Content-Type: application/json\" \\\n -d '{\n \"input\": \"The food was delicious and the waiter...\",\n \"model\": \"text-embedding-ada-002\",\n \"encoding_format\": \"float\"\n }'\n" python: "from openai import OpenAI\nclient = OpenAI()\n\nclient.embeddings.create(\n model=\"text-embedding-ada-002\",\n \ input=\"The food was delicious and the waiter...\",\n encoding_format=\"float\"\n)\n" javascript: "import OpenAI from \"openai\";\n\nconst openai = new OpenAI();\n\nasync function main() {\n const embedding = await openai.embeddings.create({\n model: \"text-embedding-ada-002\",\n \ input: \"The quick brown fox jumped over the lazy dog\",\n encoding_format: \"float\",\n \ });\n\n console.log(embedding);\n}\n\nmain();\n" csharp: "using System;\n\nusing OpenAI.Embeddings;\n\nEmbeddingClient client = new(\n model: \"text-embedding-3-small\",\n apiKey: Environment.GetEnvironmentVariable(\"OPENAI_API_KEY\")\n);\n\nOpenAIEmbedding embedding = client.GenerateEmbedding(input: \"The quick brown fox jumped over the lazy dog\");\nReadOnlyMemory vector = embedding.ToFloats();\n\nfor (int i = 0; i < vector.Length; i++)\n{\n Console.WriteLine($\" \ [{i,4}] = {vector.Span[i]}\");\n}\n" response: "{\n \"object\": \"list\",\n \"data\": [\n {\n \"object\": \"embedding\",\n \ \"embedding\": [\n 0.0023064255,\n -0.009327292,\n .... (1536 floats total for ada-002)\n -0.0028842222,\n ],\n \"index\": 0\n }\n ],\n \"model\": \"text-embedding-ada-002\",\n \"usage\": {\n \"prompt_tokens\": 8,\n \"total_tokens\": 8\n }\n}\n" x-tier: extended /files: get: operationId: listFiles tags: - Files summary: List files description: Returns a list of files. parameters: - in: query name: purpose required: false schema: type: string description: Only return files with the given purpose. - name: limit in: query description: 'A limit on the number of objects to be returned. Limit can range between 1 and 10,000, and the default is 10,000. ' required: false schema: type: integer default: 10000 - name: order in: query description: 'Sort order by the `created_at` timestamp of the objects. `asc` for ascending order and `desc` for descending order. ' schema: type: string default: desc enum: - asc - desc - name: after in: query description: 'A cursor for use in pagination. `after` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with obj_foo, your subsequent call can include after=obj_foo in order to fetch the next page of the list. ' schema: type: string responses: '200': description: OK content: application/json: schema: $ref: '#/components/schemas/ListFilesResponse' x-oaiMeta: group: files examples: request: curl: "curl https://api.openai.com/v1/files \\\n -H \"Authorization: Bearer $OPENAI_API_KEY\"\n" python: 'from openai import OpenAI client = OpenAI() client.files.list() ' javascript: "import OpenAI from \"openai\";\n\nconst openai = new OpenAI();\n\nasync function main() {\n const list = await openai.files.list();\n\n for await (const file of list) {\n console.log(file);\n }\n}\n\nmain();" response: "{\n \"object\": \"list\",\n \"data\": [\n {\n \"id\": \"file-abc123\",\n \ \"object\": \"file\",\n \"bytes\": 175,\n \"created_at\": 1613677385,\n \"expires_at\": 1677614202,\n \"filename\": \"salesOverview.pdf\",\n \"purpose\": \"assistants\",\n \ },\n {\n \"id\": \"file-abc456\",\n \"object\": \"file\",\n \"bytes\": 140,\n \"created_at\": 1613779121,\n \"expires_at\": 1677614202,\n \"filename\": \"puppy.jsonl\",\n \"purpose\": \"fine-tune\",\n }\n ],\n \"first_id\": \"file-abc123\",\n \ \"last_id\": \"file-abc456\",\n \"has_more\": false\n}\n" x-tier: extended post: operationId: createFile tags: - Files summary: Upload file description: "Upload a file that can be used across various endpoints. Individual files\ncan be up to 512 MB, and each project can store up to 2.5 TB of files in\ntotal. There is no organization-wide storage limit. Uploads to this\nendpoint are rate-limited to 1,000 requests per minute per authenticated\nuser.\n\n- The Assistants API supports files up to 2 million tokens and of specific\n file types. See the [Assistants Tools guide](https://developers.openai.com/api/docs/guides/tools) for\n details.\n- The Fine-tuning API only supports `.jsonl` files. The input also has\n certain required formats for fine-tuning\n [chat](https://developers.openai.com/api/docs/guides/supervised-fine-tuning#formatting-your-data) or\n [completions](https://developers.openai.com/api/docs/guides/supervised-fine-tuning#formatting-your-data) models.\n- The Batch API only supports `.jsonl` files up to 200 MB in size. The input\n also has a specific required\n [format](https://developers.openai.com/api/docs/guides/batch#1-prepare-your-batch-file).\n- For Retrieval or `file_search` ingestion, upload files here first. If\n you need to attach multiple uploaded files to the same vector store, use\n [`/vector_stores/{vector_store_id}/file_batches`](https://developers.openai.com/api/reference/resources/vector_stores/subresources/file_batches/methods/create)\n \ instead of attaching them one by one. Vector store attachment has separate\n limits from file upload, including 2,000 attached files per minute per\n organization.\n\nPlease [contact us](https://help.openai.com/) if you need to increase these\nstorage limits.\n" requestBody: required: true content: multipart/form-data: schema: $ref: '#/components/schemas/CreateFileRequest' responses: '200': description: OK content: application/json: schema: $ref: '#/components/schemas/OpenAIFile' x-oaiMeta: group: files examples: request: curl: "curl https://api.openai.com/v1/files \\\n -H \"Authorization: Bearer $OPENAI_API_KEY\" \\\n -F purpose=\"fine-tune\" \\\n -F file=\"@mydata.jsonl\"\n -F expires_after[anchor]=\"created_at\"\n \ -F expires_after[seconds]=2592000\n" python: "from openai import OpenAI\nclient = OpenAI()\n\nclient.files.create(\n file=open(\"mydata.jsonl\", \"rb\"),\n purpose=\"fine-tune\",\n expires_after={\n \"anchor\": \"created_at\",\n \ \"seconds\": 2592000\n }\n)\n" javascript: "import fs from \"fs\";\nimport OpenAI from \"openai\";\n\nconst openai = new OpenAI();\n\nasync function main() {\n const file = await openai.files.create({\n file: fs.createReadStream(\"mydata.jsonl\"),\n purpose: \"fine-tune\",\n expires_after: {\n anchor: \"created_at\",\n seconds: 2592000\n }\n });\n\n console.log(file);\n}\n\nmain();" response: "{\n \"id\": \"file-abc123\",\n \"object\": \"file\",\n \"bytes\": 120000,\n \"created_at\": 1677610602,\n \"expires_at\": 1677614202,\n \"filename\": \"mydata.jsonl\",\n \"purpose\": \"fine-tune\",\n}\n" x-tier: extended /files/{file_id}: delete: operationId: deleteFile tags: - Files summary: Delete file description: Delete a file and remove it from all vector stores. parameters: - in: path name: file_id required: true schema: type: string description: The ID of the file to use for this request. responses: '200': description: OK content: application/json: schema: $ref: '#/components/schemas/DeleteFileResponse' x-oaiMeta: group: files examples: request: curl: "curl https://api.openai.com/v1/files/file-abc123 \\\n -X DELETE \\\n -H \"Authorization: Bearer $OPENAI_API_KEY\"\n" python: 'from openai import OpenAI client = OpenAI() client.files.delete("file-abc123") ' javascript: "import OpenAI from \"openai\";\n\nconst openai = new OpenAI();\n\nasync function main() {\n const file = await openai.files.delete(\"file-abc123\");\n\n console.log(file);\n}\n\nmain();" response: "{\n \"id\": \"file-abc123\",\n \"object\": \"file\",\n \"deleted\": true\n}\n" x-tier: extended get: operationId: retrieveFile tags: - Files summary: Retrieve file description: Returns information about a specific file. parameters: - in: path name: file_id required: true schema: type: string description: The ID of the file to use for this request. responses: '200': description: OK content: application/json: schema: $ref: '#/components/schemas/OpenAIFile' x-oaiMeta: group: files examples: request: curl: "curl https://api.openai.com/v1/files/file-abc123 \\\n -H \"Authorization: Bearer $OPENAI_API_KEY\"\n" python: 'from openai import OpenAI client = OpenAI() client.files.retrieve("file-abc123") ' javascript: "import OpenAI from \"openai\";\n\nconst openai = new OpenAI();\n\nasync function main() {\n const file = await openai.files.retrieve(\"file-abc123\");\n\n console.log(file);\n}\n\nmain();" response: "{\n \"id\": \"file-abc123\",\n \"object\": \"file\",\n \"bytes\": 120000,\n \"created_at\": 1677610602,\n \"expires_at\": 1677614202,\n \"filename\": \"mydata.jsonl\",\n \"purpose\": \"fine-tune\",\n}\n" x-tier: extended /files/{file_id}/content: get: operationId: downloadFile tags: - Files summary: Retrieve file content description: Returns a response containing the contents of the specified file. parameters: - in: path name: file_id required: true schema: type: string description: The ID of the file to use for this request. responses: '200': description: OK content: application/json: schema: type: string x-oaiMeta: group: files examples: request: curl: "curl https://api.openai.com/v1/files/file-abc123/content \\\n -H \"Authorization: Bearer $OPENAI_API_KEY\" > file.jsonl\n" python: 'from openai import OpenAI client = OpenAI() content = client.files.content("file-abc123") ' javascript: "import OpenAI from \"openai\";\n\nconst openai = new OpenAI();\n\nasync function main() {\n const response = await openai.files.content(\"file-abc123\");\n const content = await response.text();\n\n console.log(content);\n}\n\nmain();\n" x-tier: extended /images/edits: post: operationId: createImageEdit tags: - Images summary: Create image edit description: Creates an edited or extended image given one or more source images and a prompt. This endpoint supports GPT Image models and `dall-e-2`. requestBody: required: true content: multipart/form-data: schema: $ref: '#/components/schemas/CreateImageEditRequest' examples: multipart_edit: summary: Multipart form upload (binary image + prompt) value: model: gpt-image-1.5 prompt: Add a watercolor effect to this image image: size: 1024x1024 quality: high application/json: schema: $ref: '#/components/schemas/EditImageBodyJsonParam' examples: json_with_url: summary: JSON request with image URL value: model: gpt-image-1.5 prompt: Add a watercolor effect to this image images: - image_url: https://example.com/source-image.png size: 1024x1024 quality: high json_with_file_id: summary: JSON request with uploaded file id value: model: gpt-image-1.5 prompt: Replace the background with a snowy mountain scene images: - file_id: file-abc123 mask: file_id: file-mask123 output_format: png output_compression: 100 responses: '200': description: OK content: application/json: schema: $ref: '#/components/schemas/ImagesResponse' text/event-stream: schema: $ref: '#/components/schemas/ImageEditStreamEvent' '429': $ref: '#/components/responses/InferenceRateLimited' '503': $ref: '#/components/responses/InferenceServiceUnavailable' x-oaiMeta: group: images examples: - title: Edit image request: curl: "curl -s -D >(grep -i x-request-id >&2) \\\n -o >(jq -r '.data[0].b64_json' | base64 --decode > gift-basket.png) \\\n -X POST \"https://api.openai.com/v1/images/edits\" \\\n \ -H \"Authorization: Bearer $OPENAI_API_KEY\" \\\n -F \"model=gpt-image-1.5\" \\\n -F \"image[]=@body-lotion.png\" \\\n -F \"image[]=@bath-bomb.png\" \\\n -F \"image[]=@incense-kit.png\" \\\n -F \"image[]=@soap.png\" \\\n -F 'prompt=Create a lovely gift basket with these four items in it'\n" python: "import base64\nfrom openai import OpenAI\nclient = OpenAI()\n\nprompt = \"\"\"\nGenerate a photorealistic image of a gift basket on a white background\nlabeled 'Relax & Unwind' with a ribbon and handwriting-like font,\ncontaining all the items in the reference pictures.\n\"\"\"\n\nresult = client.images.edit(\n model=\"gpt-image-1.5\",\n image=[\n open(\"body-lotion.png\", \"rb\"),\n open(\"bath-bomb.png\", \"rb\"),\n open(\"incense-kit.png\", \"rb\"),\n \ open(\"soap.png\", \"rb\"),\n ],\n prompt=prompt\n)\n\nimage_base64 = result.data[0].b64_json\nimage_bytes = base64.b64decode(image_base64)\n\n# Save the image to a file\nwith open(\"gift-basket.png\", \"wb\") as f:\n f.write(image_bytes)\n" javascript: "import fs from \"fs\";\nimport OpenAI, { toFile } from \"openai\";\n\nconst client = new OpenAI();\n\nconst imageFiles = [\n \"bath-bomb.png\",\n \"body-lotion.png\",\n \ \"incense-kit.png\",\n \"soap.png\",\n];\n\nconst images = await Promise.all(\n imageFiles.map(async (file) =>\n await toFile(fs.createReadStream(file), null, {\n type: \"image/png\",\n \ })\n ),\n);\n\nconst rsp = await client.images.edit({\n model: \"gpt-image-1.5\",\n \ image: images,\n prompt: \"Create a lovely gift basket with these four items in it\",\n});\n\n// Save the image to a file\nconst image_base64 = rsp.data[0].b64_json;\nconst image_bytes = Buffer.from(image_base64, \"base64\");\nfs.writeFileSync(\"basket.png\", image_bytes);\n" - title: Streaming request: curl: "curl -s -N -X POST \"https://api.openai.com/v1/images/edits\" \\\n -H \"Authorization: Bearer $OPENAI_API_KEY\" \\\n -F \"model=gpt-image-1.5\" \\\n -F \"image[]=@body-lotion.png\" \\\n -F \"image[]=@bath-bomb.png\" \\\n -F \"image[]=@incense-kit.png\" \\\n -F \"image[]=@soap.png\" \\\n -F 'prompt=Create a lovely gift basket with these four items in it' \\\n -F \"stream=true\"\n" python: "from openai import OpenAI\n\nclient = OpenAI()\n\nprompt = \"\"\"\nGenerate a photorealistic image of a gift basket on a white background\nlabeled 'Relax & Unwind' with a ribbon and handwriting-like font,\ncontaining all the items in the reference pictures.\n\"\"\"\n\nstream = client.images.edit(\n model=\"gpt-image-1.5\",\n image=[\n open(\"body-lotion.png\", \"rb\"),\n open(\"bath-bomb.png\", \"rb\"),\n open(\"incense-kit.png\", \"rb\"),\n \ open(\"soap.png\", \"rb\"),\n ],\n prompt=prompt,\n stream=True\n)\n\nfor event in stream:\n print(event)\n" javascript: "import fs from \"fs\";\nimport OpenAI, { toFile } from \"openai\";\n\nconst client = new OpenAI();\n\nconst imageFiles = [\n \"bath-bomb.png\",\n \"body-lotion.png\",\n \ \"incense-kit.png\",\n \"soap.png\",\n];\n\nconst images = await Promise.all(\n imageFiles.map(async (file) =>\n await toFile(fs.createReadStream(file), null, {\n type: \"image/png\",\n \ })\n ),\n);\n\nconst stream = await client.images.edit({\n model: \"gpt-image-1.5\",\n \ image: images,\n prompt: \"Create a lovely gift basket with these four items in it\",\n \ stream: true,\n});\n\nfor await (const event of stream) {\n console.log(event);\n}\n" response: 'event: image_edit.partial_image data: {"type":"image_edit.partial_image","b64_json":"...","partial_image_index":0} event: image_edit.completed data: {"type":"image_edit.completed","b64_json":"...","usage":{"total_tokens":100,"input_tokens":50,"output_tokens":50,"input_tokens_details":{"text_tokens":10,"image_tokens":40}}} ' x-tier: extended /images/generations: post: operationId: createImage tags: - Images summary: Create image description: 'Creates an image given a prompt. [Learn more](https://developers.openai.com/api/docs/guides/images-vision). ' requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/CreateImageRequest' responses: '200': description: OK content: application/json: schema: $ref: '#/components/schemas/ImagesResponse' text/event-stream: schema: $ref: '#/components/schemas/ImageGenStreamEvent' '429': $ref: '#/components/responses/InferenceRateLimited' '503': $ref: '#/components/responses/InferenceServiceUnavailable' x-oaiMeta: group: images examples: - title: Generate image request: curl: "curl https://api.openai.com/v1/images/generations \\\n -H \"Content-Type: application/json\" \\\n -H \"Authorization: Bearer $OPENAI_API_KEY\" \\\n -d '{\n \"model\": \"gpt-image-1.5\",\n \ \"prompt\": \"A cute baby sea otter\",\n \"n\": 1,\n \"size\": \"1024x1024\"\n \ }'\n" python: "import base64\nfrom openai import OpenAI\nclient = OpenAI()\n\nimg = client.images.generate(\n \ model=\"gpt-image-1.5\",\n prompt=\"A cute baby sea otter\",\n n=1,\n size=\"1024x1024\"\n)\n\nimage_bytes = base64.b64decode(img.data[0].b64_json)\nwith open(\"output.png\", \"wb\") as f:\n f.write(image_bytes)\n" javascript: "import OpenAI from \"openai\";\nimport { writeFile } from \"fs/promises\";\n\nconst client = new OpenAI();\n\nconst img = await client.images.generate({\n model: \"gpt-image-1.5\",\n \ prompt: \"A cute baby sea otter\",\n n: 1,\n size: \"1024x1024\"\n});\n\nconst imageBuffer = Buffer.from(img.data[0].b64_json, \"base64\");\nawait writeFile(\"output.png\", imageBuffer);\n" response: "{\n \"created\": 1713833628,\n \"data\": [\n {\n \"b64_json\": \"...\"\n \ }\n ],\n \"usage\": {\n \"total_tokens\": 100,\n \"input_tokens\": 50,\n \"output_tokens\": 50,\n \"input_tokens_details\": {\n \"text_tokens\": 10,\n \"image_tokens\": 40\n }\n }\n}\n" - title: Streaming request: curl: "curl https://api.openai.com/v1/images/generations \\\n -H \"Content-Type: application/json\" \\\n -H \"Authorization: Bearer $OPENAI_API_KEY\" \\\n -d '{\n \"model\": \"gpt-image-1.5\",\n \ \"prompt\": \"A cute baby sea otter\",\n \"n\": 1,\n \"size\": \"1024x1024\",\n \ \"stream\": true\n }' \\\n --no-buffer\n" python: "from openai import OpenAI\n\nclient = OpenAI()\n\nstream = client.images.generate(\n \ model=\"gpt-image-1.5\",\n prompt=\"A cute baby sea otter\",\n n=1,\n size=\"1024x1024\",\n \ stream=True\n)\n\nfor event in stream:\n print(event)\n" javascript: "import OpenAI from \"openai\";\n\nconst client = new OpenAI();\n\nconst stream = await client.images.generate({\n model: \"gpt-image-1.5\",\n prompt: \"A cute baby sea otter\",\n n: 1,\n size: \"1024x1024\",\n stream: true,\n});\n\nfor await (const event of stream) {\n console.log(event);\n}\n" response: 'event: image_generation.partial_image data: {"type":"image_generation.partial_image","b64_json":"...","partial_image_index":0} event: image_generation.completed data: {"type":"image_generation.completed","b64_json":"...","usage":{"total_tokens":100,"input_tokens":50,"output_tokens":50,"input_tokens_details":{"text_tokens":10,"image_tokens":40}}} ' x-tier: extended /models: get: operationId: listModels tags: - Models summary: List models description: Lists the currently available models, and provides basic information about each one such as the owner and availability. responses: '200': description: OK content: application/json: schema: $ref: '#/components/schemas/ListModelsResponse' x-oaiMeta: group: models examples: request: curl: "curl https://api.openai.com/v1/models \\\n -H \"Authorization: Bearer $OPENAI_API_KEY\"\n" python: 'from openai import OpenAI client = OpenAI() client.models.list() ' javascript: "import OpenAI from \"openai\";\n\nconst openai = new OpenAI();\n\nasync function main() {\n const list = await openai.models.list();\n\n for await (const model of list) {\n console.log(model);\n }\n}\nmain();" csharp: "using System;\n\nusing OpenAI.Models;\n\nOpenAIModelClient client = new(\n apiKey: Environment.GetEnvironmentVariable(\"OPENAI_API_KEY\")\n);\n\nforeach (var model in client.GetModels().Value)\n{\n \ Console.WriteLine(model.Id);\n}\n" response: "{\n \"object\": \"list\",\n \"data\": [\n {\n \"id\": \"model-id-0\",\n \ \"object\": \"model\",\n \"created\": 1686935002,\n \"owned_by\": \"organization-owner\",\n \ \"shutdown_date\": null\n },\n {\n \"id\": \"model-id-1\",\n \"object\": \"model\",\n \"created\": 1686935002,\n \"owned_by\": \"organization-owner\",\n \ \"shutdown_date\": null\n },\n {\n \"id\": \"model-id-2\",\n \"object\": \"model\",\n \"created\": 1686935002,\n \"owned_by\": \"openai\",\n \"shutdown_date\": \"2026-10-23\"\n },\n ]\n}\n" x-tier: core /models/{model}: get: operationId: retrieveModel tags: - Models summary: Retrieve model description: Retrieves a model instance, providing basic information about the model such as the owner and permissioning. parameters: - in: path name: model required: true schema: type: string example: gpt-6-astra description: The ID of the model to use for this request responses: '200': description: OK content: application/json: schema: $ref: '#/components/schemas/Model' x-oaiMeta: group: models examples: request: curl: "curl https://api.openai.com/v1/models/gpt-6-astra \\\n -H \"Authorization: Bearer $OPENAI_API_KEY\"\n" python: 'from openai import OpenAI client = OpenAI() client.models.retrieve("gpt-6-astra") ' javascript: "import OpenAI from \"openai\";\n\nconst openai = new OpenAI();\n\nasync function main() {\n const model = await openai.models.retrieve(\"gpt-6-astra\");\n\n console.log(model);\n}\n\nmain();" csharp: "using System;\nusing System.ClientModel;\n\nusing OpenAI.Models;\n\n OpenAIModelClient client = new(\n apiKey: Environment.GetEnvironmentVariable(\"OPENAI_API_KEY\")\n);\n\nClientResult model = client.GetModel(\"babbage-002\");\nConsole.WriteLine(model.Value.Id);\n" response: "{\n \"id\": \"gpt-6-astra\",\n \"object\": \"model\",\n \"created\": 1686935002,\n \ \"owned_by\": \"openai\",\n \"shutdown_date\": \"2026-10-23\"\n}\n" x-tier: extended delete: operationId: deleteModel tags: - Models summary: Delete a fine-tuned model description: Delete a fine-tuned model. You must have the Owner role in your organization to delete a model. parameters: - in: path name: model required: true schema: type: string example: ft:gpt-4o-mini:acemeco:suffix:abc123 description: The model to delete responses: '200': description: OK content: application/json: schema: $ref: '#/components/schemas/DeleteModelResponse' x-oaiMeta: group: models examples: request: curl: "curl https://api.openai.com/v1/models/ft:gpt-4o-mini:acemeco:suffix:abc123 \\\n -X DELETE \\\n -H \"Authorization: Bearer $OPENAI_API_KEY\"\n" python: 'from openai import OpenAI client = OpenAI() client.models.delete("ft:gpt-4o-mini:acemeco:suffix:abc123") ' javascript: "import OpenAI from \"openai\";\n\nconst openai = new OpenAI();\n\nasync function main() {\n const model = await openai.models.delete(\"ft:gpt-4o-mini:acemeco:suffix:abc123\");\n \ \n console.log(model);\n}\nmain();" csharp: "using System;\nusing System.ClientModel;\n\nusing OpenAI.Models;\n\nOpenAIModelClient client = new(\n apiKey: Environment.GetEnvironmentVariable(\"OPENAI_API_KEY\")\n);\n\nClientResult success = client.DeleteModel(\"ft:gpt-4o-mini:acemeco:suffix:abc123\");\nConsole.WriteLine(success);\n" response: "{\n \"id\": \"ft:gpt-4o-mini:acemeco:suffix:abc123\",\n \"object\": \"model\",\n \ \"deleted\": true\n}\n" x-tier: vendor /responses: post: operationId: createResponse tags: - Responses summary: Create a model response description: 'Creates a model response. Provide [text](https://developers.openai.com/api/docs/guides/text) or [image](https://developers.openai.com/api/docs/guides/images-vision) inputs to generate [text](https://developers.openai.com/api/docs/guides/text) or [JSON](https://developers.openai.com/api/docs/guides/structured-outputs) outputs. Have the model call your own [custom code](https://developers.openai.com/api/docs/guides/function-calling) or use built-in [tools](https://developers.openai.com/api/docs/guides/tools) like [web search](https://developers.openai.com/api/docs/guides/tools-web-search) or [file search](https://developers.openai.com/api/docs/guides/tools-file-search) to use your own data as input for the model''s response. ' requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/CreateResponse' responses: '200': description: OK content: application/json: schema: $ref: '#/components/schemas/Response' text/event-stream: schema: $ref: '#/components/schemas/ResponseStreamEvent' '429': $ref: '#/components/responses/InferenceRateLimited' '503': $ref: '#/components/responses/InferenceServiceUnavailable' x-oaiMeta: group: responses path: create examples: - title: Text input request: curl: "curl https://api.openai.com/v1/responses \\\n -H \"Content-Type: application/json\" \\\n -H \"Authorization: Bearer $OPENAI_API_KEY\" \\\n -d '{\n \"model\": \"gpt-6-astra\",\n \ \"input\": \"Tell me a three sentence bedtime story about a unicorn.\"\n }'\n" javascript: "import OpenAI from \"openai\";\n\nconst openai = new OpenAI();\n\nconst response = await openai.responses.create({\n model: \"gpt-6-astra\",\n input: \"Tell me a three sentence bedtime story about a unicorn.\"\n});\n\nconsole.log(response);\n" python: "from openai import OpenAI\n\nclient = OpenAI()\n\nresponse = client.responses.create(\n \ model=\"gpt-6-astra\",\n input=\"Tell me a three sentence bedtime story about a unicorn.\"\n)\n\nprint(response)\n" csharp: "using System;\nusing OpenAI.Responses;\n\nOpenAIResponseClient client = new(\n model: \"gpt-6-astra\",\n apiKey: Environment.GetEnvironmentVariable(\"OPENAI_API_KEY\")\n);\n\nOpenAIResponse response = client.CreateResponse(\"Tell me a three sentence bedtime story about a unicorn.\");\n\nConsole.WriteLine(response.GetOutputText());\n" response: "{\n \"id\": \"resp_67ccd2bed1ec8190b14f964abc0542670bb6a6b452d3795b\",\n \"object\": \"response\",\n \"created_at\": 1741476542,\n \"status\": \"completed\",\n \"completed_at\": 1741476543,\n \"error\": null,\n \"incomplete_details\": null,\n \"instructions\": null,\n \ \"max_output_tokens\": null,\n \"model\": \"gpt-6-astra\",\n \"output\": [\n {\n \"type\": \"message\",\n \"id\": \"msg_67ccd2bf17f0819081ff3bb2cf6508e60bb6a6b452d3795b\",\n \"status\": \"completed\",\n \"role\": \"assistant\",\n \"content\": [\n {\n \"type\": \"output_text\",\n \"text\": \"In a peaceful grove beneath a silver moon, a unicorn named Lumina discovered a hidden pool that reflected the stars. As she dipped her horn into the water, the pool began to shimmer, revealing a pathway to a magical realm of endless night skies. Filled with wonder, Lumina whispered a wish for all who dream to find their own hidden magic, and as she glanced back, her hoofprints sparkled like stardust.\",\n \"annotations\": []\n }\n ]\n }\n ],\n \"parallel_tool_calls\": true,\n \"previous_response_id\": null,\n \"reasoning\": {\n \"effort\": null,\n \"summary\": null\n },\n \"store\": true,\n \"temperature\": 1.0,\n \"text\": {\n \"format\": {\n \"type\": \"text\"\n \ }\n },\n \"tool_choice\": \"auto\",\n \"tools\": [],\n \"top_p\": 1.0,\n \"truncation\": \"disabled\",\n \"usage\": {\n \"input_tokens\": 36,\n \"input_tokens_details\": {\n \ \"cached_tokens\": 0,\n \"cache_write_tokens\": 0\n },\n \"output_tokens\": 87,\n \"output_tokens_details\": {\n \"reasoning_tokens\": 0\n },\n \"total_tokens\": 123\n },\n \"user\": null,\n \"metadata\": {}\n}\n" - title: Image input request: curl: "curl https://api.openai.com/v1/responses \\\n -H \"Content-Type: application/json\" \\\n -H \"Authorization: Bearer $OPENAI_API_KEY\" \\\n -d '{\n \"model\": \"gpt-6-astra\",\n \ \"input\": [\n {\n \"role\": \"user\",\n \"content\": [\n {\"type\": \"input_text\", \"text\": \"what is in this image?\"},\n {\n \"type\": \"input_image\",\n \"image_url\": \"https://upload.wikimedia.org/wikipedia/commons/thumb/d/dd/Gfp-wisconsin-madison-the-nature-boardwalk.jpg/2560px-Gfp-wisconsin-madison-the-nature-boardwalk.jpg\"\n \ }\n ]\n }\n ]\n }'\n" javascript: "import OpenAI from \"openai\";\n\nconst openai = new OpenAI();\n\nconst response = await openai.responses.create({\n model: \"gpt-6-astra\",\n input: [\n {\n \ role: \"user\",\n content: [\n { type: \"input_text\", text: \"what is in this image?\" },\n {\n type: \"input_image\",\n \ image_url:\n \"https://upload.wikimedia.org/wikipedia/commons/thumb/d/dd/Gfp-wisconsin-madison-the-nature-boardwalk.jpg/2560px-Gfp-wisconsin-madison-the-nature-boardwalk.jpg\",\n \ },\n ],\n },\n ],\n});\n\nconsole.log(response);\n" python: "from openai import OpenAI\n\nclient = OpenAI()\n\nresponse = client.responses.create(\n \ model=\"gpt-6-astra\",\n input=[\n {\n \"role\": \"user\",\n \"content\": [\n { \"type\": \"input_text\", \"text\": \"what is in this image?\" },\n \ {\n \"type\": \"input_image\",\n \"image_url\": \"https://upload.wikimedia.org/wikipedia/commons/thumb/d/dd/Gfp-wisconsin-madison-the-nature-boardwalk.jpg/2560px-Gfp-wisconsin-madison-the-nature-boardwalk.jpg\"\n \ }\n ]\n }\n ]\n)\n\nprint(response)\n" csharp: "using System;\nusing System.Collections.Generic;\n\nusing OpenAI.Responses;\n\nOpenAIResponseClient client = new(\n model: \"gpt-6-astra\",\n apiKey: Environment.GetEnvironmentVariable(\"OPENAI_API_KEY\")\n);\n\nList inputItems =\n[\n ResponseItem.CreateUserMessageItem(\n [\n ResponseContentPart.CreateInputTextPart(\"What is in this image?\"),\n ResponseContentPart.CreateInputImagePart(new Uri(\"https://upload.wikimedia.org/wikipedia/commons/thumb/d/dd/Gfp-wisconsin-madison-the-nature-boardwalk.jpg/2560px-Gfp-wisconsin-madison-the-nature-boardwalk.jpg\"))\n \ ]\n )\n];\n\nOpenAIResponse response = client.CreateResponse(inputItems);\n\nConsole.WriteLine(response.GetOutputText());\n" response: "{\n \"id\": \"resp_67ccd3a9da748190baa7f1570fe91ac604becb25c45c1d41\",\n \"object\": \"response\",\n \"created_at\": 1741476777,\n \"status\": \"completed\",\n \"completed_at\": 1741476778,\n \"error\": null,\n \"incomplete_details\": null,\n \"instructions\": null,\n \ \"max_output_tokens\": null,\n \"model\": \"gpt-6-astra\",\n \"output\": [\n {\n \"type\": \"message\",\n \"id\": \"msg_67ccd3acc8d48190a77525dc6de64b4104becb25c45c1d41\",\n \"status\": \"completed\",\n \"role\": \"assistant\",\n \"content\": [\n {\n \"type\": \"output_text\",\n \"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.\",\n \"annotations\": []\n }\n ]\n \ }\n ],\n \"parallel_tool_calls\": true,\n \"previous_response_id\": null,\n \"reasoning\": {\n \"effort\": null,\n \"summary\": null\n },\n \"store\": true,\n \"temperature\": 1.0,\n \"text\": {\n \"format\": {\n \"type\": \"text\"\n }\n },\n \"tool_choice\": \"auto\",\n \"tools\": [],\n \"top_p\": 1.0,\n \"truncation\": \"disabled\",\n \"usage\": {\n \"input_tokens\": 328,\n \"input_tokens_details\": {\n \"cached_tokens\": 0,\n \ \"cache_write_tokens\": 0\n },\n \"output_tokens\": 52,\n \"output_tokens_details\": {\n \"reasoning_tokens\": 0\n },\n \"total_tokens\": 380\n },\n \"user\": null,\n \ \"metadata\": {}\n}\n" - title: File input request: curl: "curl https://api.openai.com/v1/responses \\\n -H \"Content-Type: application/json\" \\\n -H \"Authorization: Bearer $OPENAI_API_KEY\" \\\n -d '{\n \"model\": \"gpt-6-astra\",\n \ \"input\": [\n {\n \"role\": \"user\",\n \"content\": [\n {\"type\": \"input_text\", \"text\": \"what is in this file?\"},\n {\n \"type\": \"input_file\",\n \"file_url\": \"https://www.berkshirehathaway.com/letters/2024ltr.pdf\",\n \ \"detail\": \"auto\"\n }\n ]\n }\n ]\n }'\n" javascript: "import OpenAI from \"openai\";\n\nconst openai = new OpenAI();\n\nconst response = await openai.responses.create({\n model: \"gpt-6-astra\",\n input: [\n {\n \ role: \"user\",\n content: [\n { type: \"input_text\", text: \"what is in this file?\" },\n {\n type: \"input_file\",\n \ file_url: \"https://www.berkshirehathaway.com/letters/2024ltr.pdf\",\n \ detail: \"auto\",\n },\n ],\n },\n \ ],\n});\n\nconsole.log(response);\n" python: "from openai import OpenAI\n\nclient = OpenAI()\n\nresponse = client.responses.create(\n \ model=\"gpt-6-astra\",\n input=[\n {\n \"role\": \"user\",\n \"content\": [\n { \"type\": \"input_text\", \"text\": \"what is in this file?\" },\n \ {\n \"type\": \"input_file\",\n \"file_url\": \"https://www.berkshirehathaway.com/letters/2024ltr.pdf\",\n \"detail\": \"auto\"\n }\n ]\n }\n ]\n)\n\nprint(response)\n" response: "{\n \"id\": \"resp_686eef60237881a2bd1180bb8b13de430e34c516d176ff86\",\n \"object\": \"response\",\n \"created_at\": 1752100704,\n \"status\": \"completed\",\n \"completed_at\": 1752100705,\n \"background\": false,\n \"error\": null,\n \"incomplete_details\": null,\n \ \"instructions\": null,\n \"max_output_tokens\": null,\n \"max_tool_calls\": null,\n \"model\": \"gpt-6-astra\",\n \"output\": [\n {\n \"id\": \"msg_686eef60d3e081a29283bdcbc4322fd90e34c516d176ff86\",\n \ \"type\": \"message\",\n \"status\": \"completed\",\n \"content\": [\n {\n \ \"type\": \"output_text\",\n \"annotations\": [],\n \"logprobs\": [],\n \"text\": \"The file seems to contain excerpts from a letter to the shareholders of Berkshire Hathaway Inc., likely written by Warren Buffett. It covers several topics:\\n\\n1. **Communication Philosophy**: Buffett emphasizes the importance of transparency and candidness in reporting mistakes and successes to shareholders.\\n\\n2. **Mistakes and Learnings**: The letter acknowledges past mistakes in business assessments and management hires, highlighting the importance of correcting errors promptly.\\n\\n3. **CEO Succession**: Mention of Greg Abel stepping in as the new CEO and continuing the tradition of honest communication.\\n\\n4. **Pete Liegl Story**: A detailed account of acquiring Forest River and the relationship with its founder, highlighting trust and effective business decisions.\\n\\n5. **2024 Performance**: Overview of business performance, particularly in insurance and investment activities, with a focus on GEICO's improvement.\\n\\n6. **Tax Contributions**: Discussion of significant tax payments to the U.S. Treasury, credited to shareholders' reinvestments.\\n\\n7. **Investment Strategy**: A breakdown of Berkshire\\u2019s investments in both controlled subsidiaries and marketable equities, along with a focus on long-term holding strategies.\\n\\n8. **American Capitalism**: Reflections on America\\u2019s economic development and Berkshire\\u2019s role within it.\\n\\n9. **Property-Casualty Insurance**: Insights into the P/C insurance business model and its challenges and benefits.\\n\\n10. **Japanese Investments**: Information about Berkshire\\u2019s investments in Japanese companies and future plans.\\n\\n11. **Annual Meeting**: Details about the upcoming annual gathering in Omaha, including schedule changes and new book releases.\\n\\n12. **Personal Anecdotes**: Light-hearted stories about family and interactions, conveying Buffett's personable approach.\\n\\n13. **Financial Performance Data**: Tables comparing Berkshire\\u2019s annual performance to the S&P 500, showing impressive long-term gains.\\n\\nOverall, the letter reinforces Berkshire Hathaway's commitment to transparency, investment in both its businesses and the wider economy, and emphasizes strong leadership and prudent financial management.\"\n }\n ],\n \"role\": \"assistant\"\n }\n ],\n \"parallel_tool_calls\": true,\n \"previous_response_id\": null,\n \"reasoning\": {\n \"effort\": null,\n \"summary\": null\n },\n \"service_tier\": \"default\",\n \"store\": true,\n \"temperature\": 1.0,\n \ \"text\": {\n \"format\": {\n \"type\": \"text\"\n }\n },\n \"tool_choice\": \"auto\",\n \"tools\": [],\n \"top_logprobs\": 0,\n \"top_p\": 1.0,\n \"truncation\": \"disabled\",\n \"usage\": {\n \"input_tokens\": 8438,\n \"input_tokens_details\": {\n \"cached_tokens\": 0,\n \"cache_write_tokens\": 0\n },\n \"output_tokens\": 398,\n \"output_tokens_details\": {\n \"reasoning_tokens\": 0\n },\n \"total_tokens\": 8836\n },\n \"user\": null,\n \"metadata\": {}\n}\n" - title: Web search request: curl: "curl https://api.openai.com/v1/responses \\\n -H \"Content-Type: application/json\" \\\n -H \"Authorization: Bearer $OPENAI_API_KEY\" \\\n -d '{\n \"model\": \"gpt-6-astra\",\n \ \"tools\": [{ \"type\": \"web_search_preview\" }],\n \"input\": \"What was a positive news story from today?\"\n }'\n" javascript: "import OpenAI from \"openai\";\n\nconst openai = new OpenAI();\n\nconst response = await openai.responses.create({\n model: \"gpt-6-astra\",\n tools: [{ type: \"web_search_preview\" }],\n input: \"What was a positive news story from today?\",\n});\n\nconsole.log(response);\n" python: "from openai import OpenAI\n\nclient = OpenAI()\n\nresponse = client.responses.create(\n \ model=\"gpt-6-astra\",\n tools=[{ \"type\": \"web_search_preview\" }],\n input=\"What was a positive news story from today?\",\n)\n\nprint(response)\n" csharp: "using System;\n\nusing OpenAI.Responses;\n\nOpenAIResponseClient client = new(\n \ model: \"gpt-6-astra\",\n apiKey: Environment.GetEnvironmentVariable(\"OPENAI_API_KEY\")\n);\n\nstring userInputText = \"What was a positive news story from today?\";\n\nResponseCreationOptions options = new()\n{\n Tools =\n {\n ResponseTool.CreateWebSearchTool()\n },\n};\n\nOpenAIResponse response = client.CreateResponse(userInputText, options);\n\nConsole.WriteLine(response.GetOutputText());\n" response: "{\n \"id\": \"resp_67ccf18ef5fc8190b16dbee19bc54e5f087bb177ab789d5c\",\n \"object\": \"response\",\n \"created_at\": 1741484430,\n \"status\": \"completed\",\n \"completed_at\": 1741484431,\n \"error\": null,\n \"incomplete_details\": null,\n \"instructions\": null,\n \ \"max_output_tokens\": null,\n \"model\": \"gpt-6-astra\",\n \"output\": [\n {\n \"type\": \"web_search_call\",\n \"id\": \"ws_67ccf18f64008190a39b619f4c8455ef087bb177ab789d5c\",\n \ \"status\": \"completed\"\n },\n {\n \"type\": \"message\",\n \"id\": \"msg_67ccf190ca3881909d433c50b1f6357e087bb177ab789d5c\",\n \"status\": \"completed\",\n \ \"role\": \"assistant\",\n \"content\": [\n {\n \"type\": \"output_text\",\n \ \"text\": \"As of today, March 9, 2025, one notable positive news story...\",\n \ \"annotations\": [\n {\n \"type\": \"url_citation\",\n \"start_index\": 442,\n \"end_index\": 557,\n \"url\": \"https://.../?utm_source=chatgpt.com\",\n \ \"title\": \"...\"\n },\n {\n \"type\": \"url_citation\",\n \ \"start_index\": 962,\n \"end_index\": 1077,\n \"url\": \"https://.../?utm_source=chatgpt.com\",\n \"title\": \"...\"\n },\n \ {\n \"type\": \"url_citation\",\n \"start_index\": 1336,\n \ \"end_index\": 1451,\n \"url\": \"https://.../?utm_source=chatgpt.com\",\n \ \"title\": \"...\"\n }\n ]\n }\n ]\n }\n \ ],\n \"parallel_tool_calls\": true,\n \"previous_response_id\": null,\n \"reasoning\": {\n \"effort\": null,\n \"summary\": null\n },\n \"store\": true,\n \"temperature\": 1.0,\n \"text\": {\n \"format\": {\n \"type\": \"text\"\n }\n },\n \"tool_choice\": \"auto\",\n \"tools\": [\n {\n \"type\": \"web_search_preview\",\n \"domains\": [],\n \"search_context_size\": \"medium\",\n \"user_location\": {\n \"type\": \"approximate\",\n \"city\": null,\n \"country\": \"US\",\n \"region\": null,\n \"timezone\": null\n }\n }\n ],\n \"top_p\": 1.0,\n \"truncation\": \"disabled\",\n \"usage\": {\n \"input_tokens\": 328,\n \"input_tokens_details\": {\n \ \"cached_tokens\": 0,\n \"cache_write_tokens\": 0\n },\n \"output_tokens\": 356,\n \"output_tokens_details\": {\n \"reasoning_tokens\": 0\n },\n \"total_tokens\": 684\n },\n \"user\": null,\n \"metadata\": {}\n}\n" - title: File search request: curl: "curl https://api.openai.com/v1/responses \\\n -H \"Content-Type: application/json\" \\\n -H \"Authorization: Bearer $OPENAI_API_KEY\" \\\n -d '{\n \"model\": \"gpt-6-astra\",\n \ \"tools\": [{\n \"type\": \"file_search\",\n \"vector_store_ids\": [\"vs_1234567890\"],\n \ \"max_num_results\": 20\n }],\n \"input\": \"What are the attributes of an ancient brown dragon?\"\n }'\n" javascript: "import OpenAI from \"openai\";\n\nconst openai = new OpenAI();\n\nconst response = await openai.responses.create({\n model: \"gpt-6-astra\",\n tools: [{\n type: \"file_search\",\n vector_store_ids: [\"vs_1234567890\"],\n max_num_results: 20\n \ }],\n input: \"What are the attributes of an ancient brown dragon?\",\n});\n\nconsole.log(response);\n" python: "from openai import OpenAI\n\nclient = OpenAI()\n\nresponse = client.responses.create(\n \ model=\"gpt-6-astra\",\n tools=[{\n \"type\": \"file_search\",\n \"vector_store_ids\": [\"vs_1234567890\"],\n \"max_num_results\": 20\n }],\n input=\"What are the attributes of an ancient brown dragon?\",\n)\n\nprint(response)\n" csharp: "using System;\n\nusing OpenAI.Responses;\n\nOpenAIResponseClient client = new(\n \ model: \"gpt-6-astra\",\n apiKey: Environment.GetEnvironmentVariable(\"OPENAI_API_KEY\")\n);\n\nstring userInputText = \"What are the attributes of an ancient brown dragon?\";\n\nResponseCreationOptions options = new()\n{\n Tools =\n {\n ResponseTool.CreateFileSearchTool(\n vectorStoreIds: [\"vs_1234567890\"],\n maxResultCount: 20\n )\n },\n};\n\nOpenAIResponse response = client.CreateResponse(userInputText, options);\n\nConsole.WriteLine(response.GetOutputText());\n" response: "{\n \"id\": \"resp_67ccf4c55fc48190b71bd0463ad3306d09504fb6872380d7\",\n \"object\": \"response\",\n \"created_at\": 1741485253,\n \"status\": \"completed\",\n \"completed_at\": 1741485254,\n \"error\": null,\n \"incomplete_details\": null,\n \"instructions\": null,\n \ \"max_output_tokens\": null,\n \"model\": \"gpt-6-astra\",\n \"output\": [\n {\n \"type\": \"file_search_call\",\n \"id\": \"fs_67ccf4c63cd08190887ef6464ba5681609504fb6872380d7\",\n \ \"status\": \"completed\",\n \"queries\": [\n \"attributes of an ancient brown dragon\"\n ],\n \"results\": null\n },\n {\n \"type\": \"message\",\n \ \"id\": \"msg_67ccf4c93e5c81909d595b369351a9d309504fb6872380d7\",\n \"status\": \"completed\",\n \"role\": \"assistant\",\n \"content\": [\n {\n \"type\": \"output_text\",\n \"text\": \"The attributes of an ancient brown dragon include...\",\n \ \"annotations\": [\n {\n \"type\": \"file_citation\",\n \ \"index\": 320,\n \"file_id\": \"file-4wDz5b167pAf72nx1h9eiN\",\n \ \"filename\": \"dragons.pdf\"\n },\n {\n \"type\": \"file_citation\",\n \"index\": 576,\n \"file_id\": \"file-4wDz5b167pAf72nx1h9eiN\",\n \ \"filename\": \"dragons.pdf\"\n },\n {\n \"type\": \"file_citation\",\n \"index\": 815,\n \"file_id\": \"file-4wDz5b167pAf72nx1h9eiN\",\n \ \"filename\": \"dragons.pdf\"\n },\n {\n \"type\": \"file_citation\",\n \"index\": 815,\n \"file_id\": \"file-4wDz5b167pAf72nx1h9eiN\",\n \ \"filename\": \"dragons.pdf\"\n },\n {\n \"type\": \"file_citation\",\n \"index\": 1030,\n \"file_id\": \"file-4wDz5b167pAf72nx1h9eiN\",\n \ \"filename\": \"dragons.pdf\"\n },\n {\n \"type\": \"file_citation\",\n \"index\": 1030,\n \"file_id\": \"file-4wDz5b167pAf72nx1h9eiN\",\n \ \"filename\": \"dragons.pdf\"\n },\n {\n \"type\": \"file_citation\",\n \"index\": 1156,\n \"file_id\": \"file-4wDz5b167pAf72nx1h9eiN\",\n \ \"filename\": \"dragons.pdf\"\n },\n {\n \"type\": \"file_citation\",\n \"index\": 1225,\n \"file_id\": \"file-4wDz5b167pAf72nx1h9eiN\",\n \ \"filename\": \"dragons.pdf\"\n }\n ]\n }\n ]\n \ }\n ],\n \"parallel_tool_calls\": true,\n \"previous_response_id\": null,\n \"reasoning\": {\n \"effort\": null,\n \"summary\": null\n },\n \"store\": true,\n \"temperature\": 1.0,\n \"text\": {\n \"format\": {\n \"type\": \"text\"\n }\n },\n \"tool_choice\": \"auto\",\n \"tools\": [\n {\n \"type\": \"file_search\",\n \"filters\": null,\n \ \"max_num_results\": 20,\n \"ranking_options\": {\n \"ranker\": \"auto\",\n \ \"score_threshold\": 0.0\n },\n \"vector_store_ids\": [\n \"vs_1234567890\"\n \ ]\n }\n ],\n \"top_p\": 1.0,\n \"truncation\": \"disabled\",\n \"usage\": {\n \ \"input_tokens\": 18307,\n \"input_tokens_details\": {\n \"cached_tokens\": 0,\n \ \"cache_write_tokens\": 0\n },\n \"output_tokens\": 348,\n \"output_tokens_details\": {\n \"reasoning_tokens\": 0\n },\n \"total_tokens\": 18655\n },\n \"user\": null,\n \ \"metadata\": {}\n}\n" - title: Streaming request: curl: "curl https://api.openai.com/v1/responses \\\n -H \"Content-Type: application/json\" \\\n -H \"Authorization: Bearer $OPENAI_API_KEY\" \\\n -d '{\n \"model\": \"gpt-6-astra\",\n \ \"instructions\": \"You are a helpful assistant.\",\n \"input\": \"Hello!\",\n \"stream\": true\n }'\n" python: "from openai import OpenAI\n\nclient = OpenAI()\n\nresponse = client.responses.create(\n \ model=\"gpt-6-astra\",\n instructions=\"You are a helpful assistant.\",\n input=\"Hello!\",\n \ stream=True\n)\n\nfor event in response:\n print(event)\n" javascript: "import OpenAI from \"openai\";\n\nconst openai = new OpenAI();\n\nconst response = await openai.responses.create({\n model: \"gpt-6-astra\",\n instructions: \"You are a helpful assistant.\",\n input: \"Hello!\",\n stream: true,\n});\n\nfor await (const event of response) {\n console.log(event);\n}\n" csharp: "using System;\nusing System.ClientModel;\nusing System.Threading.Tasks;\n\nusing OpenAI.Responses;\n\nOpenAIResponseClient client = new(\n model: \"gpt-6-astra\",\n apiKey: Environment.GetEnvironmentVariable(\"OPENAI_API_KEY\")\n);\n\nstring userInputText = \"Hello!\";\n\nResponseCreationOptions options = new()\n{\n Instructions = \"You are a helpful assistant.\",\n};\n\nAsyncCollectionResult responseUpdates = client.CreateResponseStreamingAsync(userInputText, options);\n\nawait foreach (StreamingResponseUpdate responseUpdate in responseUpdates)\n{\n if (responseUpdate is StreamingResponseOutputTextDeltaUpdate outputTextDeltaUpdate)\n {\n Console.Write(outputTextDeltaUpdate.Delta);\n \ }\n}\n" response: 'event: response.created data: {"type":"response.created","response":{"id":"resp_67c9fdcecf488190bdd9a0409de3a1ec07b8b0ad4e5eb654","object":"response","created_at":1741290958,"status":"in_progress","error":null,"incomplete_details":null,"instructions":"You are a helpful assistant.","max_output_tokens":null,"model":"gpt-6-astra","output":[],"parallel_tool_calls":true,"previous_response_id":null,"reasoning":{"effort":null,"summary":null},"store":true,"temperature":1.0,"text":{"format":{"type":"text"}},"tool_choice":"auto","tools":[],"top_p":1.0,"truncation":"disabled","usage":null,"user":null,"metadata":{}}} event: response.in_progress data: {"type":"response.in_progress","response":{"id":"resp_67c9fdcecf488190bdd9a0409de3a1ec07b8b0ad4e5eb654","object":"response","created_at":1741290958,"status":"in_progress","error":null,"incomplete_details":null,"instructions":"You are a helpful assistant.","max_output_tokens":null,"model":"gpt-6-astra","output":[],"parallel_tool_calls":true,"previous_response_id":null,"reasoning":{"effort":null,"summary":null},"store":true,"temperature":1.0,"text":{"format":{"type":"text"}},"tool_choice":"auto","tools":[],"top_p":1.0,"truncation":"disabled","usage":null,"user":null,"metadata":{}}} event: response.output_item.added data: {"type":"response.output_item.added","output_index":0,"item":{"id":"msg_67c9fdcf37fc8190ba82116e33fb28c507b8b0ad4e5eb654","type":"message","status":"in_progress","role":"assistant","content":[]}} event: response.content_part.added data: {"type":"response.content_part.added","item_id":"msg_67c9fdcf37fc8190ba82116e33fb28c507b8b0ad4e5eb654","output_index":0,"content_index":0,"part":{"type":"output_text","text":"","annotations":[]}} event: response.output_text.delta data: {"type":"response.output_text.delta","item_id":"msg_67c9fdcf37fc8190ba82116e33fb28c507b8b0ad4e5eb654","output_index":0,"content_index":0,"delta":"Hi"} ... event: response.output_text.done data: {"type":"response.output_text.done","item_id":"msg_67c9fdcf37fc8190ba82116e33fb28c507b8b0ad4e5eb654","output_index":0,"content_index":0,"text":"Hi there! How can I assist you today?"} event: response.content_part.done data: {"type":"response.content_part.done","item_id":"msg_67c9fdcf37fc8190ba82116e33fb28c507b8b0ad4e5eb654","output_index":0,"content_index":0,"part":{"type":"output_text","text":"Hi there! How can I assist you today?","annotations":[]}} event: response.output_item.done data: {"type":"response.output_item.done","output_index":0,"item":{"id":"msg_67c9fdcf37fc8190ba82116e33fb28c507b8b0ad4e5eb654","type":"message","status":"completed","role":"assistant","content":[{"type":"output_text","text":"Hi there! How can I assist you today?","annotations":[]}]}} event: response.completed data: {"type":"response.completed","response":{"id":"resp_67c9fdcecf488190bdd9a0409de3a1ec07b8b0ad4e5eb654","object":"response","created_at":1741290958,"status":"completed","error":null,"incomplete_details":null,"instructions":"You are a helpful assistant.","max_output_tokens":null,"model":"gpt-6-astra","output":[{"id":"msg_67c9fdcf37fc8190ba82116e33fb28c507b8b0ad4e5eb654","type":"message","status":"completed","role":"assistant","content":[{"type":"output_text","text":"Hi there! How can I assist you today?","annotations":[]}]}],"parallel_tool_calls":true,"previous_response_id":null,"reasoning":{"effort":null,"summary":null},"store":true,"temperature":1.0,"text":{"format":{"type":"text"}},"tool_choice":"auto","tools":[],"top_p":1.0,"truncation":"disabled","usage":{"input_tokens":37,"output_tokens":11,"output_tokens_details":{"reasoning_tokens":0},"total_tokens":48},"user":null,"metadata":{}}} ' - title: Functions request: curl: "curl https://api.openai.com/v1/responses \\\n -H \"Content-Type: application/json\" \\\n -H \"Authorization: Bearer $OPENAI_API_KEY\" \\\n -d '{\n \"model\": \"gpt-6-astra\",\n \ \"input\": \"What is the weather like in Boston today?\",\n \"tools\": [\n {\n \ \"type\": \"function\",\n \"name\": \"get_current_weather\",\n \"description\": \"Get the current weather in a given location\",\n \"parameters\": {\n \"type\": \"object\",\n \"properties\": {\n \"location\": {\n \"type\": \"string\",\n \"description\": \"The city and state, e.g. San Francisco, CA\"\n \ },\n \"unit\": {\n \"type\": \"string\",\n \"enum\": [\"celsius\", \"fahrenheit\"]\n }\n },\n \"required\": [\"location\", \"unit\"]\n }\n }\n ],\n \"tool_choice\": \"auto\"\n }'\n" python: "from openai import OpenAI\n\nclient = OpenAI()\n\ntools = [\n {\n \"type\": \"function\",\n \"name\": \"get_current_weather\",\n \"description\": \"Get the current weather in a given location\",\n \"parameters\": {\n \"type\": \"object\",\n \"properties\": {\n \"location\": {\n \"type\": \"string\",\n \"description\": \"The city and state, e.g. San Francisco, CA\",\n },\n \"unit\": {\"type\": \"string\", \"enum\": [\"celsius\", \"fahrenheit\"]},\n },\n \"required\": [\"location\", \"unit\"],\n }\n \ }\n]\n\nresponse = client.responses.create(\n model=\"gpt-6-astra\",\n tools=tools,\n \ input=\"What is the weather like in Boston today?\",\n tool_choice=\"auto\"\n)\n\nprint(response)\n" javascript: "import OpenAI from \"openai\";\n\nconst openai = new OpenAI();\n\nconst tools = [\n {\n type: \"function\",\n name: \"get_current_weather\",\n description: \"Get the current weather in a given location\",\n parameters: {\n type: \"object\",\n properties: {\n location: {\n type: \"string\",\n description: \"The city and state, e.g. San Francisco, CA\",\n },\n unit: { type: \"string\", enum: [\"celsius\", \"fahrenheit\"] },\n },\n required: [\"location\", \"unit\"],\n },\n \ },\n];\n\nconst response = await openai.responses.create({\n model: \"gpt-6-astra\",\n \ tools: tools,\n input: \"What is the weather like in Boston today?\",\n tool_choice: \"auto\",\n});\n\nconsole.log(response);\n" csharp: "using System;\nusing OpenAI.Responses;\n\nOpenAIResponseClient client = new(\n model: \"gpt-6-astra\",\n apiKey: Environment.GetEnvironmentVariable(\"OPENAI_API_KEY\")\n);\n\nResponseTool getCurrentWeatherFunctionTool = ResponseTool.CreateFunctionTool(\n functionName: \"get_current_weather\",\n \ functionDescription: \"Get the current weather in a given location\",\n functionParameters: BinaryData.FromString(\"\"\"\n {\n \"type\": \"object\",\n \"properties\": {\n \"location\": {\n \"type\": \"string\",\n \"description\": \"The city and state, e.g. San Francisco, CA\"\n },\n \"unit\": {\"type\": \"string\", \"enum\": [\"celsius\", \"fahrenheit\"]}\n },\n \"required\": [\"location\", \"unit\"]\n }\n \"\"\"\n )\n);\n\nstring userInputText = \"What is the weather like in Boston today?\";\n\nResponseCreationOptions options = new()\n{\n \ Tools =\n {\n getCurrentWeatherFunctionTool\n },\n ToolChoice = ResponseToolChoice.CreateAutoChoice(),\n};\n\nOpenAIResponse response = client.CreateResponse(userInputText, options);\n" response: "{\n \"id\": \"resp_67ca09c5efe0819096d0511c92b8c890096610f474011cc0\",\n \"object\": \"response\",\n \"created_at\": 1741294021,\n \"status\": \"completed\",\n \"completed_at\": 1741294022,\n \"error\": null,\n \"incomplete_details\": null,\n \"instructions\": null,\n \ \"max_output_tokens\": null,\n \"model\": \"gpt-6-astra\",\n \"output\": [\n {\n \"type\": \"function_call\",\n \"id\": \"fc_67ca09c6bedc8190a7abfec07b1a1332096610f474011cc0\",\n \ \"call_id\": \"call_unLAR8MvFNptuiZK6K6HCy5k\",\n \"name\": \"get_current_weather\",\n \ \"arguments\": \"{\\\"location\\\":\\\"Boston, MA\\\",\\\"unit\\\":\\\"celsius\\\"}\",\n \ \"status\": \"completed\"\n }\n ],\n \"parallel_tool_calls\": true,\n \"previous_response_id\": null,\n \"reasoning\": {\n \"effort\": null,\n \"summary\": null\n },\n \"store\": true,\n \"temperature\": 1.0,\n \"text\": {\n \"format\": {\n \"type\": \"text\"\n \ }\n },\n \"tool_choice\": \"auto\",\n \"tools\": [\n {\n \"type\": \"function\",\n \ \"description\": \"Get the current weather in a given location\",\n \"name\": \"get_current_weather\",\n \ \"parameters\": {\n \"type\": \"object\",\n \"properties\": {\n \"location\": {\n \"type\": \"string\",\n \"description\": \"The city and state, e.g. San Francisco, CA\"\n },\n \"unit\": {\n \"type\": \"string\",\n \ \"enum\": [\n \"celsius\",\n \"fahrenheit\"\n ]\n \ }\n },\n \"required\": [\n \"location\",\n \"unit\"\n \ ]\n },\n \"strict\": true\n }\n ],\n \"top_p\": 1.0,\n \"truncation\": \"disabled\",\n \"usage\": {\n \"input_tokens\": 291,\n \"output_tokens\": 23,\n \"output_tokens_details\": {\n \"reasoning_tokens\": 0\n },\n \"total_tokens\": 314\n },\n \"user\": null,\n \ \"metadata\": {}\n}\n" - title: Reasoning request: curl: "curl https://api.openai.com/v1/responses \\\n -H \"Content-Type: application/json\" \\\n -H \"Authorization: Bearer $OPENAI_API_KEY\" \\\n -d '{\n \"model\": \"gpt-6-astra\",\n \ \"input\": \"How much wood would a woodchuck chuck?\",\n \"reasoning\": {\n \"effort\": \"high\"\n }\n }'\n" javascript: "import OpenAI from \"openai\";\nconst openai = new OpenAI();\n\nconst response = await openai.responses.create({\n model: \"gpt-6-astra\",\n input: \"How much wood would a woodchuck chuck?\",\n reasoning: {\n effort: \"high\"\n }\n});\n\nconsole.log(response);\n" python: "from openai import OpenAI\nclient = OpenAI()\n\nresponse = client.responses.create(\n \ model=\"gpt-6-astra\",\n input=\"How much wood would a woodchuck chuck?\",\n reasoning={\n \ \"effort\": \"high\"\n }\n)\n\nprint(response)\n" csharp: "using System;\nusing OpenAI.Responses;\n\nOpenAIResponseClient client = new(\n model: \"gpt-6-astra\",\n apiKey: Environment.GetEnvironmentVariable(\"OPENAI_API_KEY\")\n);\n\nstring userInputText = \"How much wood would a woodchuck chuck?\";\n\nResponseCreationOptions options = new()\n{\n ReasoningOptions = new()\n {\n ReasoningEffortLevel = ResponseReasoningEffortLevel.High,\n \ },\n};\n\nOpenAIResponse response = client.CreateResponse(userInputText, options);\n\nConsole.WriteLine(response.GetOutputText());\n" response: "{\n \"id\": \"resp_67ccd7eca01881908ff0b5146584e408072912b2993db808\",\n \"object\": \"response\",\n \"created_at\": 1741477868,\n \"status\": \"completed\",\n \"completed_at\": 1741477869,\n \"error\": null,\n \"incomplete_details\": null,\n \"instructions\": null,\n \ \"max_output_tokens\": null,\n \"model\": \"gpt-6-astra\",\n \"output\": [\n {\n \"type\": \"message\",\n \"id\": \"msg_67ccd7f7b5848190a6f3e95d809f6b44072912b2993db808\",\n \"status\": \"completed\",\n \"role\": \"assistant\",\n \"content\": [\n {\n \"type\": \"output_text\",\n \"text\": \"The classic tongue twister...\",\n \"annotations\": []\n }\n ]\n }\n ],\n \"parallel_tool_calls\": true,\n \"previous_response_id\": null,\n \"reasoning\": {\n \"effort\": \"high\",\n \"summary\": null\n },\n \"store\": true,\n \"temperature\": 1.0,\n \"text\": {\n \"format\": {\n \"type\": \"text\"\n \ }\n },\n \"tool_choice\": \"auto\",\n \"tools\": [],\n \"top_p\": 1.0,\n \"truncation\": \"disabled\",\n \"usage\": {\n \"input_tokens\": 81,\n \"input_tokens_details\": {\n \ \"cached_tokens\": 0,\n \"cache_write_tokens\": 0\n },\n \"output_tokens\": 1035,\n \"output_tokens_details\": {\n \"reasoning_tokens\": 832\n },\n \"total_tokens\": 1116\n },\n \"user\": null,\n \"metadata\": {}\n}\n" x-tier: extended /responses/{response_id}: get: operationId: getResponse tags: - Responses summary: Get a model response description: 'Retrieves a model response with the given ID. ' parameters: - in: path name: response_id required: true schema: type: string example: resp_677efb5139a88190b512bc3fef8e535d description: The ID of the response to retrieve. - in: query name: include schema: type: array items: $ref: '#/components/schemas/IncludeEnum' description: 'Additional fields to include in the response. See the `include` parameter for Response creation above for more information. ' - in: query name: stream schema: type: boolean description: 'If set to true, the model response data will be streamed to the client as it is generated using [server-sent events](https://developer.mozilla.org/en-US/docs/Web/API/Server-sent_events/Using_server-sent_events#Event_stream_format). See the [Streaming section below](https://developers.openai.com/api/reference/resources/responses/streaming-events) for more information. ' - in: query name: starting_after schema: type: integer description: 'The sequence number of the event after which to start streaming. ' - in: query name: include_obfuscation schema: type: boolean description: 'When true, stream obfuscation will be enabled. Stream obfuscation adds random characters to an `obfuscation` field on streaming delta events to normalize payload sizes as a mitigation to certain side-channel attacks. These obfuscation fields are included by default, but add a small amount of overhead to the data stream. You can set `include_obfuscation` to false to optimize for bandwidth if you trust the network links between your application and the OpenAI API. ' responses: '200': description: OK content: application/json: schema: $ref: '#/components/schemas/Response' '429': $ref: '#/components/responses/TooManyRequests' x-oaiMeta: group: responses examples: request: curl: "curl https://api.openai.com/v1/responses/resp_123 \\\n -H \"Content-Type: application/json\" \\\n -H \"Authorization: Bearer $OPENAI_API_KEY\"\n" javascript: 'import OpenAI from "openai"; const client = new OpenAI(); const response = await client.responses.retrieve("resp_123"); console.log(response); ' python: 'from openai import OpenAI client = OpenAI() response = client.responses.retrieve("resp_123") print(response) ' response: "{\n \"id\": \"resp_67cb71b351908190a308f3859487620d06981a8637e6bc44\",\n \"object\": \"response\",\n \"created_at\": 1741386163,\n \"status\": \"completed\",\n \"completed_at\": 1741386164,\n \"error\": null,\n \"incomplete_details\": null,\n \"instructions\": null,\n \ \"max_output_tokens\": null,\n \"model\": \"gpt-6-astra\",\n \"output\": [\n {\n \"type\": \"message\",\n \"id\": \"msg_67cb71b3c2b0819084d481baaaf148f206981a8637e6bc44\",\n \"status\": \"completed\",\n \"role\": \"assistant\",\n \"content\": [\n {\n \"type\": \"output_text\",\n \"text\": \"Silent circuits hum, \\nThoughts emerge in data streams— \ \\nDigital dawn breaks.\",\n \"annotations\": []\n }\n ]\n }\n ],\n \ \"parallel_tool_calls\": true,\n \"previous_response_id\": null,\n \"reasoning\": {\n \ \"effort\": null,\n \"summary\": null\n },\n \"store\": true,\n \"temperature\": 1.0,\n \"text\": {\n \"format\": {\n \"type\": \"text\"\n }\n },\n \"tool_choice\": \"auto\",\n \"tools\": [],\n \"top_p\": 1.0,\n \"truncation\": \"disabled\",\n \"usage\": {\n \"input_tokens\": 32,\n \"input_tokens_details\": {\n \"cached_tokens\": 0,\n \ \"cache_write_tokens\": 0\n },\n \"output_tokens\": 18,\n \"output_tokens_details\": {\n \"reasoning_tokens\": 0\n },\n \"total_tokens\": 50\n },\n \"user\": null,\n \ \"metadata\": {}\n}\n" x-tier: extended delete: operationId: deleteResponse tags: - Responses summary: Delete a model response description: 'Deletes a model response with the given ID. ' parameters: - in: path name: response_id required: true schema: type: string example: resp_677efb5139a88190b512bc3fef8e535d description: The ID of the response to delete. responses: '200': description: OK '404': description: Not Found content: application/json: schema: $ref: '#/components/schemas/Error' '429': $ref: '#/components/responses/TooManyRequests' x-oaiMeta: group: responses examples: request: curl: "curl -X DELETE https://api.openai.com/v1/responses/resp_123 \\\n -H \"Content-Type: application/json\" \\\n -H \"Authorization: Bearer $OPENAI_API_KEY\"\n" javascript: 'import OpenAI from "openai"; const client = new OpenAI(); const response = await client.responses.delete("resp_123"); console.log(response); ' python: 'from openai import OpenAI client = OpenAI() response = client.responses.delete("resp_123") print(response) ' response: "{\n \"id\": \"resp_6786a1bec27481909a17d673315b29f6\",\n \"object\": \"response\",\n \ \"deleted\": true\n}\n" x-tier: vendor components: schemas: ProgrammaticToolCallingParam: properties: type: type: string enum: - programmatic_tool_calling description: The type of the tool. Always `programmatic_tool_calling`. default: programmatic_tool_calling x-stainless-const: true type: object required: - type BatchFileExpirationAfter: type: object title: File expiration policy description: The expiration policy for the output and/or error file that are generated for a batch. properties: anchor: description: 'Anchor timestamp after which the expiration policy applies. Supported anchors: `created_at`. Note that the anchor is the file creation time, not the time the batch is created.' type: string enum: - created_at x-stainless-const: true seconds: description: The number of seconds after the anchor time that the file will expire. Must be between 3600 (1 hour) and 2592000 (30 days). type: integer format: int64 minimum: 3600 maximum: 2592000 required: - anchor - seconds ChatCompletionStreamOptions: anyOf: - description: 'Options for streaming response. Only set this when you set `stream: true`. ' type: object default: null properties: include_usage: type: boolean description: 'If set, an additional chunk will be streamed before the `data: [DONE]` message. The `usage` field on this chunk shows the token usage statistics for the entire request, and the `choices` field will always be an empty array. All other chunks will also include a `usage` field, but with a null value. **NOTE:** If the stream is interrupted, you may not receive the final usage chunk which contains the total token usage for the request. ' include_obfuscation: type: boolean description: 'When true, stream obfuscation will be enabled. Stream obfuscation adds random characters to an `obfuscation` field on streaming delta events to normalize payload sizes as a mitigation to certain side-channel attacks. These obfuscation fields are included by default, but add a small amount of overhead to the data stream. You can set `include_obfuscation` to false to optimize for bandwidth if you trust the network links between your application and the OpenAI API. ' - type: 'null' ImageOutputFormat: type: string enum: - png - webp - jpeg ResponseFileSearchCallSearchingEvent: type: object description: Emitted when a file search is currently searching. properties: type: type: string description: 'The type of the event. Always `response.file_search_call.searching`. ' enum: - response.file_search_call.searching x-stainless-const: true output_index: type: integer description: 'The index of the output item that the file search call is searching. ' item_id: type: string description: 'The ID of the output item that the file search call is initiated. ' sequence_number: type: integer description: The sequence number of this event. required: - type - output_index - item_id - sequence_number x-oaiMeta: name: response.file_search_call.searching group: responses example: "{\n \"type\": \"response.file_search_call.searching\",\n \"output_index\": 0,\n \"item_id\": \"fs_123\",\n \"sequence_number\": 1\n}\n" LocalSkillParam: properties: name: type: string description: The name of the skill. description: type: string description: The description of the skill. path: type: string description: The path to the directory containing the skill. type: object required: - name - description - path ModerationConfigParam: properties: mode: $ref: '#/components/schemas/ModerationMode' type: object required: - mode description: The moderation policy for the response input. MCPToolFilter: type: object title: MCP tool filter description: 'A filter object to specify which tools are allowed. ' properties: tool_names: type: array title: MCP allowed tools items: type: string description: List of allowed tool names. read_only: type: boolean description: 'Indicates whether or not a tool modifies data or is read-only. If an MCP server is [annotated with `readOnlyHint`](https://modelcontextprotocol.io/specification/2025-06-18/schema#toolannotations-readonlyhint), it will match this filter. ' required: [] additionalProperties: false FunctionShellCallOutputItemParam: properties: id: anyOf: - type: string description: The unique ID of the shell tool call output. Populated when this item is returned via API. example: sho_123 - type: 'null' call_id: type: string maxLength: 64 minLength: 1 description: The unique ID of the shell tool call generated by the model. caller: anyOf: - $ref: '#/components/schemas/ToolCallCallerParam' description: The execution context that produced this tool call. - type: 'null' type: type: string enum: - shell_call_output description: The type of the item. Always `shell_call_output`. default: shell_call_output x-stainless-const: true output: items: $ref: '#/components/schemas/FunctionShellCallOutputContentParam' type: array description: Captured chunks of stdout and stderr output, along with their associated outcomes. status: anyOf: - $ref: '#/components/schemas/FunctionShellCallItemStatus' description: The status of the shell call output. - type: 'null' max_output_length: anyOf: - type: integer description: The maximum number of UTF-8 characters captured for this shell call's combined output. - type: 'null' type: object required: - call_id - type - output title: Shell tool call output description: The streamed output items emitted by a shell tool call. ToolChoiceMCP: type: object title: MCP tool description: 'Use this option to force the model to call a specific tool on a remote MCP server. ' properties: type: type: string enum: - mcp description: For MCP tools, the type is always `mcp`. x-stainless-const: true server_label: type: string description: 'The label of the MCP server to use. ' name: anyOf: - type: string description: 'The name of the tool to call on the server. ' - type: 'null' required: - type - server_label ToolSearchToolParam: properties: type: type: string enum: - tool_search description: The type of the tool. Always `tool_search`. default: tool_search x-stainless-const: true execution: $ref: '#/components/schemas/ToolSearchExecutionType' description: Whether tool search is executed by the server or by the client. description: anyOf: - type: string description: Description shown to the model for a client-executed tool search tool. - type: 'null' parameters: anyOf: - $ref: '#/components/schemas/EmptyModelParam' description: Parameter schema for a client-executed tool search tool. - type: 'null' type: object required: - type title: Tool search tool description: Hosted or BYOT tool search configuration for deferred tools. ChatCompletionToolChoiceOption: description: 'Controls which (if any) tool is called by the model. `none` means the model will not call any tool and instead generates a message. `auto` means the model can pick between generating a message or calling one or more tools. `required` means the model must call one or more tools. Specifying a particular tool via `{"type": "function", "function": {"name": "my_function"}}` forces the model to call that tool. `none` is the default when no tools are present. `auto` is the default if tools are present. ' oneOf: - type: string title: Tool choice mode description: '`none` means the model will not call any tool and instead generates a message. `auto` means the model can pick between generating a message or calling one or more tools. `required` means the model must call one or more tools. ' enum: - none - auto - required - $ref: '#/components/schemas/ChatCompletionAllowedToolsChoice' - $ref: '#/components/schemas/ChatCompletionNamedToolChoice' - $ref: '#/components/schemas/ChatCompletionNamedToolChoiceCustom' ResponseImageGenCallPartialImageEvent: type: object title: ResponseImageGenCallPartialImageEvent description: 'Emitted when a partial image is available during image generation streaming. ' properties: type: type: string enum: - response.image_generation_call.partial_image description: The type of the event. Always 'response.image_generation_call.partial_image'. x-stainless-const: true output_index: type: integer description: The index of the output item in the response's output array. item_id: type: string description: The unique identifier of the image generation item being processed. sequence_number: type: integer description: The sequence number of the image generation item being processed. partial_image_index: type: integer description: 0-based index for the partial image (backend is 1-based, but this is 0-based for the user). partial_image_b64: type: string description: Base64-encoded partial image data, suitable for rendering as an image. size: type: string description: The image size that was used. quality: type: string description: The image quality that was used. background: type: string description: The background setting that was used. output_format: type: string description: The output format that was used. required: - type - output_index - item_id - sequence_number - partial_image_index - partial_image_b64 x-oaiMeta: name: response.image_generation_call.partial_image group: responses example: "{\n \"type\": \"response.image_generation_call.partial_image\",\n \"output_index\": 0,\n \"item_id\": \"item-123\",\n \"sequence_number\": 0,\n \"partial_image_index\": 0,\n \ \"partial_image_b64\": \"...\"\n}\n" ResponseShellCallCommandDoneStreamingEvent: properties: type: type: string enum: - response.shell_call_command.done description: The type of the event, always `response.shell_call_command.done`. default: response.shell_call_command.done x-stainless-const: true 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 updated. command_index: type: integer description: The index of the shell command that was completed. command: type: string description: The final shell command that was emitted. type: object required: - type - sequence_number - output_index - command_index - command title: Response shell command done event description: A streaming event that indicated a shell command was completed. CustomToolCall: type: object title: Custom tool call description: 'A call to a custom tool created by the model. ' properties: type: type: string enum: - custom_tool_call x-stainless-const: true description: 'The type of the custom tool call. Always `custom_tool_call`. ' id: type: string description: 'The unique ID of the custom tool call in the OpenAI platform. ' call_id: type: string description: 'An identifier used to map this custom tool call to a tool call output. ' caller: anyOf: - $ref: '#/components/schemas/ToolCallCaller' - type: 'null' namespace: type: string description: 'The namespace of the custom tool being called. ' name: type: string description: 'The name of the custom tool being called. ' input: type: string description: 'The input for the custom tool call generated by the model. ' async: type: boolean description: 'Whether the custom tool call runs asynchronously. ' required: - type - call_id - name - input Tool: description: 'A tool that can be used to generate a response. ' discriminator: propertyName: type oneOf: - $ref: '#/components/schemas/FunctionTool' - $ref: '#/components/schemas/FileSearchTool' - $ref: '#/components/schemas/ComputerTool' - $ref: '#/components/schemas/ComputerUsePreviewTool' - $ref: '#/components/schemas/WebSearchTool' - $ref: '#/components/schemas/MCPTool' - $ref: '#/components/schemas/CodeInterpreterTool' - $ref: '#/components/schemas/ProgrammaticToolCallingParam' - $ref: '#/components/schemas/ImageGenTool' - $ref: '#/components/schemas/LocalShellToolParam' - $ref: '#/components/schemas/FunctionShellToolParam' - $ref: '#/components/schemas/CustomToolParam' - $ref: '#/components/schemas/NamespaceToolParam' - $ref: '#/components/schemas/ToolSearchToolParam' - $ref: '#/components/schemas/WebSearchPreviewTool' - $ref: '#/components/schemas/ApplyPatchToolParam' WebSearchActionFind: type: object title: Find action description: 'Action type "find_in_page": Searches for a pattern within a loaded page. ' properties: type: type: string enum: - find_in_page description: 'The action type. ' x-stainless-const: true url: type: string format: uri description: 'The URL of the page searched for the pattern. ' pattern: type: string description: 'The pattern or text to search for within the page. ' required: - type - url - pattern ResponseErrorEvent: type: object description: Emitted when an error occurs. properties: type: type: string description: 'The type of the event. Always `error`. ' enum: - error x-stainless-const: true code: anyOf: - type: string description: 'The error code. ' - type: 'null' message: type: string description: 'The error message. ' param: anyOf: - type: string description: 'The error parameter. ' - type: 'null' sequence_number: type: integer description: The sequence number of this event. required: - type - code - message - param - sequence_number x-oaiMeta: name: error group: responses example: "{\n \"type\": \"error\",\n \"code\": \"ERR_SOMETHING\",\n \"message\": \"Something went wrong\",\n \"param\": null,\n \"sequence_number\": 1\n}\n" ResponseCodeInterpreterCallCodeDoneEvent: type: object description: Emitted when the code snippet is finalized by the code interpreter. properties: type: type: string description: The type of the event. Always `response.code_interpreter_call_code.done`. enum: - response.code_interpreter_call_code.done x-stainless-const: true output_index: type: integer description: The index of the output item in the response for which the code is finalized. item_id: type: string description: The unique identifier of the code interpreter tool call item. code: type: string description: The final code snippet output by the code interpreter. sequence_number: type: integer description: The sequence number of this event, used to order streaming events. required: - type - output_index - item_id - code - sequence_number x-oaiMeta: name: response.code_interpreter_call_code.done group: responses example: "{\n \"type\": \"response.code_interpreter_call_code.done\",\n \"output_index\": 3,\n \ \"item_id\": \"ci_12345\",\n \"code\": \"print('done')\",\n \"sequence_number\": 1\n}\n" CreateChatCompletionStreamResponse: type: object description: 'Represents a streamed chunk of a chat completion response returned by the model, based on the provided input. [Learn more](https://developers.openai.com/api/docs/guides/streaming-responses). ' properties: id: type: string description: A unique identifier for the chat completion. Each chunk has the same ID. choices: type: array description: 'A list of chat completion choices. Can contain more than one elements if `n` is greater than 1. Can also be empty for the last chunk if you set `stream_options: {"include_usage": true}`. ' items: type: object required: - delta - finish_reason - index properties: delta: $ref: '#/components/schemas/ChatCompletionStreamResponseDelta' logprobs: description: Log probability information for the choice. type: object nullable: true properties: content: description: A list of message content tokens with log probability information. type: array items: $ref: '#/components/schemas/ChatCompletionTokenLogprob' nullable: true refusal: description: A list of message refusal tokens with log probability information. type: array items: $ref: '#/components/schemas/ChatCompletionTokenLogprob' nullable: true required: - content - refusal finish_reason: type: string description: 'The reason the model stopped generating tokens. This will be `stop` if the model hit a natural stop point or a provided stop sequence, `length` if the maximum number of tokens specified in the request was reached, `content_filter` if content was omitted due to a flag from our content filters, `tool_calls` if the model called a tool, or `function_call` (deprecated) if the model called a function. ' enum: - stop - length - tool_calls - content_filter - function_call nullable: true index: type: integer description: The index of the choice in the list of choices. created: type: integer format: unixtime description: The Unix timestamp (in seconds) of when the chat completion was created. Each chunk has the same timestamp. model: type: string description: The model to generate the completion. obfuscation: type: string description: 'An obfuscation string added to normalize the size of streamed chunks as a mitigation to certain side-channel attacks. The field is included by default and omitted when `stream_options.include_obfuscation` is `false`. ' service_tier: $ref: '#/components/schemas/ServiceTier' system_fingerprint: type: string deprecated: true description: 'This fingerprint represents the backend configuration that the model runs with. Can be used in conjunction with the `seed` request parameter to understand when backend changes have been made that might impact determinism. ' object: type: string description: The object type, which is always `chat.completion.chunk`. enum: - chat.completion.chunk x-stainless-const: true usage: $ref: '#/components/schemas/CompletionUsage' nullable: true description: 'An optional field that will only be present when you set `stream_options: {"include_usage": true}` in your request. When present, it contains a null value **except for the last chunk** which contains the token usage statistics for the entire request. **NOTE:** If the stream is interrupted or cancelled, you may not receive the final usage chunk which contains the total token usage for the request. ' moderation: anyOf: - $ref: '#/components/schemas/ChatCompletionModeration' description: 'Moderation results for the request input and generated output. Present on the moderation chunk when moderated completions are requested. ' - type: 'null' required: - choices - created - id - model - object x-oaiMeta: name: The chat completion chunk object group: chat example: '{"id":"chatcmpl-123","object":"chat.completion.chunk","created":1694268190,"model":"gpt-6-astra", "system_fingerprint": "fp_44709d6fcb", "choices":[{"index":0,"delta":{"role":"assistant","content":""},"logprobs":null,"finish_reason":null}],"obfuscation":"r4N7vQ2m"} {"id":"chatcmpl-123","object":"chat.completion.chunk","created":1694268190,"model":"gpt-6-astra", "system_fingerprint": "fp_44709d6fcb", "choices":[{"index":0,"delta":{"content":"Hello"},"logprobs":null,"finish_reason":null}],"obfuscation":"p9K3xT6w"} .... {"id":"chatcmpl-123","object":"chat.completion.chunk","created":1694268190,"model":"gpt-6-astra", "system_fingerprint": "fp_44709d6fcb", "choices":[{"index":0,"delta":{},"logprobs":null,"finish_reason":"stop"}],"obfuscation":""} ' ProgramToolCallCaller: properties: type: type: string enum: - program default: program x-stainless-const: true caller_id: type: string description: The call ID of the program item that produced this tool call. type: object required: - type - caller_id Model: title: Model description: Describes an OpenAI model offering that can be used with the API. properties: id: type: string description: The model identifier, which can be referenced in the API endpoints. created: type: integer format: unixtime description: The Unix timestamp (in seconds) when the model was created. object: type: string description: The object type, which is always "model". enum: - model x-stainless-const: true owned_by: type: string description: The organization that owns the model. shutdown_date: anyOf: - type: string format: date - type: 'null' description: The date when the model will shut down, or null if not announced. required: - id - object - created - owned_by x-oaiMeta: name: The model object example: "{\n \"id\": \"gpt-6-astra\",\n \"object\": \"model\",\n \"created\": 1686935002,\n \ \"owned_by\": \"openai\",\n \"shutdown_date\": \"2026-10-23\"\n}\n" ProgramOutput: properties: type: type: string enum: - program_output description: The type of the item. Always `program_output`. default: program_output x-stainless-const: true id: type: string description: The unique ID of the program output item. call_id: type: string description: The call ID of the program item. result: type: string description: The result produced by the program item. status: $ref: '#/components/schemas/ProgramOutputStatus' description: The terminal status of the program output item. type: object required: - type - id - call_id - result - status TranscriptTextDeltaEvent: type: object description: Emitted when there is an additional text delta. This is also the first event emitted when the transcription starts. Only emitted when you [create a transcription](https://developers.openai.com/api/reference/resources/audio/subresources/transcriptions/methods/create) with the `Stream` parameter set to `true`. properties: type: type: string description: 'The type of the event. Always `transcript.text.delta`. ' enum: - transcript.text.delta x-stainless-const: true delta: type: string description: 'The text delta that was additionally transcribed. ' logprobs: type: array description: 'The log probabilities of the delta. Only included if you [create a transcription](https://developers.openai.com/api/reference/resources/audio/subresources/transcriptions/methods/create) with the `include[]` parameter set to `logprobs`. ' items: type: object properties: token: type: string description: 'The token that was used to generate the log probability. ' logprob: type: number description: 'The log probability of the token. ' bytes: type: array items: type: integer description: 'The bytes that were used to generate the log probability. ' segment_id: type: string description: 'Identifier of the diarized segment that this delta belongs to. Only present when using `gpt-4o-transcribe-diarize`. ' required: - type - delta x-oaiMeta: name: Stream Event (transcript.text.delta) group: transcript example: "{\n \"type\": \"transcript.text.delta\",\n \"delta\": \" wonderful\"\n}\n" ContainerFileCitationBody: properties: type: type: string enum: - container_file_citation description: The type of the container file citation. Always `container_file_citation`. default: container_file_citation x-stainless-const: true container_id: type: string description: The ID of the container file. file_id: type: string description: The ID of the file. start_index: type: integer description: The index of the first character of the container file citation in the message. end_index: type: integer description: The index of the last character of the container file citation in the message. filename: type: string description: The filename of the container file cited. type: object required: - type - container_id - file_id - start_index - end_index - filename title: Container file citation description: A citation for a container file used to generate a model response. ApplyPatchCallOutputStatus: type: string enum: - completed - failed ResponsePromptCacheOptionsParam: properties: ttl: $ref: '#/components/schemas/PromptCacheTTLEnum' description: The minimum lifetime applied to every implicit and explicit cache breakpoint written by the request. Defaults to `30m`, which is currently the only supported value. The backend may retain cache entries for longer. mode: $ref: '#/components/schemas/PromptCacheModeEnum' description: Controls whether OpenAI automatically creates an implicit cache breakpoint. Defaults to `implicit`. With `implicit`, OpenAI creates one implicit breakpoint and writes up to the latest three explicit breakpoints in the request. With `explicit`, OpenAI does not create an implicit breakpoint and writes up to the latest four explicit breakpoints. If there are no explicit breakpoints, the request does not use prompt caching. comparison_response_id: anyOf: - type: string description: The ID of a response to compare when diagnosing prompt cache reuse. Supplying this field requests prompt cache diagnostics when the feature is enabled. example: resp_123 - type: 'null' type: object required: [] title: Prompt cache options description: Options for prompt caching. Supported for `gpt-5.6` and later models. By default, OpenAI automatically chooses one implicit cache breakpoint. You can add explicit breakpoints to content blocks with `prompt_cache_breakpoint`. Each request can write up to four breakpoints. For cache matching, OpenAI considers up to the latest 80 breakpoints in the conversation, without a content-block lookback limit. Set `mode` to `explicit` to disable the implicit breakpoint. The `ttl` defaults to `30m`, which is currently the only supported value. See the [prompt caching guide](https://developers.openai.com/api/docs/guides/prompt-caching) for current details. ApplyPatchUpdateFileOperation: properties: type: type: string enum: - update_file description: Update an existing file with the provided diff. default: update_file x-stainless-const: true path: type: string description: Path of the file to update. diff: type: string description: Diff to apply. type: object required: - type - path - diff title: Apply patch update file operation description: Instruction describing how to update a file via the apply_patch tool. ClickButtonType: type: string enum: - left - right - wheel - back - forward ContextManagementParam: properties: type: type: string description: The context management entry type. Currently only 'compaction' is supported. compact_threshold: anyOf: - type: integer minimum: 1000 description: Token threshold at which compaction should be triggered for this entry. - type: 'null' type: object required: - type ResponseUsage: type: object description: 'Represents token usage details including input tokens, output tokens, a breakdown of output tokens, and the total tokens used. ' properties: input_tokens: type: integer description: The number of input tokens. input_tokens_details: type: object description: A detailed breakdown of the input tokens. properties: cached_tokens: type: integer description: 'The number of tokens that were retrieved from the cache. [More on prompt caching](https://developers.openai.com/api/docs/guides/prompt-caching). ' cache_write_tokens: type: integer description: The number of input tokens that were written to the cache. required: - cached_tokens - cache_write_tokens output_tokens: type: integer description: The number of output tokens. output_tokens_details: type: object description: A detailed breakdown of the output tokens. properties: reasoning_tokens: type: integer description: The number of reasoning tokens. required: - reasoning_tokens total_tokens: type: integer description: The total number of tokens used. required: - input_tokens - input_tokens_details - output_tokens - output_tokens_details - total_tokens MCPApprovalResponseResource: type: object title: MCP approval response description: 'A response to an MCP approval request. ' properties: type: type: string enum: - mcp_approval_response description: 'The type of the item. Always `mcp_approval_response`. ' x-stainless-const: true id: type: string description: 'The unique ID of the approval response ' approval_request_id: type: string description: 'The ID of the approval request being answered. ' approve: type: boolean description: 'Whether the request was approved. ' reason: anyOf: - type: string description: 'Optional reason for the decision. ' - type: 'null' required: - type - id - request_id - approve - approval_request_id Moderation: properties: input: oneOf: - $ref: '#/components/schemas/ModerationResultBody' - $ref: '#/components/schemas/ModerationErrorBody' description: Moderation for the response input. discriminator: propertyName: type output: oneOf: - $ref: '#/components/schemas/ModerationResultBody' - $ref: '#/components/schemas/ModerationErrorBody' description: Moderation for the response output. discriminator: propertyName: type type: object required: - input - output title: Moderation description: Moderation results or errors for the response input and output. CompactionSummaryItemParam: properties: id: anyOf: - type: string description: The ID of the compaction item. example: cmp_123 - type: 'null' type: type: string enum: - compaction description: The type of the item. Always `compaction`. default: compaction x-stainless-const: true encrypted_content: type: string maxLength: 20971520 description: The encrypted content of the compaction summary. type: object required: - type - encrypted_content title: Compaction item description: A compaction item generated by the [`v1/responses/compact` API](https://developers.openai.com/api/reference/resources/responses/methods/compact). ProgramOutputItemParam: properties: id: type: string description: The unique ID of this program output item. example: cmo_123 type: type: string enum: - program_output description: The item type. Always `program_output`. default: program_output x-stainless-const: true call_id: type: string maxLength: 64 minLength: 1 description: The call ID of the program item. result: type: string maxLength: 10485760 description: The result produced by the program item. status: $ref: '#/components/schemas/ProgramOutputItemStatus' description: The terminal status of the program output. type: object required: - id - type - call_id - result - status ResponseCodeInterpreterCallInterpretingEvent: type: object description: Emitted when the code interpreter is actively interpreting the code snippet. properties: type: type: string description: The type of the event. Always `response.code_interpreter_call.interpreting`. enum: - response.code_interpreter_call.interpreting x-stainless-const: true output_index: type: integer description: The index of the output item in the response for which the code interpreter is interpreting code. item_id: type: string description: The unique identifier of the code interpreter tool call item. sequence_number: type: integer description: The sequence number of this event, used to order streaming events. required: - type - output_index - item_id - sequence_number x-oaiMeta: name: response.code_interpreter_call.interpreting group: responses example: "{\n \"type\": \"response.code_interpreter_call.interpreting\",\n \"output_index\": 4,\n \"item_id\": \"ci_12345\",\n \"sequence_number\": 1\n}\n" ResponseProperties: type: object properties: previous_response_id: anyOf: - type: string description: 'The unique ID of the previous response to the model. Use this to create multi-turn conversations. Learn more about [conversation state](https://developers.openai.com/api/docs/guides/conversation-state). Cannot be used in conjunction with `conversation`. ' - type: 'null' model: description: 'Model ID used to generate the response, like `gpt-6-astra`. OpenAI offers a wide range of models with different capabilities, performance characteristics, and price points. Refer to the [model guide](https://developers.openai.com/api/docs/models) to browse and compare available models. ' $ref: '#/components/schemas/ModelIdsResponses' background: anyOf: - type: boolean description: 'Whether to run the model response in the background. [Learn more](https://developers.openai.com/api/docs/guides/background). ' default: false - type: 'null' max_tool_calls: anyOf: - description: 'The maximum number of total calls to built-in tools that can be processed in a response. This maximum number applies across all built-in tool calls, not per individual tool. Any further attempts to call a tool by the model will be ignored. ' type: integer - type: 'null' text: $ref: '#/components/schemas/ResponseTextParam' tools: $ref: '#/components/schemas/ToolsArray' tool_choice: $ref: '#/components/schemas/ToolChoiceParam' prompt: $ref: '#/components/schemas/Prompt' MCPToolCallError: oneOf: - $ref: '#/components/schemas/MCPProtocolError' - $ref: '#/components/schemas/MCPToolExecutionError' - $ref: '#/components/schemas/HTTPError' discriminator: propertyName: type Item: type: object description: 'Content item used to generate a response. ' oneOf: - $ref: '#/components/schemas/InputMessage' - $ref: '#/components/schemas/OutputMessage' - $ref: '#/components/schemas/FileSearchToolCall' - $ref: '#/components/schemas/ComputerToolCall' - $ref: '#/components/schemas/ComputerCallOutputItemParam' - $ref: '#/components/schemas/WebSearchToolCall' - $ref: '#/components/schemas/FunctionToolCall' - $ref: '#/components/schemas/FunctionCallOutputItemParam' - $ref: '#/components/schemas/ToolSearchCallItemParam' - $ref: '#/components/schemas/ToolSearchOutputItemParam' - $ref: '#/components/schemas/AdditionalToolsItemParam' - $ref: '#/components/schemas/ResponseConfigurationUpdateItemParam' - $ref: '#/components/schemas/ReasoningItem' - $ref: '#/components/schemas/CompactionSummaryItemParam' - $ref: '#/components/schemas/ImageGenToolCall' - $ref: '#/components/schemas/CodeInterpreterToolCall' - $ref: '#/components/schemas/LocalShellToolCall' - $ref: '#/components/schemas/LocalShellToolCallOutput' - $ref: '#/components/schemas/FunctionShellCallItemParam' - $ref: '#/components/schemas/FunctionShellCallOutputItemParam' - $ref: '#/components/schemas/ApplyPatchToolCallItemParam' - $ref: '#/components/schemas/ApplyPatchToolCallOutputItemParam' - $ref: '#/components/schemas/MCPListTools' - $ref: '#/components/schemas/MCPApprovalRequest' - $ref: '#/components/schemas/MCPApprovalResponse' - $ref: '#/components/schemas/MCPToolCall' - $ref: '#/components/schemas/CustomToolCallOutput' - $ref: '#/components/schemas/CustomToolCall' discriminator: propertyName: type FunctionCallItemStatus: type: string enum: - in_progress - completed - incomplete ComputerToolCallOutputResource: allOf: - $ref: '#/components/schemas/ComputerToolCallOutput' - type: object properties: id: type: string description: 'The unique ID of the computer call tool output. ' status: description: 'The status of the message input. One of `in_progress`, `completed`, or `incomplete`. Populated when input items are returned via API. ' $ref: '#/components/schemas/ComputerCallOutputStatus' created_by: type: string description: 'The identifier of the actor that created the item. ' required: - id - status SpeechAudioDoneEvent: type: object description: Emitted when the speech synthesis is complete and all audio has been streamed. properties: type: type: string description: 'The type of the event. Always `speech.audio.done`. ' enum: - speech.audio.done x-stainless-const: true usage: type: object description: 'Token usage statistics for the request. ' properties: input_tokens: type: integer description: Number of input tokens in the prompt. output_tokens: type: integer description: Number of output tokens generated. total_tokens: type: integer description: Total number of tokens used (input + output). required: - input_tokens - output_tokens - total_tokens required: - type - usage x-oaiMeta: name: Stream Event (speech.audio.done) group: speech example: "{\n \"type\": \"speech.audio.done\",\n \"usage\": {\n \"input_tokens\": 14,\n \"output_tokens\": 101,\n \"total_tokens\": 115\n }\n}\n" ImagesResponse: type: object title: Image generation response description: The response from the image generation endpoint. properties: created: type: integer format: unixtime description: The Unix timestamp (in seconds) of when the image was created. data: type: array description: The list of generated images. items: $ref: '#/components/schemas/Image' background: type: string description: The background parameter used for the image generation. Either `transparent` or `opaque`. enum: - transparent - opaque output_format: type: string description: The output format of the image generation. Either `png`, `webp`, or `jpeg`. enum: - png - webp - jpeg size: anyOf: - type: string - type: string enum: - 1024x1024 - 1024x1536 - 1536x1024 description: The image dimensions as a `WIDTHxHEIGHT` string, for example `1536x864`. quality: type: string description: The quality of the image generated. One of `low`, `medium`, `high`, `xhigh`, or `max`. enum: - low - medium - high - xhigh - max usage: $ref: '#/components/schemas/ImageGenUsage' required: - created x-oaiMeta: name: The image generation response group: images example: "{\n \"created\": 1713833628,\n \"data\": [\n {\n \"b64_json\": \"...\"\n }\n \ ],\n \"background\": \"transparent\",\n \"output_format\": \"png\",\n \"size\": \"1024x1024\",\n \ \"quality\": \"high\",\n \"usage\": {\n \"total_tokens\": 100,\n \"input_tokens\": 50,\n \"output_tokens\": 50,\n \"input_tokens_details\": {\n \"text_tokens\": 10,\n \ \"image_tokens\": 40\n }\n }\n}\n" ComputerToolCallOutput: type: object title: Computer tool call output description: 'The output of a computer tool call. ' properties: type: type: string description: 'The type of the computer tool call output. Always `computer_call_output`. ' enum: - computer_call_output default: computer_call_output x-stainless-const: true id: type: string description: 'The ID of the computer tool call output. ' call_id: type: string description: 'The ID of the computer tool call that produced the output. ' acknowledged_safety_checks: type: array description: 'The safety checks reported by the API that have been acknowledged by the developer. ' items: $ref: '#/components/schemas/ComputerCallSafetyCheckParam' output: $ref: '#/components/schemas/ComputerScreenshotImage' status: type: string description: 'The status of the message input. One of `in_progress`, `completed`, or `incomplete`. Populated when input items are returned via API. ' enum: - in_progress - completed - incomplete required: - type - call_id - output PromptCacheOptionsParam: properties: ttl: $ref: '#/components/schemas/PromptCacheTTLEnum' description: The minimum lifetime applied to every implicit and explicit cache breakpoint written by the request. Defaults to `30m`, which is currently the only supported value. The backend may retain cache entries for longer. mode: $ref: '#/components/schemas/PromptCacheModeEnum' description: Controls whether OpenAI automatically creates an implicit cache breakpoint. Defaults to `implicit`. With `implicit`, OpenAI creates one implicit breakpoint and writes up to the latest three explicit breakpoints in the request. With `explicit`, OpenAI does not create an implicit breakpoint and writes up to the latest four explicit breakpoints. If there are no explicit breakpoints, the request does not use prompt caching. type: object required: [] title: Prompt cache options description: Options for prompt caching. Supported for `gpt-5.6` and later models. By default, OpenAI automatically chooses one implicit cache breakpoint. You can add explicit breakpoints to content blocks with `prompt_cache_breakpoint`. Each request can write up to four breakpoints. For cache matching, OpenAI considers up to the latest 80 breakpoints in the conversation, without a content-block lookback limit. Set `mode` to `explicit` to disable the implicit breakpoint. The `ttl` defaults to `30m`, which is currently the only supported value. See the [prompt caching guide](https://developers.openai.com/api/docs/guides/prompt-caching) for current details. Response: title: The response object allOf: - $ref: '#/components/schemas/ModelResponseProperties' - $ref: '#/components/schemas/ResponseProperties' - type: object properties: service_tier: $ref: '#/components/schemas/ServiceTierResponses' truncation: anyOf: - type: string description: "The truncation strategy to use for the model response.\n- `auto`: If the input to this Response exceeds\n the model's context window size, the model will truncate the\n \ response to fit the context window by dropping items from the beginning of the conversation.\n- `disabled` (default): If the input size will exceed the context window\n size for a model, the request will fail with a 400 error.\n" enum: - auto - disabled default: disabled - type: 'null' id: type: string description: 'Unique identifier for this Response. ' object: type: string description: 'The object type of this resource - always set to `response`. ' enum: - response x-stainless-const: true status: type: string description: 'The status of the response generation. One of `completed`, `failed`, `in_progress`, `cancelled`, `queued`, or `incomplete`. ' enum: - completed - failed - in_progress - cancelled - queued - incomplete created_at: type: number format: unixtime description: 'Unix timestamp (in seconds) of when this Response was created. ' completed_at: anyOf: - type: number format: unixtime description: 'Unix timestamp (in seconds) of when this Response was completed. Only present when the status is `completed`. ' - type: 'null' error: $ref: '#/components/schemas/ResponseError' incomplete_details: anyOf: - type: object description: 'Details about why the response is incomplete. ' properties: reason: type: string description: 'The reason why the response is incomplete. `steered` means the response stopped at a safe output boundary after a WebSocket `response.steer` event. The server can then create a successor response automatically with the queued input. ' enum: - max_output_tokens - max_messages - content_filter - steered - type: 'null' output: type: array 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" items: $ref: '#/components/schemas/OutputItem' reasoning: anyOf: - $ref: '#/components/schemas/Reasoning' - type: 'null' instructions: anyOf: - description: 'A system (or developer) message inserted into the model''s context. When using along with `previous_response_id`, the instructions from a previous response will not be carried over to the next response. This makes it simple to swap out system (or developer) messages in new responses. ' oneOf: - type: string description: 'A text input to the model, equivalent to a text input with the `developer` role. ' - type: array title: Input item list description: 'A list of one or many input items to the model, containing different content types. ' items: $ref: '#/components/schemas/InputItem' - type: 'null' output_text: anyOf: - type: string description: 'SDK-only convenience property that contains the aggregated text output from all `output_text` items in the `output` array, if any are present. Supported in the Python and JavaScript SDKs. ' x-oaiSupportedSDKs: - python - javascript - type: 'null' usage: $ref: '#/components/schemas/ResponseUsage' prompt_cache_options: $ref: '#/components/schemas/PromptCacheOptions' prompt_cache_diagnostics: $ref: '#/components/schemas/PromptCacheDiagnostics' moderation: anyOf: - $ref: '#/components/schemas/Moderation' description: 'Moderation results for the response input and output, if moderated completions were requested. ' - type: 'null' parallel_tool_calls: type: boolean description: 'Whether to allow the model to run tool calls in parallel. ' default: true conversation: anyOf: - default: null $ref: '#/components/schemas/ResponseConversation' - type: 'null' 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](https://developers.openai.com/api/docs/guides/reasoning). ' type: integer - type: 'null' required: - id - object - created_at - error - incomplete_details - instructions - model - tools - output - parallel_tool_calls - metadata - tool_choice - temperature - top_p example: id: resp_67ccd3a9da748190baa7f1570fe91ac604becb25c45c1d41 object: response created_at: 1741476777 status: completed completed_at: 1741476778 error: null incomplete_details: null instructions: null max_output_tokens: null model: gpt-6-astra 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 previous_response_id: null reasoning: effort: null summary: null context: null store: true temperature: 1 text: format: type: text tool_choice: auto tools: [] top_p: 1 truncation: disabled usage: input_tokens: 328 input_tokens_details: cached_tokens: 0 cache_write_tokens: 0 output_tokens: 52 output_tokens_details: reasoning_tokens: 0 total_tokens: 380 user: null metadata: {} ResponseContentPartDoneEvent: type: object description: Emitted when a content part is done. properties: type: type: string description: 'The type of the event. Always `response.content_part.done`. ' enum: - response.content_part.done x-stainless-const: true item_id: type: string description: 'The ID of the output item that the content part was added to. ' output_index: type: integer description: 'The index of the output item that the content part was added to. ' content_index: type: integer description: 'The index of the content part that is done. ' sequence_number: type: integer description: The sequence number of this event. part: $ref: '#/components/schemas/OutputContent' description: 'The content part that is done. ' required: - type - item_id - output_index - content_index - part - sequence_number x-oaiMeta: name: response.content_part.done group: responses example: "{\n \"type\": \"response.content_part.done\",\n \"item_id\": \"msg_123\",\n \"output_index\": 0,\n \"content_index\": 0,\n \"sequence_number\": 1,\n \"part\": {\n \"type\": \"output_text\",\n \ \"text\": \"In a shimmering forest under a sky full of stars, a lonely unicorn named Lila discovered a hidden pond that glowed with moonlight. Every night, she would leave sparkling, magical flowers by the water's edge, hoping to share her beauty with others. One enchanting evening, she woke to find a group of friendly animals gathered around, eager to be friends and share in her magic.\",\n \"annotations\": []\n }\n}\n" ResponseAudioDeltaEvent: type: object description: Emitted when there is a partial audio response. properties: type: type: string description: 'The type of the event. Always `response.audio.delta`. ' enum: - response.audio.delta x-stainless-const: true sequence_number: type: integer description: 'A sequence number for this chunk of the stream response. ' delta: type: string description: 'A chunk of Base64 encoded response audio bytes. ' required: - type - delta - sequence_number x-oaiMeta: name: response.audio.delta group: responses example: "{\n \"type\": \"response.audio.delta\",\n \"response_id\": \"resp_123\",\n \"delta\": \"base64encoded...\",\n \"sequence_number\": 1\n}\n" ResponseRefusalDoneEvent: type: object description: Emitted when refusal text is finalized. properties: type: type: string description: 'The type of the event. Always `response.refusal.done`. ' enum: - response.refusal.done x-stainless-const: true item_id: type: string description: 'The ID of the output item that the refusal text is finalized. ' output_index: type: integer description: 'The index of the output item that the refusal text is finalized. ' content_index: type: integer description: 'The index of the content part that the refusal text is finalized. ' refusal: type: string description: 'The refusal text that is finalized. ' sequence_number: type: integer description: 'The sequence number of this event. ' required: - type - item_id - output_index - content_index - refusal - sequence_number x-oaiMeta: name: response.refusal.done group: responses example: "{\n \"type\": \"response.refusal.done\",\n \"item_id\": \"item-abc\",\n \"output_index\": 1,\n \"content_index\": 2,\n \"refusal\": \"final refusal text\",\n \"sequence_number\": 1\n}\n" CreateCompletionRequest: type: object properties: model: description: 'ID of the model to use. You can use the [List models](https://developers.openai.com/api/reference/resources/models/methods/list) API to see all of your available models, or see our [Model overview](https://developers.openai.com/api/docs/models) for descriptions of them. ' anyOf: - type: string - type: string enum: - gpt-3.5-turbo-instruct - davinci-002 - babbage-002 x-oaiTypeLabel: string prompt: description: 'The prompt(s) to generate completions for, encoded as a string, array of strings, array of tokens, or array of token arrays. Note that <|endoftext|> is the document separator that the model sees during training, so if a prompt is not specified the model will generate as if from the beginning of a new document. ' default: <|endoftext|> nullable: true oneOf: - type: string default: '' example: This is a test. - type: array items: type: string default: '' example: This is a test. - type: array minItems: 1 items: type: integer example: '[1212, 318, 257, 1332, 13]' - type: array minItems: 1 items: type: array minItems: 1 items: type: integer example: '[[1212, 318, 257, 1332, 13]]' best_of: type: integer default: 1 minimum: 0 maximum: 20 nullable: true description: 'Generates `best_of` completions server-side and returns the "best" (the one with the highest log probability per token). Results cannot be streamed. When used with `n`, `best_of` controls the number of candidate completions and `n` specifies how many to return – `best_of` must be greater than `n`. **Note:** Because this parameter generates many completions, it can quickly consume your token quota. Use carefully and ensure that you have reasonable settings for `max_tokens` and `stop`. ' echo: type: boolean default: false nullable: true description: 'Echo back the prompt in addition to the completion ' frequency_penalty: type: number default: 0 minimum: -2 maximum: 2 nullable: true description: 'Number between -2.0 and 2.0. Positive values penalize new tokens based on their existing frequency in the text so far, decreasing the model''s likelihood to repeat the same line verbatim. [See more information about frequency and presence penalties.](https://developers.openai.com/api/docs/guides/text) ' logit_bias: type: object x-oaiTypeLabel: map default: null nullable: true additionalProperties: type: integer description: 'Modify the likelihood of specified tokens appearing in the completion. Accepts a JSON object that maps tokens (specified by their token ID in the GPT tokenizer) to an associated bias value from -100 to 100. You can use this [tokenizer tool](https://platform.openai.com/tokenizer?view=bpe) to convert text to token IDs. Mathematically, the bias is added to the logits generated by the model prior to sampling. The exact effect will vary per model, but values between -1 and 1 should decrease or increase likelihood of selection; values like -100 or 100 should result in a ban or exclusive selection of the relevant token. As an example, you can pass `{"50256": -100}` to prevent the <|endoftext|> token from being generated. ' logprobs: type: integer minimum: 0 maximum: 5 default: null nullable: true description: 'Include the log probabilities on the `logprobs` most likely output tokens, as well the chosen tokens. For example, if `logprobs` is 5, the API will return a list of the 5 most likely tokens. The API will always return the `logprob` of the sampled token, so there may be up to `logprobs+1` elements in the response. The maximum value for `logprobs` is 5. ' max_tokens: type: integer minimum: 0 default: 16 example: 16 nullable: true description: 'The maximum number of [tokens](https://platform.openai.com/tokenizer) that can be generated in the completion. The token count of your prompt plus `max_tokens` cannot exceed the model''s context length. [Example Python code](https://cookbook.openai.com/examples/how_to_count_tokens_with_tiktoken) for counting tokens. ' n: type: integer minimum: 1 maximum: 128 default: 1 example: 1 nullable: true description: 'How many completions to generate for each prompt. **Note:** Because this parameter generates many completions, it can quickly consume your token quota. Use carefully and ensure that you have reasonable settings for `max_tokens` and `stop`. ' presence_penalty: type: number default: 0 minimum: -2 maximum: 2 nullable: true description: 'Number between -2.0 and 2.0. Positive values penalize new tokens based on whether they appear in the text so far, increasing the model''s likelihood to talk about new topics. [See more information about frequency and presence penalties.](https://developers.openai.com/api/docs/guides/text) ' seed: type: integer format: int64 nullable: true description: 'If specified, our system will make a best effort to sample deterministically, such that repeated requests with the same `seed` and parameters should return the same result. Determinism is not guaranteed, and you should refer to the `system_fingerprint` response parameter to monitor changes in the backend. ' stop: $ref: '#/components/schemas/StopConfiguration' stream: description: 'Whether to stream back partial progress. If set, tokens will be sent as data-only [server-sent events](https://developer.mozilla.org/en-US/docs/Web/API/Server-sent_events/Using_server-sent_events#Event_stream_format) as they become available, with the stream terminated by a `data: [DONE]` message. [Example Python code](https://cookbook.openai.com/examples/how_to_stream_completions). ' type: boolean nullable: true default: false stream_options: $ref: '#/components/schemas/ChatCompletionStreamOptions' suffix: description: 'The suffix that comes after a completion of inserted text. This parameter is only supported for `gpt-3.5-turbo-instruct`. ' default: null nullable: true type: string example: test. temperature: type: number minimum: 0 maximum: 2 default: 1 example: 1 nullable: true description: 'What sampling temperature to use, between 0 and 2. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. We generally recommend altering this or `top_p` but not both. ' top_p: type: number minimum: 0 maximum: 1 default: 1 example: 1 nullable: true description: 'An alternative to sampling with temperature, called nucleus sampling, where the model considers the results of the tokens with top_p probability mass. So 0.1 means only the tokens comprising the top 10% probability mass are considered. We generally recommend altering this or `temperature` but not both. ' user: type: string example: user-1234 description: 'A unique identifier representing your end-user, which can help OpenAI to monitor and detect abuse. [Learn more](https://developers.openai.com/api/docs/guides/safety-best-practices#implement-safety-identifiers). ' required: - model - prompt DoubleClickAction: properties: type: type: string enum: - double_click description: Specifies the event type. For a double click action, this property is always set to `double_click`. default: double_click x-stainless-const: true x: type: integer description: The x-coordinate where the double click occurred. y: type: integer description: The y-coordinate where the double click occurred. keys: anyOf: - items: type: string type: array description: The keys being held while double-clicking. - type: 'null' type: object required: - type - x - y - keys title: DoubleClick description: A double click action. ResponseConversation: properties: id: type: string description: The unique ID of the conversation that this response was associated with. type: object required: - id title: Conversation description: The conversation that this response belonged to. Input items and output items from this response were automatically added to this conversation. TranscriptTextUsageDuration: type: object title: Duration Usage description: Usage statistics for models billed by audio input duration. properties: type: type: string enum: - duration description: The type of the usage object. Always `duration` for this variant. x-stainless-const: true seconds: type: number format: double description: Duration of the input audio in seconds. required: - type - seconds ResponseReasoningSummaryPartAddedEvent: type: object description: Emitted when a new reasoning summary part is added. properties: type: type: string description: 'The type of the event. Always `response.reasoning_summary_part.added`. ' enum: - response.reasoning_summary_part.added x-stainless-const: true item_id: type: string description: 'The ID of the item this summary part is associated with. ' output_index: type: integer description: 'The index of the output item this summary part is associated with. ' summary_index: type: integer description: 'The index of the summary part within the reasoning summary. ' sequence_number: type: integer description: 'The sequence number of this event. ' part: type: object description: 'The summary part that was added. ' properties: type: type: string description: The type of the summary part. Always `summary_text`. enum: - summary_text x-stainless-const: true text: type: string description: The text of the summary part. required: - type - text required: - type - item_id - output_index - summary_index - part - sequence_number x-oaiMeta: name: response.reasoning_summary_part.added group: responses example: "{\n \"type\": \"response.reasoning_summary_part.added\",\n \"item_id\": \"rs_6806bfca0b2481918a5748308061a2600d3ce51bdffd5476\",\n \ \"output_index\": 0,\n \"summary_index\": 0,\n \"part\": {\n \"type\": \"summary_text\",\n \ \"text\": \"\"\n },\n \"sequence_number\": 1\n}\n" InputFidelity: type: string enum: - high - low description: Control how much effort the model will exert to match the style and features, especially facial features, of input images. This parameter is only supported for `gpt-image-1` and `gpt-image-1.5` and later models, unsupported for `gpt-image-1-mini`. Supports `high` and `low`. Defaults to `low`. PromptCacheDiagnostics: oneOf: - $ref: '#/components/schemas/PromptCacheMissDiagnosticsBody' - $ref: '#/components/schemas/PromptCacheHitDiagnosticsBody' - $ref: '#/components/schemas/PromptCacheComparisonResponseNotFoundDiagnosticsBody' - $ref: '#/components/schemas/PromptCacheUnavailableDiagnosticsBody' description: Prompt cache diagnostics requested for this response. discriminator: propertyName: type MCPToolCall: type: object title: MCP tool call description: 'An invocation of a tool on an MCP server. ' properties: type: type: string enum: - mcp_call description: 'The type of the item. Always `mcp_call`. ' x-stainless-const: true id: type: string description: 'The unique ID of the tool call. ' server_label: type: string description: 'The label of the MCP server running the tool. ' name: type: string description: 'The name of the tool that was run. ' arguments: type: string description: 'A JSON string of the arguments passed to the tool. ' output: anyOf: - type: string description: 'The output from the tool call. ' - type: 'null' error: description: The error from the tool call, if any. anyOf: - $ref: '#/components/schemas/MCPToolCallError' - type: 'null' status: $ref: '#/components/schemas/MCPToolCallStatus' description: 'The status of the tool call. One of `in_progress`, `completed`, `incomplete`, `calling`, or `failed`. ' approval_request_id: anyOf: - type: string description: 'Unique identifier for the MCP tool call approval request. Include this value in a subsequent `mcp_approval_response` input to approve or reject the corresponding tool call. ' - type: 'null' required: - type - id - server_label - name - arguments ImageEditCompletedEvent: type: object description: 'Emitted when image editing has completed and the final image is available. ' properties: type: type: string description: 'The type of the event. Always `image_edit.completed`. ' enum: - image_edit.completed x-stainless-const: true b64_json: type: string description: 'Base64-encoded final edited image data, suitable for rendering as an image. ' created_at: type: integer format: unixtime description: 'The Unix timestamp when the event was created. ' size: anyOf: - type: string - type: string enum: - 1024x1024 - 1024x1536 - 1536x1024 - auto description: The image dimensions as a `WIDTHxHEIGHT` string, for example `1536x864`. quality: type: string description: 'The quality setting for the edited image. ' enum: - low - medium - high - xhigh - max - auto background: type: string description: 'The background setting for the edited image. ' enum: - transparent - opaque - auto output_format: type: string description: 'The output format for the edited image. ' enum: - png - webp - jpeg usage: $ref: '#/components/schemas/ImagesUsage' required: - type - b64_json - created_at - size - quality - background - output_format - usage x-oaiMeta: name: image_edit.completed group: images example: "{\n \"type\": \"image_edit.completed\",\n \"b64_json\": \"...\",\n \"created_at\": 1620000000,\n \"size\": \"1024x1024\",\n \"quality\": \"high\",\n \"background\": \"transparent\",\n \ \"output_format\": \"png\",\n \"usage\": {\n \"total_tokens\": 100,\n \"input_tokens\": 50,\n \"output_tokens\": 50,\n \"input_tokens_details\": {\n \"text_tokens\": 10,\n \ \"image_tokens\": 40\n }\n }\n}\n" ResponseCompletedEvent: type: object description: Emitted when the model response is complete. properties: type: type: string description: 'The type of the event. Always `response.completed`. ' enum: - response.completed x-stainless-const: true response: $ref: '#/components/schemas/Response' description: 'Properties of the completed response. ' sequence_number: type: integer description: The sequence number for this event. required: - type - response - sequence_number x-oaiMeta: name: response.completed group: responses example: "{\n \"type\": \"response.completed\",\n \"response\": {\n \"id\": \"resp_123\",\n \ \"object\": \"response\",\n \"created_at\": 1740855869,\n \"status\": \"completed\",\n \ \"completed_at\": 1740855870,\n \"error\": null,\n \"incomplete_details\": null,\n \ \"input\": [],\n \"instructions\": null,\n \"max_output_tokens\": null,\n \"model\": \"gpt-6-astra\",\n \"output\": [\n {\n \"id\": \"msg_123\",\n \"type\": \"message\",\n \"role\": \"assistant\",\n \"content\": [\n {\n \"type\": \"output_text\",\n \"text\": \"In a shimmering forest under a sky full of stars, a lonely unicorn named Lila discovered a hidden pond that glowed with moonlight. Every night, she would leave sparkling, magical flowers by the water's edge, hoping to share her beauty with others. One enchanting evening, she woke to find a group of friendly animals gathered around, eager to be friends and share in her magic.\",\n \"annotations\": []\n }\n \ ]\n }\n ],\n \"previous_response_id\": null,\n \"reasoning_effort\": null,\n \ \"store\": false,\n \"temperature\": 1,\n \"text\": {\n \"format\": {\n \"type\": \"text\"\n }\n },\n \"tool_choice\": \"auto\",\n \"tools\": [],\n \"top_p\": 1,\n \"truncation\": \"disabled\",\n \"usage\": {\n \"input_tokens\": 0,\n \"output_tokens\": 0,\n \"output_tokens_details\": {\n \"reasoning_tokens\": 0\n },\n \"total_tokens\": 0\n },\n \"user\": null,\n \"metadata\": {}\n },\n \"sequence_number\": 1\n}\n" ResponseMCPListToolsCompletedEvent: type: object title: ResponseMCPListToolsCompletedEvent description: 'Emitted when the list of available MCP tools has been successfully retrieved. ' properties: type: type: string enum: - response.mcp_list_tools.completed description: The type of the event. Always 'response.mcp_list_tools.completed'. x-stainless-const: true item_id: type: string description: The ID of the MCP tool call item that produced this output. output_index: type: integer description: The index of the output item that was processed. sequence_number: type: integer description: The sequence number of this event. required: - type - item_id - output_index - sequence_number x-oaiMeta: name: response.mcp_list_tools.completed group: responses example: "{\n \"type\": \"response.mcp_list_tools.completed\",\n \"sequence_number\": 1,\n \"output_index\": 0,\n \"item_id\": \"mcpl_682d4379df088191886b70f4ec39f90403937d5f622d7a90\"\n}\n" FunctionShellCallStatus: type: string enum: - in_progress - completed - incomplete ResponseShellCallCommandAddedStreamingEvent: properties: type: type: string enum: - response.shell_call_command.added description: The type of the event, always `response.shell_call_command.added`. default: response.shell_call_command.added x-stainless-const: true 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 updated. command_index: type: integer description: The index of the shell command that was added. command: type: string description: The shell command that was added. type: object required: - type - sequence_number - output_index - command_index - command title: Response shell command added event description: A streaming event that indicated a shell command was added to a tool call. WebSearchPreviewTool: properties: type: type: string enum: - web_search_preview - web_search_preview_2025_03_11 description: The type of the web search tool. One of `web_search_preview` or `web_search_preview_2025_03_11`. default: web_search_preview x-stainless-const: true user_location: anyOf: - $ref: '#/components/schemas/ApproximateLocation' description: The user's location. - type: 'null' search_context_size: $ref: '#/components/schemas/SearchContextSize' description: High level guidance for the amount of context window space to use for the search. One of `low`, `medium`, or `high`. `medium` is the default. search_content_types: items: $ref: '#/components/schemas/SearchContentType' type: array type: object required: - type title: Web search preview description: This tool searches the web for relevant results to use in a response. Learn more about the [web search tool](https://developers.openai.com/api/docs/guides/tools-web-search). ApplyPatchToolCallItemParam: properties: type: type: string enum: - apply_patch_call description: The type of the item. Always `apply_patch_call`. default: apply_patch_call x-stainless-const: true id: anyOf: - type: string description: The unique ID of the apply patch tool call. Populated when this item is returned via API. example: apc_123 - type: 'null' call_id: type: string maxLength: 64 minLength: 1 description: The unique ID of the apply patch tool call generated by the model. caller: anyOf: - $ref: '#/components/schemas/ToolCallCallerParam' description: The execution context that produced this tool call. - type: 'null' status: $ref: '#/components/schemas/ApplyPatchCallStatusParam' description: The status of the apply patch tool call. One of `in_progress` or `completed`. operation: $ref: '#/components/schemas/ApplyPatchOperationParam' description: The specific create, delete, or update instruction for the apply_patch tool call. type: object required: - type - call_id - status - operation title: Apply patch tool call description: A tool call representing a request to create, delete, or update files using diff patches. RankerVersionType: type: string enum: - auto - default-2024-11-15 WebSearchApproximateLocation: anyOf: - type: object title: Web search approximate location description: 'The approximate location of the user. ' properties: type: type: string enum: - approximate description: The type of location approximation. Always `approximate`. default: approximate x-stainless-const: true country: anyOf: - type: string description: The two-letter [ISO country code](https://en.wikipedia.org/wiki/ISO_3166-1) of the user, e.g. `US`. - type: 'null' region: anyOf: - type: string description: Free text input for the region of the user, e.g. `California`. - type: 'null' city: anyOf: - type: string description: Free text input for the city of the user, e.g. `San Francisco`. - type: 'null' timezone: anyOf: - type: string description: The [IANA timezone](https://timeapi.io/documentation/iana-timezones) of the user, e.g. `America/Los_Angeles`. - type: 'null' - type: 'null' PromptCacheBreakpointConfig: properties: mode: type: string enum: - explicit description: The breakpoint mode. Always `explicit`. default: explicit x-stainless-const: true type: object required: - mode title: Prompt cache breakpoint description: Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL from the request's `prompt_cache_options.ttl`; the boundary is not rounded to a token block. PromptCacheMissDiagnosticsBody: properties: type: type: string enum: - cache_miss default: cache_miss x-stainless-const: true reason: $ref: '#/components/schemas/CacheMissReasonTypeEnum' description: The reason prompt cache reuse did not occur. cache_missed_tokens: type: integer description: The estimated number of input tokens affected after the first detected divergence. comparison_reusable_tokens: type: integer description: The raw token count of the reusable prefix in the compared response. type: object required: - type - reason - cache_missed_tokens ChatCompletionModerationResults: type: object description: Successful moderation results for the request input or generated output. properties: type: type: string enum: - moderation_results description: The object type, which is always `moderation_results`. x-stainless-const: true model: type: string description: The moderation model used to generate the results. results: type: array description: A list of moderation results. items: $ref: '#/components/schemas/ModerationResultBody' required: - type - model - results Filters: anyOf: - $ref: '#/components/schemas/ComparisonFilter' - $ref: '#/components/schemas/CompoundFilter' ImageDetail: type: string enum: - low - high - auto - original FunctionCallStatus: type: string enum: - in_progress - completed - incomplete ToolChoiceAllowed: type: object title: Allowed tools description: 'Constrains the tools available to the model to a pre-defined set. ' properties: type: type: string enum: - allowed_tools description: Allowed tool configuration type. Always `allowed_tools`. x-stainless-const: true mode: type: string enum: - auto - required description: 'Constrains the tools available to the model to a pre-defined set. `auto` allows the model to pick from among the allowed tools and generate a message. `required` requires the model to call one or more of the allowed tools. ' tools: type: array description: "A list of tool definitions that the model should be allowed to call.\n\nFor the Responses API, the list of tool definitions might look like:\n```json\n[\n { \"type\": \"function\", \"name\": \"get_weather\" },\n { \"type\": \"mcp\", \"server_label\": \"deepwiki\" },\n { \"type\": \"image_generation\" }\n]\n```\n" items: type: object description: 'A tool definition that the model should be allowed to call. ' additionalProperties: true x-oaiExpandable: false required: - type - mode - tools EmptyModelParam: properties: {} type: object required: [] CreateTranscriptionResponseDiarizedJson: type: object description: 'Represents a diarized transcription response returned by the model, including the combined transcript and speaker-segment annotations. ' properties: task: type: string description: The type of task that was run. Always `transcribe`. enum: - transcribe x-stainless-const: true duration: type: number format: double description: Duration of the input audio in seconds. text: type: string description: The concatenated transcript text for the entire audio input. segments: type: array description: Segments of the transcript annotated with timestamps and speaker labels. items: $ref: '#/components/schemas/TranscriptionDiarizedSegment' usage: type: object description: Token or duration usage statistics for the request. oneOf: - $ref: '#/components/schemas/TranscriptTextUsageTokens' title: Token Usage - $ref: '#/components/schemas/TranscriptTextUsageDuration' title: Duration Usage discriminator: propertyName: type required: - task - duration - text - segments x-oaiMeta: name: The transcription object (Diarized JSON) group: audio example: "{\n \"task\": \"transcribe\",\n \"duration\": 42.7,\n \"text\": \"Agent: Thanks for calling OpenAI support.\\nCustomer: Hi, I need help with diarization.\",\n \"segments\": [\n \ {\n \"type\": \"transcript.text.segment\",\n \"id\": \"seg_001\",\n \"start\": 0.0,\n \"end\": 5.2,\n \"text\": \"Thanks for calling OpenAI support.\",\n \"speaker\": \"agent\"\n },\n {\n \"type\": \"transcript.text.segment\",\n \"id\": \"seg_002\",\n \ \"start\": 5.2,\n \"end\": 12.8,\n \"text\": \"Hi, I need help with diarization.\",\n \ \"speaker\": \"A\"\n }\n ],\n \"usage\": {\n \"type\": \"duration\",\n \"seconds\": 43\n }\n}\n" ProgramItemParam: properties: id: type: string description: The unique ID of this program item. example: cm_123 type: type: string enum: - program description: The item type. Always `program`. default: program x-stainless-const: true call_id: type: string maxLength: 64 minLength: 1 description: The stable call ID of the program item. code: type: string maxLength: 10485760 description: The JavaScript source executed by programmatic tool calling. fingerprint: type: string maxLength: 10485760 description: Opaque program replay fingerprint that must be round-tripped. type: object required: - id - type - call_id - code - fingerprint ComparisonFilter: type: object additionalProperties: false title: Comparison Filter description: 'A filter used to compare a specified attribute key to a given value using a defined comparison operation. ' properties: type: type: string default: eq enum: - eq - ne - gt - gte - lt - lte - in - nin description: 'Specifies the comparison operator: `eq`, `ne`, `gt`, `gte`, `lt`, `lte`, `in`, `nin`. - `eq`: equals - `ne`: not equal - `gt`: greater than - `gte`: greater than or equal - `lt`: less than - `lte`: less than or equal - `in`: in - `nin`: not in ' key: type: string description: The key to compare against the value. value: oneOf: - type: string - type: number - type: boolean - type: array items: oneOf: - type: string - type: number description: The value to compare against the attribute key; supports string, number, or boolean types. required: - type - key - value x-oaiMeta: name: ComparisonFilter FunctionToolCall: type: object title: Function tool call description: 'A tool call to run a function. See the [function calling guide](https://developers.openai.com/api/docs/guides/function-calling) for more information. ' properties: id: type: string description: 'The unique ID of the function tool call. ' type: type: string enum: - function_call description: 'The type of the function tool call. Always `function_call`. ' x-stainless-const: true call_id: type: string description: 'The unique ID of the function tool call generated by the model. ' caller: anyOf: - $ref: '#/components/schemas/ToolCallCaller' - type: 'null' namespace: type: string description: 'The namespace of the function to run. ' name: type: string description: 'The name of the function to run. ' arguments: type: string description: 'A JSON string of the arguments to pass to the function. ' status: type: string description: 'The status of the item. One of `in_progress`, `completed`, or `incomplete`. Populated when items are returned via API. ' enum: - in_progress - completed - incomplete async: type: boolean description: 'Whether the function tool call runs asynchronously. ' required: - type - call_id - name - arguments ResponseShellCallOutputContentDoneStreamingEvent: properties: type: type: string enum: - response.shell_call_output_content.done description: The type of the event, always `response.shell_call_output_content.done`. default: response.shell_call_output_content.done x-stainless-const: true sequence_number: type: integer description: The sequence number of the event that was emitted. item_id: type: string description: The ID of the output item that was updated. output_index: type: integer description: The index of the output item that was updated. command_index: type: integer description: The index of the shell command that produced output. output: items: $ref: '#/components/schemas/FunctionShellCallOutputContent' type: array description: The output contents emitted for the shell command. type: object required: - type - sequence_number - item_id - output_index - command_index - output title: Response shell call output content done event description: A streaming event that indicated shell call output was completed. FunctionShellActionParam: properties: commands: items: type: string type: array description: Ordered shell commands for the execution environment to run. timeout_ms: anyOf: - type: integer description: Maximum wall-clock time in milliseconds to allow the shell commands to run. - type: 'null' max_output_length: anyOf: - type: integer description: Maximum number of UTF-8 characters to capture from combined stdout and stderr output. - type: 'null' type: object required: - commands title: Shell action description: Commands and limits describing how to run the shell tool call. EasyInputMessage: type: object title: Input message description: 'A message input to the model with a role indicating instruction following hierarchy. Instructions given with the `developer` or `system` role take precedence over instructions given with the `user` role. Messages with the `assistant` role are presumed to have been generated by the model in previous interactions. ' properties: role: type: string description: 'The role of the message input. One of `user`, `assistant`, `system`, or `developer`. ' enum: - user - assistant - system - developer content: description: 'Text, image, or audio input to the model, used to generate a response. Can also contain previous assistant responses. ' oneOf: - type: string title: Text input description: 'A text input to the model. ' - $ref: '#/components/schemas/InputMessageContentList' phase: anyOf: - $ref: '#/components/schemas/MessagePhase' - type: 'null' type: type: string description: 'The type of the message input. Always `message`. ' enum: - message x-stainless-const: true required: - role - content ContainerReferenceParam: properties: type: type: string enum: - container_reference description: References a container created with the /v1/containers endpoint default: container_reference x-stainless-const: true container_id: type: string description: The ID of the referenced container. example: cntr_123 type: object required: - type - container_id ModelIdsResponses: example: gpt-6-astra anyOf: - $ref: '#/components/schemas/ModelIdsShared' - type: string title: ResponsesOnlyModel enum: - o1-pro - o1-pro-2025-03-19 - o3-pro - o3-pro-2025-06-10 - o3-deep-research - o3-deep-research-2025-06-26 - o4-mini-deep-research - o4-mini-deep-research-2025-06-26 - computer-use-preview - computer-use-preview-2025-03-11 - gpt-5.5-pro - gpt-5.5-pro-2026-04-23 - gpt-5-codex - gpt-5-pro - gpt-5-pro-2025-10-06 - gpt-5.1-codex-max - gpt-daybreak-blue-latest - gpt-daybreak-red-latest - gpt-5.6-cyber Verbosity: anyOf: - type: string enum: - low - medium - high default: medium description: 'Constrains the verbosity of the model''s response. Lower values will result in more concise responses, while higher values will result in more verbose responses. Currently supported values are `low`, `medium`, and `high`. The default is `medium`. ' - type: 'null' ChatCompletionRequestSystemMessage: type: object title: System message description: 'Developer-provided instructions that the model should follow, regardless of messages sent by the user. With o1 models and newer, use `developer` messages for this purpose instead. ' properties: content: description: The contents of the system message. oneOf: - type: string description: The contents of the system message. title: Text content - type: array description: An array of content parts with a defined type. For system messages, only type `text` is supported. title: Array of content parts items: $ref: '#/components/schemas/ChatCompletionRequestSystemMessageContentPart' minItems: 1 role: type: string enum: - system description: The role of the messages author, in this case `system`. x-stainless-const: true name: type: string description: An optional name for the participant. Provides the model information to differentiate between participants of the same role. required: - content - role ToolChoiceTypes: type: object title: Hosted tool description: 'Indicates that the model should use a built-in tool to generate a response. [Learn more about built-in tools](https://developers.openai.com/api/docs/guides/tools). ' properties: type: type: string description: 'The type of hosted tool the model should to use. Learn more about [built-in tools](https://developers.openai.com/api/docs/guides/tools). Allowed values are: - `file_search` - `web_search_preview` - `computer` - `computer_use_preview` - `computer_use` - `code_interpreter` - `image_generation` ' enum: - file_search - web_search_preview - computer - computer_use_preview - computer_use - web_search_preview_2025_03_11 - image_generation - code_interpreter required: - type PromptCacheUnavailableDiagnosticsBody: properties: type: type: string enum: - unavailable default: unavailable x-stainless-const: true type: object required: - type WebSearchActionOpenPage: type: object title: Open page action description: 'Action type "open_page" - Opens a specific URL from search results. ' properties: type: type: string enum: - open_page description: 'The action type. ' x-stainless-const: true url: description: 'The URL opened by the model. ' anyOf: - type: string format: uri - type: 'null' required: - type ImageGenPartialImageEvent: type: object description: 'Emitted when a partial image is available during image generation streaming. ' properties: type: type: string description: 'The type of the event. Always `image_generation.partial_image`. ' enum: - image_generation.partial_image x-stainless-const: true b64_json: type: string description: 'Base64-encoded partial image data, suitable for rendering as an image. ' created_at: type: integer format: unixtime description: 'The Unix timestamp when the event was created. ' size: anyOf: - type: string - type: string enum: - 1024x1024 - 1024x1536 - 1536x1024 - auto description: The image dimensions as a `WIDTHxHEIGHT` string, for example `1536x864`. quality: type: string description: 'The quality setting for the requested image. ' enum: - low - medium - high - xhigh - max - auto background: type: string description: 'The background setting for the requested image. ' enum: - transparent - opaque - auto output_format: type: string description: 'The output format for the requested image. ' enum: - png - webp - jpeg partial_image_index: type: integer description: '0-based index for the partial image (streaming). ' required: - type - b64_json - created_at - size - quality - background - output_format - partial_image_index x-oaiMeta: name: image_generation.partial_image group: images example: "{\n \"type\": \"image_generation.partial_image\",\n \"b64_json\": \"...\",\n \"created_at\": 1620000000,\n \"size\": \"1024x1024\",\n \"quality\": \"high\",\n \"background\": \"transparent\",\n \ \"output_format\": \"png\",\n \"partial_image_index\": 0\n}\n" FileCitationBody: properties: type: type: string enum: - file_citation description: The type of the file citation. Always `file_citation`. default: file_citation x-stainless-const: true file_id: type: string description: The ID of the file. index: type: integer description: The index of the file in the list of files. filename: type: string description: The filename of the file cited. type: object required: - type - file_id - index - filename title: File citation description: A citation to a file. DragParam: properties: type: type: string enum: - drag description: Specifies the event type. For a drag action, this property is always set to `drag`. default: drag x-stainless-const: true path: items: $ref: '#/components/schemas/CoordParam' type: array description: "An array of coordinates representing the path of the drag action. Coordinates will appear as an array of objects, eg\n```\n[\n { x: 100, y: 200 },\n { x: 200, y: 300 }\n]\n```" keys: anyOf: - items: type: string type: array description: The keys being held while dragging the mouse. - type: 'null' type: object required: - type - path title: Drag description: A drag action. FileSearchToolCall: type: object title: File search tool call description: 'The results of a file search tool call. See the [file search guide](https://developers.openai.com/api/docs/guides/tools-file-search) for more information. ' properties: id: type: string description: 'The unique ID of the file search tool call. ' type: type: string enum: - file_search_call description: 'The type of the file search tool call. Always `file_search_call`. ' x-stainless-const: true status: type: string description: 'The status of the file search tool call. One of `in_progress`, `searching`, `incomplete` or `failed`, ' enum: - in_progress - searching - completed - incomplete - failed queries: type: array items: type: string description: 'The queries used to search for files. ' results: anyOf: - type: array description: 'The results of the file search tool call. ' items: type: object properties: file_id: type: string description: 'The unique ID of the file. ' text: type: string description: 'The text that was retrieved from the file. ' filename: type: string description: 'The name of the file. ' attributes: $ref: '#/components/schemas/VectorStoreFileAttributes' score: type: number format: float description: 'The relevance score of the file - a value between 0 and 1. ' - type: 'null' required: - id - type - status - queries ResponseMCPCallCompletedEvent: type: object title: ResponseMCPCallCompletedEvent description: 'Emitted when an MCP tool call has completed successfully. ' properties: type: type: string enum: - response.mcp_call.completed description: The type of the event. Always 'response.mcp_call.completed'. x-stainless-const: true item_id: type: string description: The ID of the MCP tool call item that completed. output_index: type: integer description: The index of the output item that completed. sequence_number: type: integer description: The sequence number of this event. required: - type - item_id - output_index - sequence_number x-oaiMeta: name: response.mcp_call.completed group: responses example: "{\n \"type\": \"response.mcp_call.completed\",\n \"sequence_number\": 1,\n \"item_id\": \"mcp_682d437d90a88191bf88cd03aae0c3e503937d5f622d7a90\",\n \"output_index\": 0\n}\n" InputImageContent: properties: type: type: string enum: - input_image description: The type of the input item. Always `input_image`. default: input_image x-stainless-const: true image_url: anyOf: - type: string format: uri description: The URL of the image to be sent to the model. A fully qualified URL or base64 encoded image in a data URL. - type: 'null' file_id: anyOf: - type: string description: The ID of the file to be sent to the model. - type: 'null' detail: $ref: '#/components/schemas/ImageDetail' description: The detail level of the image to be sent to the model. One of `high`, `low`, `auto`, or `original`. Defaults to `auto`. prompt_cache_breakpoint: $ref: '#/components/schemas/PromptCacheBreakpointConfig' type: object required: - type - detail title: Input image description: An image input to the model. Learn about [image inputs](https://developers.openai.com/api/docs/guides/images-vision). Batch: type: object properties: id: type: string object: type: string enum: - batch description: The object type, which is always `batch`. x-stainless-const: true endpoint: type: string description: The OpenAI API endpoint used by the batch. model: type: string description: 'Model ID used to process the batch, like `gpt-6-astra`. OpenAI offers a wide range of models with different capabilities, performance characteristics, and price points. Refer to the [model guide](https://developers.openai.com/api/docs/models) to browse and compare available models. ' errors: type: object properties: object: type: string description: The object type, which is always `list`. data: type: array items: $ref: '#/components/schemas/BatchError' input_file_id: type: string description: The ID of the input file for the batch. completion_window: type: string description: The time frame within which the batch should be processed. status: type: string description: The current status of the batch. enum: - validating - failed - in_progress - finalizing - completed - expired - cancelling - cancelled output_file_id: type: string description: The ID of the file containing the outputs of successfully executed requests. error_file_id: type: string description: The ID of the file containing the outputs of requests with errors. created_at: type: integer format: unixtime description: The Unix timestamp (in seconds) for when the batch was created. in_progress_at: type: integer format: unixtime description: The Unix timestamp (in seconds) for when the batch started processing. expires_at: type: integer format: unixtime description: The Unix timestamp (in seconds) for when the batch will expire. finalizing_at: type: integer format: unixtime description: The Unix timestamp (in seconds) for when the batch started finalizing. completed_at: type: integer format: unixtime description: The Unix timestamp (in seconds) for when the batch was completed. failed_at: type: integer format: unixtime description: The Unix timestamp (in seconds) for when the batch failed. expired_at: type: integer format: unixtime description: The Unix timestamp (in seconds) for when the batch expired. cancelling_at: type: integer format: unixtime description: The Unix timestamp (in seconds) for when the batch started cancelling. cancelled_at: type: integer format: unixtime description: The Unix timestamp (in seconds) for when the batch was cancelled. request_counts: $ref: '#/components/schemas/BatchRequestCounts' usage: type: object description: 'Represents token usage details including input tokens, output tokens, a breakdown of output tokens, and the total tokens used. Only populated on batches created after September 7, 2025. ' properties: input_tokens: type: integer description: The number of input tokens. input_tokens_details: type: object description: A detailed breakdown of the input tokens. properties: cached_tokens: type: integer description: 'The number of tokens that were retrieved from the cache. [More on prompt caching](https://developers.openai.com/api/docs/guides/prompt-caching). ' required: - cached_tokens output_tokens: type: integer description: The number of output tokens. output_tokens_details: type: object description: A detailed breakdown of the output tokens. properties: reasoning_tokens: type: integer description: The number of reasoning tokens. required: - reasoning_tokens total_tokens: type: integer description: The total number of tokens used. required: - input_tokens - input_tokens_details - output_tokens - output_tokens_details - total_tokens metadata: $ref: '#/components/schemas/Metadata' required: - id - object - endpoint - input_file_id - completion_window - status - created_at x-oaiMeta: name: The batch object example: "{\n \"id\": \"batch_abc123\",\n \"object\": \"batch\",\n \"endpoint\": \"/v1/chat/completions\",\n \ \"model\": \"gpt-6-astra\",\n \"errors\": null,\n \"input_file_id\": \"file-abc123\",\n \ \"completion_window\": \"24h\",\n \"status\": \"completed\",\n \"output_file_id\": \"file-cvaTdG\",\n \ \"error_file_id\": \"file-HOWS94\",\n \"created_at\": 1711471533,\n \"in_progress_at\": 1711471538,\n \"expires_at\": 1711557933,\n \"finalizing_at\": 1711493133,\n \"completed_at\": 1711493163,\n \"failed_at\": null,\n \"expired_at\": null,\n \"cancelling_at\": null,\n \"cancelled_at\": null,\n \"request_counts\": {\n \"total\": 100,\n \"completed\": 95,\n \"failed\": 5\n },\n \"usage\": {\n \"input_tokens\": 1500,\n \"input_tokens_details\": {\n \"cached_tokens\": 1024\n },\n \"output_tokens\": 500,\n \"output_tokens_details\": {\n \"reasoning_tokens\": 300\n },\n \"total_tokens\": 2000\n },\n \"metadata\": {\n \"customer_id\": \"user_123456789\",\n \ \"batch_description\": \"Nightly eval job\",\n }\n}\n" PromptCacheHitDiagnosticsBody: properties: type: type: string enum: - cache_hit default: cache_hit x-stainless-const: true type: object required: - type TranscriptTextUsageTokens: type: object title: Token Usage description: Usage statistics for models billed by token usage. properties: type: type: string enum: - tokens description: The type of the usage object. Always `tokens` for this variant. x-stainless-const: true input_tokens: type: integer description: Number of input tokens billed for this request. input_token_details: type: object description: Details about the input tokens billed for this request. properties: text_tokens: type: integer description: Number of text tokens billed for this request. audio_tokens: type: integer description: Number of audio tokens billed for this request. output_tokens: type: integer description: Number of output tokens generated. total_tokens: type: integer description: Total number of tokens used (input + output). required: - type - input_tokens - output_tokens - total_tokens Program: properties: type: type: string enum: - program description: The type of the item. Always `program`. default: program x-stainless-const: true id: type: string description: The unique ID of the program item. call_id: type: string description: The stable call ID of the program item. code: type: string description: The JavaScript source executed by programmatic tool calling. fingerprint: type: string description: Opaque program replay fingerprint that must be round-tripped. type: object required: - type - id - call_id - code - fingerprint ApplyPatchCreateFileOperationParam: properties: type: type: string enum: - create_file description: The operation type. Always `create_file`. default: create_file x-stainless-const: true path: type: string minLength: 1 description: Path of the file to create relative to the workspace root. diff: type: string maxLength: 10485760 description: Unified diff content to apply when creating the file. type: object required: - type - path - diff title: Apply patch create file operation description: Instruction for creating a new file via the apply_patch tool. OutputItem: oneOf: - $ref: '#/components/schemas/OutputMessage' - $ref: '#/components/schemas/FileSearchToolCall' - $ref: '#/components/schemas/FunctionToolCall' - $ref: '#/components/schemas/FunctionToolCallOutputResource' - $ref: '#/components/schemas/WebSearchToolCall' - $ref: '#/components/schemas/ComputerToolCall' - $ref: '#/components/schemas/ComputerToolCallOutputResource' - $ref: '#/components/schemas/ReasoningItem' - $ref: '#/components/schemas/Program' - $ref: '#/components/schemas/ProgramOutput' - $ref: '#/components/schemas/ToolSearchCall' - $ref: '#/components/schemas/ToolSearchOutput' - $ref: '#/components/schemas/AdditionalTools' - $ref: '#/components/schemas/CompactionBody' - $ref: '#/components/schemas/ImageGenToolCall' - $ref: '#/components/schemas/CodeInterpreterToolCall' - $ref: '#/components/schemas/LocalShellToolCall' - $ref: '#/components/schemas/LocalShellToolCallOutput' - $ref: '#/components/schemas/FunctionShellCall' - $ref: '#/components/schemas/FunctionShellCallOutput' - $ref: '#/components/schemas/ApplyPatchToolCall' - $ref: '#/components/schemas/ApplyPatchToolCallOutput' - $ref: '#/components/schemas/MCPToolCall' - $ref: '#/components/schemas/MCPListTools' - $ref: '#/components/schemas/MCPApprovalRequest' - $ref: '#/components/schemas/MCPApprovalResponseResource' - $ref: '#/components/schemas/CustomToolCall' - $ref: '#/components/schemas/CustomToolCallOutputResource' discriminator: propertyName: type CreateTranscriptionResponseStreamEvent: anyOf: - $ref: '#/components/schemas/TranscriptTextSegmentEvent' - $ref: '#/components/schemas/TranscriptTextDeltaEvent' - $ref: '#/components/schemas/TranscriptTextDoneEvent' discriminator: propertyName: type TranscriptionInclude: type: string enum: - logprobs default: [] MCPListToolsTool: type: object title: MCP list tools tool description: 'A tool available on an MCP server. ' properties: name: type: string description: 'The name of the tool. ' description: anyOf: - type: string description: 'The description of the tool. ' - type: 'null' input_schema: type: object description: 'The JSON schema describing the tool''s input. ' annotations: anyOf: - type: object description: 'Additional annotations about the tool. ' - type: 'null' required: - name - input_schema FunctionAndCustomToolCallOutput: oneOf: - $ref: '#/components/schemas/InputTextContent' - $ref: '#/components/schemas/InputImageContent' - $ref: '#/components/schemas/InputFileContent' discriminator: propertyName: type ChatCompletionAllowedToolsChoice: type: object title: Allowed tools description: 'Constrains the tools available to the model to a pre-defined set. ' properties: type: type: string enum: - allowed_tools description: Allowed tool configuration type. Always `allowed_tools`. x-stainless-const: true allowed_tools: $ref: '#/components/schemas/ChatCompletionAllowedTools' required: - type - allowed_tools ChatCompletionRequestMessageContentPartRefusal: type: object title: Refusal content part properties: type: type: string enum: - refusal description: The type of the content part. x-stainless-const: true refusal: type: string description: The refusal message generated by the model. required: - type - refusal ProgramOutputStatus: type: string enum: - completed - incomplete ChatCompletionRequestMessageContentPartText: type: object title: Text content part description: 'Learn about [text inputs](https://developers.openai.com/api/docs/guides/text). ' properties: type: type: string enum: - text description: The type of the content part. x-stainless-const: true text: type: string description: The text content. prompt_cache_breakpoint: $ref: '#/components/schemas/PromptCacheBreakpointParam' required: - type - text ProgramOutputItemStatus: type: string enum: - completed - incomplete CustomToolCallOutputResource: title: ResponseCustomToolCallOutputItem allOf: - $ref: '#/components/schemas/CustomToolCallOutput' - type: object properties: id: type: string description: 'The unique ID of the custom tool call output item. ' status: description: 'The status of the item. One of `in_progress`, `completed`, or `incomplete`. Populated when items are returned via API. ' $ref: '#/components/schemas/FunctionCallOutputStatusEnum' created_by: type: string description: 'The identifier of the actor that created the item. ' required: - id - status VectorStoreFileAttributes: anyOf: - type: object description: 'Set of 16 key-value pairs that can be attached to an object. This can be useful for storing additional information about the object in a structured format, and querying for objects via API or the dashboard. Keys are strings with a maximum length of 64 characters. Values are strings with a maximum length of 512 characters, booleans, or numbers. ' maxProperties: 16 propertyNames: type: string maxLength: 64 additionalProperties: oneOf: - type: string maxLength: 512 - type: number - type: boolean x-oaiTypeLabel: map - type: 'null' ChatCompletionFunctionCallOption: type: object description: 'Specifying a particular function via `{"name": "my_function"}` forces the model to call that function. ' properties: name: type: string description: The name of the function to call. required: - name ResponseWebSearchCallInProgressEvent: type: object description: Emitted when a web search call is initiated. properties: type: type: string description: 'The type of the event. Always `response.web_search_call.in_progress`. ' enum: - response.web_search_call.in_progress x-stainless-const: true output_index: type: integer description: 'The index of the output item that the web search call is associated with. ' item_id: type: string description: 'Unique ID for the output item associated with the web search call. ' sequence_number: type: integer description: The sequence number of the web search call being processed. required: - type - output_index - item_id - sequence_number x-oaiMeta: name: response.web_search_call.in_progress group: responses example: "{\n \"type\": \"response.web_search_call.in_progress\",\n \"output_index\": 0,\n \"item_id\": \"ws_123\",\n \"sequence_number\": 0\n}\n" ChatCompletionRequestSystemMessageContentPart: oneOf: - $ref: '#/components/schemas/ChatCompletionRequestMessageContentPartText' WebSearchActionSearch: type: object title: Search action description: 'Action type "search" - Performs a web search query. ' properties: type: type: string enum: - search description: 'The action type. ' x-stainless-const: true query: type: string deprecated: true description: 'The search query. ' queries: type: array title: Search queries description: 'The search queries. ' items: type: string description: 'A search query. ' sources: type: array title: Web search sources description: 'The sources used in the search. ' items: type: object title: Web search source description: 'A source used in the search. ' properties: type: type: string enum: - url description: 'The type of source. Always `url`. ' x-stainless-const: true url: type: string format: uri description: 'The URL of the source. ' required: - type - url required: - type FunctionShellCallOutputExitOutcome: properties: type: type: string enum: - exit description: The outcome type. Always `exit`. default: exit x-stainless-const: true exit_code: type: integer description: Exit code from the shell process. type: object required: - type - exit_code title: Shell call exit outcome description: Indicates that the shell commands finished and returned an exit code. InputParam: description: 'Text, image, or file inputs to the model, used to generate a response. Learn more: - [Text inputs and outputs](https://developers.openai.com/api/docs/guides/text) - [Image inputs](https://developers.openai.com/api/docs/guides/images-vision) - [File inputs](https://developers.openai.com/api/docs/guides/file-inputs) - [Conversation state](https://developers.openai.com/api/docs/guides/conversation-state) - [Function calling](https://developers.openai.com/api/docs/guides/function-calling) ' oneOf: - type: string title: Text input description: 'A text input to the model, equivalent to a text input with the `user` role. ' - type: array title: Input item list description: 'A list of one or many input items to the model, containing different content types. ' items: $ref: '#/components/schemas/InputItem' ChatCompletionMessageToolCallChunk: type: object properties: index: type: integer id: type: string description: The ID of the tool call. type: type: string enum: - function description: The type of the tool. Currently, only `function` is supported. x-stainless-const: true function: type: object properties: name: type: string description: The name of the function to call. arguments: type: string description: The arguments to call the function with, as generated by the model in JSON format. Note that the model does not always generate valid JSON, and may hallucinate parameters not defined by your function schema. Validate the arguments in your code before calling your function. required: - index ComputerCallOutputItemParam: properties: id: anyOf: - type: string description: The ID of the computer tool call output. example: cuo_123 - type: 'null' call_id: type: string maxLength: 64 minLength: 1 description: The ID of the computer tool call that produced the output. type: type: string enum: - computer_call_output description: The type of the computer tool call output. Always `computer_call_output`. default: computer_call_output x-stainless-const: true output: $ref: '#/components/schemas/ComputerScreenshotImage' acknowledged_safety_checks: anyOf: - items: $ref: '#/components/schemas/ComputerCallSafetyCheckParam' type: array description: The safety checks reported by the API that have been acknowledged by the developer. - type: 'null' status: anyOf: - $ref: '#/components/schemas/FunctionCallItemStatus' description: The status of the message input. One of `in_progress`, `completed`, or `incomplete`. Populated when input items are returned via API. - type: 'null' type: object required: - call_id - type - output title: Computer tool call output description: The output of a computer tool call. GrammarSyntax1: type: string enum: - lark - regex ResponseWebSearchCallCompletedEvent: type: object description: Emitted when a web search call is completed. properties: type: type: string description: 'The type of the event. Always `response.web_search_call.completed`. ' enum: - response.web_search_call.completed x-stainless-const: true output_index: type: integer description: 'The index of the output item that the web search call is associated with. ' item_id: type: string description: 'Unique ID for the output item associated with the web search call. ' sequence_number: type: integer description: The sequence number of the web search call being processed. required: - type - output_index - item_id - sequence_number x-oaiMeta: name: response.web_search_call.completed group: responses example: "{\n \"type\": \"response.web_search_call.completed\",\n \"output_index\": 0,\n \"item_id\": \"ws_123\",\n \"sequence_number\": 0\n}\n" ResponseCustomToolCallInputDeltaEvent: title: ResponseCustomToolCallInputDelta type: object description: 'Event representing a delta (partial update) to the input of a custom tool call. ' properties: type: type: string enum: - response.custom_tool_call_input.delta description: The event type identifier. x-stainless-const: true sequence_number: type: integer description: The sequence number of this event. output_index: type: integer description: The index of the output this delta applies to. item_id: type: string description: Unique identifier for the API item associated with this event. delta: type: string description: The incremental input data (delta) for the custom tool call. required: - type - output_index - item_id - delta - sequence_number x-oaiMeta: name: response.custom_tool_call_input.delta group: responses example: "{\n \"type\": \"response.custom_tool_call_input.delta\",\n \"output_index\": 0,\n \ \"item_id\": \"ctc_1234567890abcdef\",\n \"delta\": \"partial input text\"\n}\n" ModelResponseProperties: type: object properties: metadata: $ref: '#/components/schemas/Metadata' top_logprobs: anyOf: - description: 'An integer between 0 and 20 specifying the maximum number of most likely tokens to return at each token position, each with an associated log probability. In some cases, the number of returned tokens may be fewer than requested. ' type: integer minimum: 0 maximum: 20 - type: 'null' temperature: anyOf: - type: number minimum: 0 maximum: 2 default: 1 example: 1 description: 'What sampling temperature to use, between 0 and 2. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. We generally recommend altering this or `top_p` but not both. ' - type: 'null' top_p: anyOf: - type: number minimum: 0 maximum: 1 default: 1 example: 1 description: 'An alternative to sampling with temperature, called nucleus sampling, where the model considers the results of the tokens with top_p probability mass. So 0.1 means only the tokens comprising the top 10% probability mass are considered. We generally recommend altering this or `temperature` but not both. ' - type: 'null' user: type: string example: user-1234 deprecated: true description: '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](https://developers.openai.com/api/docs/guides/safety-best-practices#implement-safety-identifiers). ' safety_identifier: anyOf: - type: string maxLength: 64 example: safety-identifier-1234 description: '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](https://developers.openai.com/api/docs/guides/safety-best-practices#implement-safety-identifiers). ' - type: 'null' prompt_cache_key: anyOf: - type: string example: prompt-cache-key-1234 description: 'Used by OpenAI to cache responses for similar requests to optimize your cache hit rates. Replaces the `user` field. [Learn more](https://developers.openai.com/api/docs/guides/prompt-caching). ' - type: 'null' prompt_cache_retention: deprecated: true anyOf: - type: string enum: - in_memory - 24h description: "Deprecated. Use `prompt_cache_options.ttl` instead.\n\nThe retention policy for the prompt cache. Set to `24h` to enable extended prompt caching, which keeps cached prefixes active for longer, up to a maximum of 24 hours. [Learn more](https://developers.openai.com/api/docs/guides/prompt-caching#prompt-cache-retention).\nThis field expresses a maximum retention policy, while\n`prompt_cache_options.ttl` expresses a minimum cache lifetime. The two\nfields are independent and do not interact.\nFor `gpt-5.5`, `gpt-5.5-pro`, and future models, only `24h` is supported.\n\nFor older models that support both `in_memory` and `24h`, the default depends on your organization's data retention policy:\n \ - Organizations without ZDR enabled default to `24h`.\n - Organizations with ZDR enabled default to `in_memory` when `prompt_cache_retention` is not specified.\n" - type: 'null' ApplyPatchCallStatusParam: type: string enum: - in_progress - completed title: Apply patch call status description: Status values reported for apply_patch tool calls. ResponseError: anyOf: - type: object description: 'An error object returned when the model fails to generate a Response. ' properties: code: $ref: '#/components/schemas/ResponseErrorCode' message: type: string description: 'A human-readable description of the error. ' misalignment: $ref: '#/components/schemas/MisalignmentErrorDetailsResource' required: - code - message - type: 'null' WebSearchLocation: type: object title: Web search location description: Approximate location parameters for the search. properties: country: type: string description: "The two-letter \n[ISO country code](https://en.wikipedia.org/wiki/ISO_3166-1) of the user,\ne.g. `US`.\n" region: type: string description: 'Free text input for the region of the user, e.g. `California`. ' city: type: string description: 'Free text input for the city of the user, e.g. `San Francisco`. ' timezone: type: string description: "The [IANA timezone](https://timeapi.io/documentation/iana-timezones) \nof the user, e.g. `America/Los_Angeles`.\n" WaitParam: properties: type: type: string enum: - wait description: Specifies the event type. For a wait action, this property is always set to `wait`. default: wait x-stainless-const: true type: object required: - type title: Wait description: A wait action. OutputMessage: type: object title: Output message description: 'An output message from the model. ' properties: id: type: string description: 'The unique ID of the output message. ' type: type: string description: 'The type of the output message. Always `message`. ' enum: - message x-stainless-const: true role: type: string description: 'The role of the output message. Always `assistant`. ' enum: - assistant x-stainless-const: true content: type: array description: 'The content of the output message. ' items: $ref: '#/components/schemas/OutputMessageContent' phase: anyOf: - $ref: '#/components/schemas/MessagePhase' - type: 'null' status: type: string description: 'The status of the message input. One of `in_progress`, `completed`, or `incomplete`. Populated when input items are returned via API. ' enum: - in_progress - completed - incomplete required: - id - type - role - content - status ChatCompletionList: type: object title: ChatCompletionList description: 'An object representing a list of Chat Completions. ' properties: object: type: string enum: - list default: list description: 'The type of this object. It is always set to "list". ' x-stainless-const: true data: type: array description: 'An array of chat completion objects. ' items: $ref: '#/components/schemas/CreateChatCompletionResponse' first_id: type: string description: The identifier of the first chat completion in the data array. last_id: type: string description: The identifier of the last chat completion in the data array. has_more: type: boolean description: Indicates whether there are more Chat Completions available. required: - object - data - first_id - last_id - has_more x-oaiMeta: name: The chat completion list object group: chat example: "{\n \"object\": \"list\",\n \"data\": [\n {\n \"object\": \"chat.completion\",\n \ \"id\": \"chatcmpl-AyPNinnUqUDYo9SAdA52NobMflmj2\",\n \"model\": \"gpt-6-astra\",\n \ \"created\": 1738960610,\n \"request_id\": \"req_ded8ab984ec4bf840f37566c1011c417\",\n \ \"tool_choice\": null,\n \"usage\": {\n \"total_tokens\": 31,\n \"completion_tokens\": 18,\n \"prompt_tokens\": 13\n },\n \"seed\": 4944116822809979520,\n \"top_p\": 1.0,\n \"temperature\": 1.0,\n \"presence_penalty\": 0.0,\n \"frequency_penalty\": 0.0,\n \"system_fingerprint\": \"fp_50cad350e4\",\n \"input_user\": null,\n \"service_tier\": \"default\",\n \"tools\": null,\n \"metadata\": {},\n \"choices\": [\n {\n \ \"index\": 0,\n \"message\": {\n \"content\": \"Mind of circuits hum, \\nLearning patterns in silence— \\nFuture's quiet spark.\",\n \"role\": \"assistant\",\n \ \"tool_calls\": null,\n \"function_call\": null\n },\n \"finish_reason\": \"stop\",\n \"logprobs\": null\n }\n ],\n \"response_format\": null\n \ }\n ],\n \"first_id\": \"chatcmpl-AyPNinnUqUDYo9SAdA52NobMflmj2\",\n \"last_id\": \"chatcmpl-AyPNinnUqUDYo9SAdA52NobMflmj2\",\n \ \"has_more\": false\n}\n" ResponseReasoningSummaryTextDoneEvent: type: object description: Emitted when a reasoning summary text is completed. properties: type: type: string description: 'The type of the event. Always `response.reasoning_summary_text.done`. ' enum: - response.reasoning_summary_text.done x-stainless-const: true item_id: type: string description: 'The ID of the item this summary text is associated with. ' output_index: type: integer description: 'The index of the output item this summary text is associated with. ' summary_index: type: integer description: 'The index of the summary part within the reasoning summary. ' text: type: string description: 'The full text of the completed reasoning summary. ' sequence_number: type: integer description: 'The sequence number of this event. ' required: - type - item_id - output_index - summary_index - text - sequence_number x-oaiMeta: name: response.reasoning_summary_text.done group: responses example: "{\n \"type\": \"response.reasoning_summary_text.done\",\n \"item_id\": \"rs_6806bfca0b2481918a5748308061a2600d3ce51bdffd5476\",\n \ \"output_index\": 0,\n \"summary_index\": 0,\n \"text\": \"**Responding to a greeting**\\n\\nThe user just said, \\\"Hello!\\\" So, it seems I need to engage. I'll greet them back and offer help since they're looking to chat. I could say something like, \\\"Hello! How can I assist you today?\\\" That feels friendly and open. They didn't ask a specific question, so this approach will work well for starting a conversation. Let's see where it goes from there!\",\n \"sequence_number\": 1\n}\n" DirectToolCallCaller: properties: type: type: string enum: - direct default: direct x-stainless-const: true type: object required: - type CustomTextFormatParam: properties: type: type: string enum: - text description: Unconstrained text format. Always `text`. default: text x-stainless-const: true type: object required: - type title: Text format description: Unconstrained free-form text. ToolCallCaller: oneOf: - $ref: '#/components/schemas/DirectToolCallCaller' - $ref: '#/components/schemas/ProgramToolCallCaller' description: The execution context that produced this tool call. discriminator: propertyName: type ModerationPolicyParam: properties: input: anyOf: - $ref: '#/components/schemas/ModerationConfigParam' description: The moderation policy for the response input. - type: 'null' output: anyOf: - $ref: '#/components/schemas/ModerationConfigParam' description: The moderation policy for the response output. - type: 'null' type: object required: [] description: The policy to apply to moderated response input and output. ToolSearchOutput: properties: type: type: string enum: - tool_search_output description: The type of the item. Always `tool_search_output`. default: tool_search_output x-stainless-const: true id: type: string description: The unique ID of the tool search output item. call_id: anyOf: - type: string description: The unique ID of the tool search call generated by the model. - type: 'null' execution: $ref: '#/components/schemas/ToolSearchExecutionType' description: Whether tool search was executed by the server or by the client. tools: items: $ref: '#/components/schemas/Tool' type: array description: The loaded tool definitions returned by tool search. status: $ref: '#/components/schemas/FunctionCallOutputStatusEnum' description: The status of the tool search output item that was recorded. created_by: type: string description: The identifier of the actor that created the item. type: object required: - type - id - call_id - execution - tools - status ImageGenTool: type: object title: Image generation tool description: 'A tool that generates images using the GPT image models. ' properties: type: type: string enum: - image_generation description: 'The type of the image generation tool. Always `image_generation`. ' x-stainless-const: true model: anyOf: - type: string - type: string enum: - gpt-image-1 - gpt-image-1-mini - gpt-image-1.5 - gpt-image-2 - gpt-image-2-2026-04-21 - gpt-image-2.5-sunburst - gpt-image-2.5-sunburst-2026-09-08 - gpt-image-2.5-flare - gpt-image-2.5-flare-2026-09-08 description: 'The image generation model to use. One of `gpt-image-1`, `gpt-image-1-mini`, `gpt-image-1.5`, `gpt-image-2`, `gpt-image-2-2026-04-21`, `gpt-image-2.5-sunburst`, `gpt-image-2.5-sunburst-2026-09-08`, `gpt-image-2.5-flare`, `gpt-image-2.5-flare-2026-09-08`, or `chatgpt-image-latest`. Default: `gpt-image-1`. ' default: gpt-image-1 quality: type: string enum: - low - medium - high - xhigh - max - auto description: 'The quality of the generated image. The GPT image models support `low`, `medium`, and `high`. `gpt-image-2.5-sunburst` and `gpt-image-2.5-flare`, including their `2026-09-08` snapshots, also support `xhigh` and `max`. Default: `auto`. ' default: auto size: anyOf: - type: string - type: string enum: - 1024x1024 - 1024x1536 - 1536x1024 - auto description: The size of the generated images. For `gpt-image-2`, `gpt-image-2-2026-04-21`, `gpt-image-2.5-sunburst`, `gpt-image-2.5-sunburst-2026-09-08`, `gpt-image-2.5-flare`, and `gpt-image-2.5-flare-2026-09-08`, arbitrary resolutions are supported as `WIDTHxHEIGHT` strings, for example `1536x864`. Width and height must both be divisible by 16 and the requested aspect ratio must be between 1:3 and 3:1. Resolutions above `2560x1440` are experimental, and the maximum supported resolution is `3840x2160`. The requested size must also satisfy the model's current pixel and edge limits. The standard sizes `1024x1024`, `1536x1024`, and `1024x1536` are supported by the GPT image models; `auto` is supported for models that allow automatic sizing. For `dall-e-2`, use one of `256x256`, `512x512`, or `1024x1024`. For `dall-e-3`, use one of `1024x1024`, `1792x1024`, or `1024x1792`. default: auto output_format: type: string enum: - png - webp - jpeg description: 'The output format of the generated image. One of `png`, `webp`, or `jpeg`. Default: `png`. ' default: png output_compression: type: integer minimum: 0 maximum: 100 description: 'Compression level for the output image. Default: 100. ' default: 100 moderation: type: string enum: - auto - low description: 'Moderation level for the generated image. Default: `auto`. ' default: auto background: type: string enum: - transparent - opaque - auto description: 'Set the background of the generated image. One of `transparent`, `opaque`, or `auto`. `gpt-image-2.5-sunburst` and `gpt-image-2.5-flare`, including their `2026-09-08` snapshots, support `opaque` and `transparent` backgrounds. Transparent backgrounds are available for supported GPT Image models. For `gpt-image-2` and `gpt-image-2-2026-04-21`, this support is in preview. When using `transparent`, set the output format to `png` or `webp`. Default: `auto`. ' default: auto input_fidelity: anyOf: - $ref: '#/components/schemas/InputFidelity' - type: 'null' input_image_mask: type: object description: 'Optional mask for inpainting. Contains `image_url` (string, optional) and `file_id` (string, optional). ' properties: image_url: type: string description: 'Base64-encoded mask image. ' file_id: type: string description: 'File ID for the mask image. ' required: [] additionalProperties: false partial_images: type: integer minimum: 0 maximum: 3 description: 'Number of partial images to generate in streaming mode, from 0 (default value) to 3. ' default: 0 action: description: 'Whether to generate a new image or edit an existing image. Default: `auto`. ' $ref: '#/components/schemas/ImageGenActionEnum' required: - type ResponseWebSearchCallSearchingEvent: type: object description: Emitted when a web search call is executing. properties: type: type: string description: 'The type of the event. Always `response.web_search_call.searching`. ' enum: - response.web_search_call.searching x-stainless-const: true output_index: type: integer description: 'The index of the output item that the web search call is associated with. ' item_id: type: string description: 'Unique ID for the output item associated with the web search call. ' sequence_number: type: integer description: The sequence number of the web search call being processed. required: - type - output_index - item_id - sequence_number x-oaiMeta: name: response.web_search_call.searching group: responses example: "{\n \"type\": \"response.web_search_call.searching\",\n \"output_index\": 0,\n \"item_id\": \"ws_123\",\n \"sequence_number\": 0\n}\n" CustomToolChatCompletions: type: object title: Custom tool description: 'A custom tool that processes input using a specified format. ' properties: type: type: string enum: - custom description: The type of the custom tool. Always `custom`. x-stainless-const: true custom: type: object title: Custom tool properties description: 'Properties of the custom tool. ' properties: name: type: string description: The name of the custom tool, used to identify it in tool calls. description: type: string description: 'Optional description of the custom tool, used to provide more context. ' format: description: 'The input format for the custom tool. Default is unconstrained text. ' oneOf: - type: object title: Text format description: Unconstrained free-form text. properties: type: type: string enum: - text description: Unconstrained text format. Always `text`. x-stainless-const: true required: - type additionalProperties: false - type: object title: Grammar format description: A grammar defined by the user. properties: type: type: string enum: - grammar description: Grammar format. Always `grammar`. x-stainless-const: true grammar: type: object title: Grammar format description: Your chosen grammar. properties: definition: type: string description: The grammar definition. syntax: type: string description: The syntax of the grammar definition. One of `lark` or `regex`. enum: - lark - regex required: - definition - syntax required: - type - grammar additionalProperties: false required: - name required: - type - custom Error: type: object properties: code: anyOf: - type: string - type: 'null' message: type: string param: anyOf: - type: string - type: 'null' type: type: string misalignment: $ref: '#/components/schemas/MisalignmentErrorDetailsResource' required: - type - message - param - code ResponseReasoningSummaryPartDoneEvent: type: object description: Emitted when a reasoning summary part is completed. properties: type: type: string description: 'The type of the event. Always `response.reasoning_summary_part.done`. ' enum: - response.reasoning_summary_part.done x-stainless-const: true item_id: type: string description: 'The ID of the item this summary part is associated with. ' output_index: type: integer description: 'The index of the output item this summary part is associated with. ' summary_index: type: integer description: 'The index of the summary part within the reasoning summary. ' status: type: string description: 'The completion status of the summary part. Omitted when the part completed normally and set to `incomplete` when generation was interrupted. ' enum: - incomplete sequence_number: type: integer description: 'The sequence number of this event. ' part: type: object description: 'The completed summary part. ' properties: type: type: string description: The type of the summary part. Always `summary_text`. enum: - summary_text x-stainless-const: true text: type: string description: The text of the summary part. required: - type - text required: - type - item_id - output_index - summary_index - part - sequence_number x-oaiMeta: name: response.reasoning_summary_part.done group: responses example: "{\n \"type\": \"response.reasoning_summary_part.done\",\n \"item_id\": \"rs_6806bfca0b2481918a5748308061a2600d3ce51bdffd5476\",\n \ \"output_index\": 0,\n \"summary_index\": 0,\n \"part\": {\n \"type\": \"summary_text\",\n \ \"text\": \"**Responding to a greeting**\\n\\nThe user just said, \\\"Hello!\\\" So, it seems I need to engage. I'll greet them back and offer help since they're looking to chat. I could say something like, \\\"Hello! How can I assist you today?\\\" That feels friendly and open. They didn't ask a specific question, so this approach will work well for starting a conversation. Let's see where it goes from there!\"\n },\n \"sequence_number\": 1\n}\n" FunctionTool: properties: type: type: string enum: - function description: The type of the function tool. Always `function`. default: function x-stainless-const: true name: type: string description: The name of the function to call. async: type: boolean description: anyOf: - type: string description: A description of the function. Used by the model to determine whether or not to call the function. - type: 'null' parameters: anyOf: - additionalProperties: {} type: object description: A JSON schema object describing the parameters of the function. x-oaiTypeLabel: map - type: 'null' output_schema: anyOf: - additionalProperties: {} type: object description: A JSON schema object describing the JSON value encoded in string outputs for this function. x-oaiTypeLabel: map - type: 'null' strict: anyOf: - type: boolean description: Whether strict parameter validation is enforced for this function tool. - type: 'null' defer_loading: type: boolean description: Whether this function is deferred and loaded via tool search. allowed_callers: anyOf: - items: $ref: '#/components/schemas/CallableToolAllowedCaller' type: array description: The tool invocation context(s). - type: 'null' type: object required: - type - name - strict - parameters title: Function description: Defines a function in your own code the model can choose to call. Learn more about [function calling](https://developers.openai.com/api/docs/guides/function-calling). ResponseMCPListToolsInProgressEvent: type: object title: ResponseMCPListToolsInProgressEvent description: 'Emitted when the system is in the process of retrieving the list of available MCP tools. ' properties: type: type: string enum: - response.mcp_list_tools.in_progress description: The type of the event. Always 'response.mcp_list_tools.in_progress'. x-stainless-const: true item_id: type: string description: The ID of the MCP tool call item that is being processed. output_index: type: integer description: The index of the output item that is being processed. sequence_number: type: integer description: The sequence number of this event. required: - type - item_id - output_index - sequence_number x-oaiMeta: name: response.mcp_list_tools.in_progress group: responses example: "{\n \"type\": \"response.mcp_list_tools.in_progress\",\n \"sequence_number\": 1,\n \ \"output_index\": 0,\n \"item_id\": \"mcpl_682d4379df088191886b70f4ec39f90403937d5f622d7a90\"\n}\n" InputTextContent: properties: type: type: string enum: - input_text description: The type of the input item. Always `input_text`. default: input_text x-stainless-const: true text: type: string description: The text input to the model. prompt_cache_breakpoint: $ref: '#/components/schemas/PromptCacheBreakpointConfig' type: object required: - type - text title: Input text description: A text input to the model. ComputerActionList: title: Computer Action List type: array description: 'Flattened batched actions for `computer_use`. Each action includes an `type` discriminator and action-specific fields. ' items: $ref: '#/components/schemas/ComputerAction' ApplyPatchToolParam: properties: type: type: string enum: - apply_patch description: The type of the tool. Always `apply_patch`. default: apply_patch x-stainless-const: true allowed_callers: anyOf: - items: $ref: '#/components/schemas/CallableToolAllowedCaller' type: array minItems: 1 description: The tool invocation context(s). - type: 'null' type: object required: - type title: Apply patch tool description: Allows the assistant to create, delete, or update files using unified diffs. CreateTranscriptionResponseJson: type: object description: Represents a transcription response returned by model, based on the provided input. properties: text: type: string description: The transcribed text. languages: type: array description: 'The languages detected in the audio. Returned by `gpt-transcribe`. An empty array indicates that no language could be reliably detected. ' items: $ref: '#/components/schemas/TranscriptionLanguage' logprobs: type: array optional: true description: 'The log probabilities of the tokens in the transcription. Only returned with the models `gpt-4o-transcribe` and `gpt-4o-mini-transcribe` if `logprobs` is added to the `include` array. ' items: type: object properties: token: type: string description: The token in the transcription. logprob: type: number description: The log probability of the token. bytes: type: array items: type: number description: The bytes of the token. usage: type: object description: Token usage statistics for the request. oneOf: - $ref: '#/components/schemas/TranscriptTextUsageTokens' title: Token Usage - $ref: '#/components/schemas/TranscriptTextUsageDuration' title: Duration Usage required: - text x-oaiMeta: name: The transcription object (JSON) group: audio example: "{\n \"text\": \"Imagine the wildest idea that you've ever had, and you're curious about how it might scale to something that's a 100, a 1,000 times bigger. This is a place where you can get to do that.\",\n \"usage\": {\n \"type\": \"tokens\",\n \"input_tokens\": 14,\n \ \"input_token_details\": {\n \"text_tokens\": 10,\n \"audio_tokens\": 4\n },\n \ \"output_tokens\": 101,\n \"total_tokens\": 115\n }\n}\n" CustomGrammarFormatParam: properties: type: type: string enum: - grammar description: Grammar format. Always `grammar`. default: grammar x-stainless-const: true syntax: $ref: '#/components/schemas/GrammarSyntax1' description: The syntax of the grammar definition. One of `lark` or `regex`. definition: type: string description: The grammar definition. type: object required: - type - syntax - definition title: Grammar format description: A grammar defined by the user. PromptCacheBreakpointParam: properties: mode: type: string enum: - explicit description: The breakpoint mode. Always `explicit`. default: explicit x-stainless-const: true type: object required: - mode title: Prompt cache breakpoint description: Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL from the request's `prompt_cache_options.ttl`; the boundary is not rounded to a token block. ListBatchesResponse: type: object properties: data: type: array items: $ref: '#/components/schemas/Batch' first_id: type: string example: batch_abc123 last_id: type: string example: batch_abc456 has_more: type: boolean object: type: string enum: - list x-stainless-const: true required: - object - data - has_more InputContent: oneOf: - $ref: '#/components/schemas/InputTextContent' - $ref: '#/components/schemas/InputImageContent' - $ref: '#/components/schemas/InputFileContent' discriminator: propertyName: type ChatCompletionAllowedTools: type: object title: Allowed tools description: 'Constrains the tools available to the model to a pre-defined set. ' properties: mode: type: string enum: - auto - required description: 'Constrains the tools available to the model to a pre-defined set. `auto` allows the model to pick from among the allowed tools and generate a message. `required` requires the model to call one or more of the allowed tools. ' tools: type: array description: "A list of tool definitions that the model should be allowed to call.\n\nFor the Chat Completions API, the list of tool definitions might look like:\n```json\n[\n { \"type\": \"function\", \"function\": { \"name\": \"get_weather\" } },\n { \"type\": \"function\", \"function\": { \"name\": \"get_time\" } }\n]\n```\n" items: type: object x-oaiExpandable: false description: 'A tool definition that the model should be allowed to call. ' additionalProperties: true required: - mode - tools ReasoningModeEnum: anyOf: - type: string - type: string enum: - standard - pro ResponseStreamEvent: description: Event emitted while a response is streamed. anyOf: - $ref: '#/components/schemas/ResponseAudioDeltaEvent' - $ref: '#/components/schemas/ResponseAudioDoneEvent' - $ref: '#/components/schemas/ResponseAudioTranscriptDeltaEvent' - $ref: '#/components/schemas/ResponseAudioTranscriptDoneEvent' - $ref: '#/components/schemas/ResponseCodeInterpreterCallCodeDeltaEvent' - $ref: '#/components/schemas/ResponseCodeInterpreterCallCodeDoneEvent' - $ref: '#/components/schemas/ResponseCodeInterpreterCallCompletedEvent' - $ref: '#/components/schemas/ResponseCodeInterpreterCallInProgressEvent' - $ref: '#/components/schemas/ResponseCodeInterpreterCallInterpretingEvent' - $ref: '#/components/schemas/ResponseCompletedEvent' - $ref: '#/components/schemas/ResponseContentPartAddedEvent' - $ref: '#/components/schemas/ResponseContentPartDoneEvent' - $ref: '#/components/schemas/ResponseCreatedEvent' - $ref: '#/components/schemas/ResponseErrorEvent' - $ref: '#/components/schemas/ResponseFileSearchCallCompletedEvent' - $ref: '#/components/schemas/ResponseFileSearchCallInProgressEvent' - $ref: '#/components/schemas/ResponseFileSearchCallSearchingEvent' - $ref: '#/components/schemas/ResponseFunctionCallArgumentsDeltaEvent' - $ref: '#/components/schemas/ResponseFunctionCallArgumentsDoneEvent' - $ref: '#/components/schemas/ResponseShellCallCommandAddedStreamingEvent' - $ref: '#/components/schemas/ResponseShellCallCommandDeltaStreamingEvent' - $ref: '#/components/schemas/ResponseShellCallCommandDoneStreamingEvent' - $ref: '#/components/schemas/ResponseShellCallOutputContentDeltaStreamingEvent' x-stainless-skip: - go - $ref: '#/components/schemas/ResponseShellCallOutputContentDoneStreamingEvent' - $ref: '#/components/schemas/ResponseInProgressEvent' - $ref: '#/components/schemas/ResponseFailedEvent' - $ref: '#/components/schemas/ResponseIncompleteEvent' - $ref: '#/components/schemas/ResponseOutputItemAddedEvent' - $ref: '#/components/schemas/ResponseOutputItemDoneEvent' - $ref: '#/components/schemas/ResponseReasoningSummaryPartAddedEvent' - $ref: '#/components/schemas/ResponseReasoningSummaryPartDoneEvent' - $ref: '#/components/schemas/ResponseReasoningSummaryTextDeltaEvent' - $ref: '#/components/schemas/ResponseReasoningSummaryTextDoneEvent' - $ref: '#/components/schemas/ResponseReasoningTextDeltaEvent' - $ref: '#/components/schemas/ResponseReasoningTextDoneEvent' - $ref: '#/components/schemas/ResponseRefusalDeltaEvent' - $ref: '#/components/schemas/ResponseRefusalDoneEvent' - $ref: '#/components/schemas/ResponseTextDeltaEvent' - $ref: '#/components/schemas/ResponseTextDoneEvent' - $ref: '#/components/schemas/ResponseWebSearchCallCompletedEvent' - $ref: '#/components/schemas/ResponseWebSearchCallInProgressEvent' - $ref: '#/components/schemas/ResponseWebSearchCallSearchingEvent' - $ref: '#/components/schemas/ResponseImageGenCallCompletedEvent' - $ref: '#/components/schemas/ResponseImageGenCallGeneratingEvent' - $ref: '#/components/schemas/ResponseImageGenCallInProgressEvent' - $ref: '#/components/schemas/ResponseImageGenCallPartialImageEvent' - $ref: '#/components/schemas/ResponseMCPCallArgumentsDeltaEvent' - $ref: '#/components/schemas/ResponseMCPCallArgumentsDoneEvent' - $ref: '#/components/schemas/ResponseMCPCallCompletedEvent' - $ref: '#/components/schemas/ResponseMCPCallFailedEvent' - $ref: '#/components/schemas/ResponseMCPCallInProgressEvent' - $ref: '#/components/schemas/ResponseMCPListToolsCompletedEvent' - $ref: '#/components/schemas/ResponseMCPListToolsFailedEvent' - $ref: '#/components/schemas/ResponseMCPListToolsInProgressEvent' - $ref: '#/components/schemas/ResponseOutputTextAnnotationAddedEvent' - $ref: '#/components/schemas/ResponseQueuedEvent' - $ref: '#/components/schemas/ResponseCustomToolCallInputDeltaEvent' - $ref: '#/components/schemas/ResponseCustomToolCallInputDoneEvent' discriminator: propertyName: type FileSearchTool: properties: type: type: string enum: - file_search description: The type of the file search tool. Always `file_search`. default: file_search x-stainless-const: true vector_store_ids: items: type: string type: array description: The IDs of the vector stores to search. max_num_results: type: integer description: The maximum number of results to return. This number should be between 1 and 50 inclusive. ranking_options: $ref: '#/components/schemas/RankingOptions' description: Ranking options for search. filters: anyOf: - $ref: '#/components/schemas/Filters' description: A filter to apply. - type: 'null' type: object required: - type - vector_store_ids title: File search description: A tool that searches for relevant content from uploaded files. Learn more about the [file search tool](https://developers.openai.com/api/docs/guides/tools-file-search). ComputerEnvironment: type: string enum: - windows - mac - linux - ubuntu - browser Prompt: anyOf: - type: object description: 'Reference to a prompt template and its variables. [Learn more](https://developers.openai.com/api/docs/guides/text?api-mode=responses#version-prompts-in-code). ' required: - id properties: id: type: string description: The unique identifier of the prompt template to use. version: anyOf: - type: string description: Optional version of the prompt template. - type: 'null' variables: $ref: '#/components/schemas/ResponsePromptVariables' - type: 'null' SkillReferenceParam: properties: type: type: string enum: - skill_reference description: References a skill created with the /v1/skills endpoint. default: skill_reference x-stainless-const: true skill_id: type: string maxLength: 64 minLength: 1 description: The ID of the referenced skill. version: type: string description: Optional skill version. Use a positive integer or 'latest'. Omit for default. type: object required: - type - skill_id DeleteModelResponse: type: object properties: id: type: string deleted: type: boolean object: type: string required: - id - object - deleted ChatCompletionRequestFunctionMessage: type: object title: Function message deprecated: true properties: role: type: string enum: - function description: The role of the messages author, in this case `function`. x-stainless-const: true content: anyOf: - type: string description: The contents of the function message. - type: 'null' name: type: string description: The name of the function to call. required: - role - content - name ScrollParam: properties: type: type: string enum: - scroll description: Specifies the event type. For a scroll action, this property is always set to `scroll`. default: scroll x-stainless-const: true x: type: integer description: The x-coordinate where the scroll occurred. y: type: integer description: The y-coordinate where the scroll occurred. scroll_x: type: integer description: The horizontal scroll distance. scroll_y: type: integer description: The vertical scroll distance. keys: anyOf: - items: type: string type: array description: The keys being held while scrolling. - type: 'null' type: object required: - type - x - y - scroll_x - scroll_y title: Scroll description: A scroll action. ComputerScreenshotImage: type: object description: 'A computer screenshot image used with the computer use tool. ' properties: type: type: string enum: - computer_screenshot default: computer_screenshot description: "Specifies the event type. For a computer screenshot, this property is \nalways set to `computer_screenshot`.\n" x-stainless-const: true image_url: type: string format: uri description: The URL of the screenshot image. file_id: type: string description: The identifier of an uploaded file that contains the screenshot. required: - type MCPToolExecutionError: properties: type: type: string enum: - mcp_tool_execution_error default: mcp_tool_execution_error x-stainless-const: true content: {} type: object required: - type - content ChatCompletionRequestMessageContentPartFile: type: object title: File content part description: 'Learn about [file inputs](https://developers.openai.com/api/docs/guides/text) for text generation. ' properties: type: type: string enum: - file description: The type of the content part. Always `file`. x-stainless-const: true file: type: object properties: filename: type: string description: 'The name of the file, used when passing the file to the model as a string. ' file_data: type: string description: 'The base64 encoded file data, used when passing the file to the model as a string. ' file_id: type: string description: 'The ID of an uploaded file to use as input. ' prompt_cache_breakpoint: $ref: '#/components/schemas/PromptCacheBreakpointParam' required: - type - file ResponseFileSearchCallInProgressEvent: type: object description: Emitted when a file search call is initiated. properties: type: type: string description: 'The type of the event. Always `response.file_search_call.in_progress`. ' enum: - response.file_search_call.in_progress x-stainless-const: true output_index: type: integer description: 'The index of the output item that the file search call is initiated. ' item_id: type: string description: 'The ID of the output item that the file search call is initiated. ' sequence_number: type: integer description: The sequence number of this event. required: - type - output_index - item_id - sequence_number x-oaiMeta: name: response.file_search_call.in_progress group: responses example: "{\n \"type\": \"response.file_search_call.in_progress\",\n \"output_index\": 0,\n \ \"item_id\": \"fs_123\",\n \"sequence_number\": 1\n}\n" ResponseInProgressEvent: type: object description: Emitted when the response is in progress. properties: type: type: string description: 'The type of the event. Always `response.in_progress`. ' enum: - response.in_progress x-stainless-const: true response: $ref: '#/components/schemas/Response' description: 'The response that is in progress. ' sequence_number: type: integer description: The sequence number of this event. required: - type - response - sequence_number x-oaiMeta: name: response.in_progress group: responses example: "{\n \"type\": \"response.in_progress\",\n \"response\": {\n \"id\": \"resp_67ccfcdd16748190a91872c75d38539e09e4d4aac714747c\",\n \ \"object\": \"response\",\n \"created_at\": 1741487325,\n \"status\": \"in_progress\",\n \ \"completed_at\": null,\n \"error\": null,\n \"incomplete_details\": null,\n \"instructions\": null,\n \"max_output_tokens\": null,\n \"model\": \"gpt-6-astra\",\n \"output\": [],\n \ \"parallel_tool_calls\": true,\n \"previous_response_id\": null,\n \"reasoning\": {\n \"effort\": null,\n \"summary\": null\n },\n \"store\": true,\n \"temperature\": 1,\n \"text\": {\n \"format\": {\n \"type\": \"text\"\n }\n },\n \"tool_choice\": \"auto\",\n \"tools\": [],\n \"top_p\": 1,\n \"truncation\": \"disabled\",\n \"usage\": null,\n \"user\": null,\n \"metadata\": {}\n },\n \"sequence_number\": 1\n}\n" MCPTool: type: object title: MCP tool description: 'Give the model access to additional tools via remote Model Context Protocol (MCP) servers. [Learn more about MCP](https://developers.openai.com/api/docs/guides/tools-connectors-mcp). ' properties: type: type: string enum: - mcp description: The type of the MCP tool. Always `mcp`. x-stainless-const: true server_label: type: string description: 'A label for this MCP server, used to identify it in tool calls. ' server_url: type: string format: uri description: 'The URL for the MCP server. One of `server_url`, `connector_id`, or `tunnel_id` must be provided. ' connector_id: type: string enum: - connector_dropbox - connector_gmail - connector_googlecalendar - connector_googledrive - connector_microsoftteams - connector_outlookcalendar - connector_outlookemail - connector_sharepoint description: 'Identifier for service connectors, like those available in ChatGPT. One of `server_url`, `connector_id`, or `tunnel_id` must be provided. Learn more about service connectors [here](https://developers.openai.com/api/docs/guides/tools-connectors-mcp#connectors). Currently supported `connector_id` values are: - Dropbox: `connector_dropbox` - Gmail: `connector_gmail` - Google Calendar: `connector_googlecalendar` - Google Drive: `connector_googledrive` - Microsoft Teams: `connector_microsoftteams` - Outlook Calendar: `connector_outlookcalendar` - Outlook Email: `connector_outlookemail` - SharePoint: `connector_sharepoint` ' tunnel_id: type: string pattern: ^tunnel_[a-z0-9]{32}$ description: 'The Secure MCP Tunnel ID to use instead of a direct server URL. One of `server_url`, `connector_id`, or `tunnel_id` must be provided. ' authorization: type: string description: 'An OAuth access token that can be used with a remote MCP server, either with a custom MCP server URL or a service connector. Your application must handle the OAuth authorization flow and provide the token here. ' server_description: type: string description: 'Optional description of the MCP server, used to provide more context. ' headers: anyOf: - type: object additionalProperties: type: string description: 'Optional HTTP headers to send to the MCP server. Use for authentication or other purposes. ' - type: 'null' allowed_tools: anyOf: - description: 'List of allowed tool names or a filter object. ' oneOf: - type: array title: MCP allowed tools description: A string array of allowed tool names items: type: string - $ref: '#/components/schemas/MCPToolFilter' - type: 'null' allowed_callers: anyOf: - type: array minItems: 1 items: $ref: '#/components/schemas/CallableToolAllowedCaller' description: The tool invocation context(s). - type: 'null' require_approval: anyOf: - description: Specify which of the MCP server's tools require approval. oneOf: - type: object title: MCP tool approval filter description: 'Specify which of the MCP server''s tools require approval. Can be `always`, `never`, or a filter object associated with tools that require approval. ' properties: always: $ref: '#/components/schemas/MCPToolFilter' never: $ref: '#/components/schemas/MCPToolFilter' additionalProperties: false - type: string title: MCP tool approval setting description: 'Specify a single approval policy for all tools. One of `always` or `never`. When set to `always`, all tools will require approval. When set to `never`, all tools will not require approval. ' enum: - always - never default: always - type: 'null' defer_loading: type: boolean description: 'Whether this MCP tool is deferred and discovered via tool search. ' required: - type - server_label ImageGenToolCall: properties: type: type: string enum: - image_generation_call description: The type of the image generation call. Always `image_generation_call`. x-stainless-const: true id: type: string description: The unique ID of the image generation call. status: type: string enum: - in_progress - completed - generating - failed description: The status of the image generation call. result: anyOf: - type: string description: The generated image encoded in base64. - type: 'null' size: anyOf: - anyOf: - type: string - type: string enum: - 1024x1024 - 1024x1536 - 1536x1024 description: The image dimensions as a `WIDTHxHEIGHT` string, for example `1536x864`. - type: 'null' quality: anyOf: - type: string enum: - low - medium - high - xhigh - max - auto description: The quality of the image generated by the image generation tool call. One of `low`, `medium`, `high`, `xhigh`, `max`, or `auto`. - type: 'null' action: anyOf: - $ref: '#/components/schemas/ImageGenActionEnum' description: The action used for image generation. - type: 'null' x-openai-go-optional-enum: true background: anyOf: - $ref: '#/components/schemas/ImageBackground' description: The background setting used for generation. - type: 'null' x-openai-go-optional-enum: true output_format: anyOf: - $ref: '#/components/schemas/ImageOutputFormat' description: The output format used for generation. - type: 'null' x-openai-go-optional-enum: true revised_prompt: anyOf: - type: string description: The prompt that was used after any model prompt rewriting. - type: 'null' type: object required: - type - id - status - result title: Image generation call description: An image generation request made by the model. ChatCompletionRequestAssistantMessageContentPart: oneOf: - $ref: '#/components/schemas/ChatCompletionRequestMessageContentPartText' - $ref: '#/components/schemas/ChatCompletionRequestMessageContentPartRefusal' discriminator: propertyName: type FunctionShellAction: properties: commands: items: type: string description: A list of commands to run. type: array timeout_ms: anyOf: - type: integer description: Optional timeout in milliseconds for the commands. - type: 'null' max_output_length: anyOf: - type: integer description: Optional maximum number of characters to return from each command. - type: 'null' type: object required: - commands - timeout_ms - max_output_length title: Shell exec action description: Execute a shell command. Embedding: type: object description: 'Represents an embedding vector returned by embedding endpoint. ' properties: index: type: integer description: The index of the embedding in the list of embeddings. embedding: type: array description: 'The embedding vector, which is a list of floats. The length of vector depends on the model as listed in the [embedding guide](https://developers.openai.com/api/docs/guides/embeddings). ' items: type: number format: float object: type: string description: The object type, which is always "embedding". enum: - embedding x-stainless-const: true required: - index - object - embedding x-oaiMeta: name: The embedding object example: "{\n \"object\": \"embedding\",\n \"embedding\": [\n 0.0023064255,\n -0.009327292,\n \ .... (1536 floats total for ada-002)\n -0.0028842222,\n ],\n \"index\": 0\n}\n" InputItem: oneOf: - $ref: '#/components/schemas/EasyInputMessage' - type: object title: Item description: 'An item representing part of the context for the response to be generated by the model. Can contain text, images, and audio inputs, as well as previous assistant responses and tool call outputs. ' $ref: '#/components/schemas/Item' - $ref: '#/components/schemas/CompactionTriggerItemParam' - $ref: '#/components/schemas/ItemReferenceParam' - $ref: '#/components/schemas/ProgramItemParam' - $ref: '#/components/schemas/ProgramOutputItemParam' discriminator: propertyName: type FunctionShellCallOutputOutcomeParam: oneOf: - $ref: '#/components/schemas/FunctionShellCallOutputTimeoutOutcomeParam' - $ref: '#/components/schemas/FunctionShellCallOutputExitOutcomeParam' title: Shell call outcome description: The exit or timeout outcome associated with this shell call. discriminator: propertyName: type ServiceTier: anyOf: - type: string description: "Specifies the processing type used for serving the request.\n - If set to 'auto', then the request will be processed with the service tier configured in the Project settings. Unless otherwise configured, the Project will use 'default'.\n - If set to 'default', then the request will be processed with the standard pricing and performance for the selected model.\n \ - If set to '[flex](https://developers.openai.com/api/docs/guides/flex-processing)', then the request will be processed with the Flex Processing service tier.\n - To opt-in to [Fast mode](https://developers.openai.com/api/docs/guides/fast-mode) at the request level, include the `service_tier=fast` or `service_tier=priority` parameter for Responses or Chat Completions. The response will show `service_tier=priority` regardless of if you specify `service_tier=fast` or `priority` in your request.\n - When not set, the default behavior is 'auto'.\n\n When the `service_tier` parameter is set, the response body will include the `service_tier` value based on the processing mode actually used to serve the request. This response value may be different from the value set in the parameter.\n" enum: - auto - default - flex - scale - priority - fast default: auto - type: 'null' ResponseErrorCode: type: string description: 'The error code for the response. ' enum: - server_error - rate_limit_exceeded - invalid_prompt - data_residency_mismatch - bio_policy - misalignment_policy_violation - vector_store_timeout - invalid_image - invalid_image_format - invalid_base64_image - invalid_image_url - image_too_large - image_too_small - image_parse_error - image_content_policy_violation - invalid_image_mode - image_file_too_large - unsupported_image_media_type - empty_image_file - failed_to_download_image - image_file_not_found ChatCompletionModerationError: type: object description: An error produced while attempting moderation. properties: type: type: string enum: - error description: The object type, which is always `error`. x-stainless-const: true code: type: string description: The error code. message: type: string description: The error message. required: - type - code - message InlineSkillParam: properties: type: type: string enum: - inline description: Defines an inline skill for this request. default: inline x-stainless-const: true name: type: string description: The name of the skill. description: type: string description: The description of the skill. source: $ref: '#/components/schemas/InlineSkillSourceParam' description: Inline skill payload type: object required: - type - name - description - source ToolSearchCall: properties: type: type: string enum: - tool_search_call description: The type of the item. Always `tool_search_call`. default: tool_search_call x-stainless-const: true id: type: string description: The unique ID of the tool search call item. call_id: anyOf: - type: string description: The unique ID of the tool search call generated by the model. - type: 'null' execution: $ref: '#/components/schemas/ToolSearchExecutionType' description: Whether tool search was executed by the server or by the client. arguments: description: Arguments used for the tool search call. status: $ref: '#/components/schemas/FunctionCallStatus' description: The status of the tool search call item that was recorded. created_by: type: string description: The identifier of the actor that created the item. type: object required: - type - id - call_id - execution - arguments - status ResponseImageGenCallInProgressEvent: type: object title: ResponseImageGenCallInProgressEvent description: 'Emitted when an image generation tool call is in progress. ' properties: type: type: string enum: - response.image_generation_call.in_progress description: The type of the event. Always 'response.image_generation_call.in_progress'. x-stainless-const: true output_index: type: integer description: The index of the output item in the response's output array. item_id: type: string description: The unique identifier of the image generation item being processed. sequence_number: type: integer description: The sequence number of the image generation item being processed. required: - type - output_index - item_id - sequence_number x-oaiMeta: name: response.image_generation_call.in_progress group: responses example: "{\n \"type\": \"response.image_generation_call.in_progress\",\n \"output_index\": 0,\n \"item_id\": \"item-123\",\n \"sequence_number\": 0\n}\n" ResponseAudioTranscriptDoneEvent: type: object description: Emitted when the full audio transcript is completed. properties: type: type: string description: 'The type of the event. Always `response.audio.transcript.done`. ' enum: - response.audio.transcript.done x-stainless-const: true sequence_number: type: integer description: The sequence number of this event. required: - type - response_id - sequence_number x-oaiMeta: name: response.audio.transcript.done group: responses example: "{\n \"type\": \"response.audio.transcript.done\",\n \"response_id\": \"resp_123\",\n \ \"sequence_number\": 1\n}\n" ImageBackground: type: string enum: - transparent - opaque - auto ResponseFileSearchCallCompletedEvent: type: object description: Emitted when a file search call is completed (results found). properties: type: type: string description: 'The type of the event. Always `response.file_search_call.completed`. ' enum: - response.file_search_call.completed x-stainless-const: true output_index: type: integer description: 'The index of the output item that the file search call is initiated. ' item_id: type: string description: 'The ID of the output item that the file search call is initiated. ' sequence_number: type: integer description: The sequence number of this event. required: - type - output_index - item_id - sequence_number x-oaiMeta: name: response.file_search_call.completed group: responses example: "{\n \"type\": \"response.file_search_call.completed\",\n \"output_index\": 0,\n \"item_id\": \"fs_123\",\n \"sequence_number\": 1\n}\n" ResponseShellCallOutputContentDeltaStreamingEvent: properties: type: type: string enum: - response.shell_call_output_content.delta description: The type of the event, always `response.shell_call_output_content.delta`. default: response.shell_call_output_content.delta x-stainless-const: true sequence_number: type: integer description: The sequence number of the event that was emitted. item_id: type: string description: The ID of the output item that was updated. output_index: type: integer description: The index of the output item that was updated. command_index: type: integer description: The index of the shell command that produced output. delta: $ref: '#/components/schemas/ShellCallOutputDelta' description: The stdout/stderr delta that was emitted. type: object required: - type - sequence_number - item_id - output_index - command_index - delta title: Response shell call output content delta event description: A streaming event that indicated shell call output was incrementally added. TopLogProb: properties: token: type: string logprob: type: number bytes: items: type: integer type: array type: object required: - token - logprob - bytes title: Top log probability description: The top log probability of a token. OutputContent: oneOf: - $ref: '#/components/schemas/OutputTextContent' - $ref: '#/components/schemas/RefusalContent' - $ref: '#/components/schemas/ReasoningTextContent' discriminator: propertyName: type ComputerCallSafetyCheckParam: properties: id: type: string description: The ID of the pending safety check. code: anyOf: - type: string description: The type of the pending safety check. - type: 'null' message: anyOf: - type: string description: Details about the pending safety check. - type: 'null' type: object required: - id description: A pending safety check for the computer call. VoiceIdsOrCustomVoice: title: Voice description: 'A built-in voice name or a custom voice reference. ' anyOf: - $ref: '#/components/schemas/VoiceIdsShared' - type: object description: Custom voice reference. additionalProperties: false required: - id properties: id: type: string description: The custom voice ID, e.g. `voice_1234`. example: voice_1234 WebSearchToolCall: type: object title: Web search tool call description: 'The results of a web search tool call. See the [web search guide](https://developers.openai.com/api/docs/guides/tools-web-search) for more information. ' properties: id: type: string description: 'The unique ID of the web search tool call. ' type: type: string enum: - web_search_call description: 'The type of the web search tool call. Always `web_search_call`. ' x-stainless-const: true status: description: 'The status of the web search tool call. ' $ref: '#/components/schemas/WebSearchCallStatus' action: type: object description: 'An object describing the specific action taken in this web search call. Includes details on how the model used the web (search, open_page, find_in_page). ' oneOf: - $ref: '#/components/schemas/WebSearchActionSearch' - $ref: '#/components/schemas/WebSearchActionOpenPage' - $ref: '#/components/schemas/WebSearchActionFind' discriminator: propertyName: type required: - id - type - status - action ChatCompletionRequestMessage: oneOf: - $ref: '#/components/schemas/ChatCompletionRequestDeveloperMessage' - $ref: '#/components/schemas/ChatCompletionRequestSystemMessage' - $ref: '#/components/schemas/ChatCompletionRequestUserMessage' - $ref: '#/components/schemas/ChatCompletionRequestAssistantMessage' - $ref: '#/components/schemas/ChatCompletionRequestToolMessage' - $ref: '#/components/schemas/ChatCompletionRequestFunctionMessage' discriminator: propertyName: role CreateChatCompletionRequest: allOf: - $ref: '#/components/schemas/CreateModelResponseProperties' - type: object properties: messages: description: 'A list of messages comprising the conversation so far. Depending on the [model](https://developers.openai.com/api/docs/models) you use, different message types (modalities) are supported, like [text](https://developers.openai.com/api/docs/guides/text), [images](https://developers.openai.com/api/docs/guides/images-vision), and [audio](https://developers.openai.com/api/docs/guides/audio). ' type: array minItems: 1 items: $ref: '#/components/schemas/ChatCompletionRequestMessage' model: description: 'Model ID used to generate the response, like `gpt-6-astra` or `o3`. OpenAI offers a wide range of models with different capabilities, performance characteristics, and price points. Refer to the [model guide](https://developers.openai.com/api/docs/models) to browse and compare available models. ' $ref: '#/components/schemas/ModelIdsShared' service_tier: $ref: '#/components/schemas/ServiceTier' modalities: $ref: '#/components/schemas/ResponseModalities' verbosity: $ref: '#/components/schemas/Verbosity' reasoning_effort: $ref: '#/components/schemas/ReasoningEffort' max_completion_tokens: description: 'An upper bound for the number of tokens that can be generated for a completion, including visible output tokens and [reasoning tokens](https://developers.openai.com/api/docs/guides/reasoning). ' type: integer nullable: true frequency_penalty: type: number default: 0 minimum: -2 maximum: 2 nullable: true description: 'Number between -2.0 and 2.0. Positive values penalize new tokens based on their existing frequency in the text so far, decreasing the model''s likelihood to repeat the same line verbatim. ' presence_penalty: type: number default: 0 minimum: -2 maximum: 2 nullable: true description: 'Number between -2.0 and 2.0. Positive values penalize new tokens based on whether they appear in the text so far, increasing the model''s likelihood to talk about new topics. ' web_search_options: type: object title: Web search description: 'This tool searches the web for relevant results to use in a response. Learn more about the [web search tool](https://developers.openai.com/api/docs/guides/tools-web-search). ' properties: user_location: type: object nullable: true required: - type - approximate description: 'Approximate location parameters for the search. ' properties: type: type: string description: 'The type of location approximation. Always `approximate`. ' enum: - approximate x-stainless-const: true approximate: $ref: '#/components/schemas/WebSearchLocation' search_context_size: $ref: '#/components/schemas/WebSearchContextSize' top_logprobs: description: 'An integer between 0 and 20 specifying the maximum number of most likely tokens to return at each token position, each with an associated log probability. In some cases, the number of returned tokens may be fewer than requested. `logprobs` must be set to `true` if this parameter is used. ' type: integer minimum: 0 maximum: 20 nullable: true response_format: description: 'An object specifying the format that the model must output. Setting to `{ "type": "json_schema", "json_schema": {...} }` enables Structured Outputs which ensures the model will match your supplied JSON schema. Learn more in the [Structured Outputs guide](https://developers.openai.com/api/docs/guides/structured-outputs). Setting to `{ "type": "json_object" }` enables the older JSON mode, which ensures the message the model generates is valid JSON. Using `json_schema` is preferred for models that support it. ' oneOf: - $ref: '#/components/schemas/ResponseFormatText' - $ref: '#/components/schemas/ResponseFormatJsonSchema' - $ref: '#/components/schemas/ResponseFormatJsonObject' discriminator: propertyName: type audio: type: object nullable: true description: 'Parameters for audio output. Required when audio output is requested with `modalities: ["audio"]`. [Learn more](https://developers.openai.com/api/docs/guides/audio). ' required: - voice - format properties: voice: $ref: '#/components/schemas/VoiceIdsOrCustomVoice' description: 'The voice the model uses to respond. Supported built-in voices are `alloy`, `ash`, `ballad`, `coral`, `echo`, `fable`, `nova`, `onyx`, `sage`, `shimmer`, `marin`, and `cedar`. You may also provide a custom voice object with an `id`, for example `{ "id": "voice_1234" }`. ' format: type: string enum: - wav - aac - mp3 - flac - opus - pcm16 description: 'Specifies the output audio format. Must be one of `wav`, `mp3`, `flac`, `opus`, or `pcm16`. ' store: type: boolean default: false nullable: true description: 'Whether or not to store the output of this chat completion request for use in our [model distillation](https://developers.openai.com/api/docs/guides/supervised-fine-tuning#distilling-from-a-larger-model) or [evals](https://developers.openai.com/api/docs/guides/evals) products. Supports text and image inputs. Note: image inputs over 8MB will be dropped. ' moderation: anyOf: - $ref: '#/components/schemas/ModerationParam' description: 'Configuration for running moderation on the request input and generated output. ' - type: 'null' stream: description: 'If set to true, the model response data will be streamed to the client as it is generated using [server-sent events](https://developer.mozilla.org/en-US/docs/Web/API/Server-sent_events/Using_server-sent_events#Event_stream_format). See the [Streaming section below](https://developers.openai.com/api/reference/resources/chat/subresources/completions/streaming-events) for more information, along with the [streaming responses](https://developers.openai.com/api/docs/guides/streaming-responses) guide for more information on how to handle the streaming events. ' type: boolean nullable: true default: false stop: $ref: '#/components/schemas/StopConfiguration' logit_bias: type: object x-oaiTypeLabel: map default: null nullable: true additionalProperties: type: integer description: 'Modify the likelihood of specified tokens appearing in the completion. Accepts a JSON object that maps tokens (specified by their token ID in the tokenizer) to an associated bias value from -100 to 100. Mathematically, the bias is added to the logits generated by the model prior to sampling. The exact effect will vary per model, but values between -1 and 1 should decrease or increase likelihood of selection; values like -100 or 100 should result in a ban or exclusive selection of the relevant token. ' logprobs: description: 'Whether to return log probabilities of the output tokens or not. If true, returns the log probabilities of each output token returned in the `content` of `message`. ' type: boolean default: false nullable: true max_tokens: description: 'The maximum number of [tokens](https://platform.openai.com/tokenizer) that can be generated in the chat completion. This value can be used to control [costs](https://openai.com/api/pricing/) for text generated via API. This value is now deprecated in favor of `max_completion_tokens`, and is not compatible with [o-series models](https://developers.openai.com/api/docs/guides/reasoning). ' type: integer nullable: true deprecated: true n: type: integer minimum: 1 maximum: 128 default: 1 example: 1 nullable: true description: How many chat completion choices to generate for each input message. Note that you will be charged based on the number of generated tokens across all of the choices. Keep `n` as `1` to minimize costs. prediction: nullable: true description: 'Configuration for a [Predicted Output](https://developers.openai.com/api/docs/guides/predicted-outputs), which can greatly improve response times when large parts of the model response are known ahead of time. This is most common when you are regenerating a file with only minor changes to most of the content. ' oneOf: - $ref: '#/components/schemas/PredictionContent' seed: type: integer minimum: -9223372036854776000 maximum: 9223372036854776000 nullable: true deprecated: true description: 'This feature is in Beta. If specified, our system will make a best effort to sample deterministically, such that repeated requests with the same `seed` and parameters should return the same result. Determinism is not guaranteed, and you should refer to the `system_fingerprint` response parameter to monitor changes in the backend. ' x-oaiMeta: beta: true stream_options: $ref: '#/components/schemas/ChatCompletionStreamOptions' tools: type: array description: 'A list of tools the model may call. You can provide either [custom tools](https://developers.openai.com/api/docs/guides/function-calling#custom-tools) or [function tools](https://developers.openai.com/api/docs/guides/function-calling). ' items: oneOf: - $ref: '#/components/schemas/ChatCompletionTool' - $ref: '#/components/schemas/CustomToolChatCompletions' tool_choice: $ref: '#/components/schemas/ChatCompletionToolChoiceOption' parallel_tool_calls: $ref: '#/components/schemas/ParallelToolCalls' function_call: deprecated: true description: 'Deprecated in favor of `tool_choice`. Controls which (if any) function is called by the model. `none` means the model will not call a function and instead generates a message. `auto` means the model can pick between generating a message or calling a function. Specifying a particular function via `{"name": "my_function"}` forces the model to call that function. `none` is the default when no functions are present. `auto` is the default if functions are present. ' oneOf: - type: string description: '`none` means the model will not call a function and instead generates a message. `auto` means the model can pick between generating a message or calling a function. ' enum: - none - auto - $ref: '#/components/schemas/ChatCompletionFunctionCallOption' functions: deprecated: true description: 'Deprecated in favor of `tools`. A list of functions the model may generate JSON inputs for. ' type: array minItems: 1 maxItems: 128 items: $ref: '#/components/schemas/ChatCompletionFunctions' required: - model - messages HTTPError: properties: type: type: string enum: - http_error default: http_error x-stainless-const: true code: type: integer message: type: string type: object required: - type - code - message FileExpirationAfter: type: object title: File expiration policy description: The expiration policy for a file. By default, files with `purpose=batch` expire after 30 days and all other files are persisted until they are manually deleted. properties: anchor: description: 'Anchor timestamp after which the expiration policy applies. Supported anchors: `created_at`.' type: string enum: - created_at x-stainless-const: true seconds: description: The number of seconds after the anchor time that the file will expire. Must be between 3600 (1 hour) and 2592000 (30 days). type: integer format: int64 minimum: 3600 maximum: 2592000 required: - anchor - seconds MCPListTools: type: object title: MCP list tools description: 'A list of tools available on an MCP server. ' properties: type: type: string enum: - mcp_list_tools description: 'The type of the item. Always `mcp_list_tools`. ' x-stainless-const: true id: type: string description: 'The unique ID of the list. ' server_label: type: string description: 'The label of the MCP server. ' tools: type: array items: $ref: '#/components/schemas/MCPListToolsTool' description: 'The tools available on the server. ' error: anyOf: - type: string description: 'Error message if the server could not list tools. ' - type: 'null' required: - type - id - server_label - tools ResponseMCPCallArgumentsDeltaEvent: type: object title: ResponseMCPCallArgumentsDeltaEvent description: 'Emitted when there is a delta (partial update) to the arguments of an MCP tool call. ' properties: type: type: string enum: - response.mcp_call_arguments.delta description: The type of the event. Always 'response.mcp_call_arguments.delta'. x-stainless-const: true output_index: type: integer description: The index of the output item in the response's output array. item_id: type: string description: The unique identifier of the MCP tool call item being processed. delta: type: string description: 'A JSON string containing the partial update to the arguments for the MCP tool call. ' sequence_number: type: integer description: The sequence number of this event. required: - type - output_index - item_id - delta - sequence_number x-oaiMeta: name: response.mcp_call_arguments.delta group: responses example: "{\n \"type\": \"response.mcp_call_arguments.delta\",\n \"output_index\": 0,\n \"item_id\": \"item-abc\",\n \"delta\": \"{\",\n \"sequence_number\": 1\n}\n" ResponseShellCallCommandDeltaStreamingEvent: properties: type: type: string enum: - response.shell_call_command.delta description: The type of the event, always `response.shell_call_command.delta`. default: response.shell_call_command.delta x-stainless-const: true 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 updated. command_index: type: integer description: The index of the shell command that was updated. delta: type: string description: The shell command delta that was appended. obfuscation: type: string description: An obfuscation string that was added to pad the event payload. type: object required: - type - sequence_number - output_index - command_index - delta title: Response shell command delta event description: A streaming event that indicated a shell command was incrementally updated. CreateTranscriptionRequest: type: object additionalProperties: false properties: file: description: 'The audio file object (not file name) to transcribe, in one of these formats: flac, mp3, mp4, mpeg, mpga, m4a, ogg, wav, or webm. The request must include enough format metadata for the file to be identified. We recommend an extension-bearing filename and an appropriate content type. ' type: string x-oaiTypeLabel: file format: binary model: description: 'ID of the model to use. The options are `gpt-transcribe`, `gpt-4o-transcribe`, `gpt-4o-mini-transcribe`, `gpt-4o-mini-transcribe-2025-12-15`, `whisper-1` (which is powered by our open source Whisper V2 model), and `gpt-4o-transcribe-diarize`. ' example: gpt-4o-transcribe anyOf: - type: string - type: string enum: - whisper-1 - gpt-transcribe - gpt-4o-transcribe - gpt-4o-mini-transcribe - gpt-4o-mini-transcribe-2025-12-15 - gpt-4o-transcribe-diarize x-stainless-const: true x-oaiTypeLabel: string language: description: 'The language of the input audio. Supplying the input language in [ISO-639-1](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes) (e.g. `en`) format will improve accuracy and latency. ' type: string languages: description: 'Possible languages of the input audio, in [ISO-639-1](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes) format. Supported by `gpt-transcribe`. ' type: array minItems: 1 items: type: string keywords: description: 'Words or phrases to guide transcription of the input audio. Supported by `gpt-transcribe`. ' type: array items: type: string prompt: description: 'An optional text to guide the model''s style or continue a previous audio segment. The [prompt](https://developers.openai.com/api/docs/guides/speech-to-text#prompting) should match the audio language. This field is not supported when using `gpt-4o-transcribe-diarize`. ' type: string response_format: $ref: '#/components/schemas/AudioResponseFormat' temperature: description: 'The sampling temperature, between 0 and 1. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. If set to 0, the model will use [log probability](https://en.wikipedia.org/wiki/Log_probability) to automatically increase the temperature until certain thresholds are hit. ' type: number default: 0 include: description: 'Additional information to include in the transcription response. `logprobs` will return the log probabilities of the tokens in the response to understand the model''s confidence in the transcription. `logprobs` only works with response_format set to `json` and only with the models `gpt-4o-transcribe`, `gpt-4o-mini-transcribe`, and `gpt-4o-mini-transcribe-2025-12-15`. This field is not supported when using `gpt-4o-transcribe-diarize`. ' type: array items: $ref: '#/components/schemas/TranscriptionInclude' timestamp_granularities: description: 'The timestamp granularities to populate for this transcription. `response_format` must be set `verbose_json` to use timestamp granularities. Either or both of these options are supported: `word`, or `segment`. Note: There is no additional latency for segment timestamps, but generating word timestamps incurs additional latency. This option is not available for `gpt-4o-transcribe-diarize`. ' type: array items: type: string enum: - word - segment default: - segment stream: anyOf: - description: 'If set to true, the model response data will be streamed to the client as it is generated using [server-sent events](https://developer.mozilla.org/en-US/docs/Web/API/Server-sent_events/Using_server-sent_events#Event_stream_format). See the [Streaming section of the Speech-to-Text guide](https://developers.openai.com/api/docs/guides/speech-to-text?lang=curl#streaming) for more information. Note: Streaming is not supported for the `whisper-1` model and will be ignored. ' type: boolean default: false - type: 'null' chunking_strategy: anyOf: - description: 'Controls how the audio is cut into chunks. When set to `"auto"`, the server first normalizes loudness and then uses voice activity detection (VAD) to choose boundaries. `server_vad` object can be provided to tweak VAD detection parameters manually. If unset, the audio is transcribed as a single block. Required when using `gpt-4o-transcribe-diarize` for inputs longer than 30 seconds. ' anyOf: - type: string enum: - auto default: auto description: 'Automatically set chunking parameters based on the audio. Must be set to `"auto"`. ' x-stainless-const: true - $ref: '#/components/schemas/VadConfig' x-oaiTypeLabel: string - type: 'null' known_speaker_names: description: 'Optional list of speaker names that correspond to the audio samples provided in `known_speaker_references[]`. Each entry should be a short identifier (for example `customer` or `agent`). Up to 4 speakers are supported. ' type: array maxItems: 4 items: type: string known_speaker_references: description: 'Optional list of audio samples (as [data URLs](https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/Data_URLs)) that contain known speaker references matching `known_speaker_names[]`. Each sample must be between 2 and 10 seconds, and can use any of the same input audio formats supported by `file`. ' type: array maxItems: 4 items: type: string required: - file - model Image: type: object description: Represents the content or the URL of an image generated by the OpenAI API. properties: b64_json: type: string description: The base64-encoded JSON of the generated image. Returned by default for the GPT image models, and only present if `response_format` is set to `b64_json` for `dall-e-2` and `dall-e-3`. url: type: string format: uri description: When using `dall-e-2` or `dall-e-3`, the URL of the generated image if `response_format` is set to `url` (default value). Unsupported for the GPT image models. revised_prompt: type: string description: For `dall-e-3` only, the revised prompt that was used to generate the image. ResponseAudioDoneEvent: type: object description: Emitted when the audio response is complete. properties: type: type: string description: 'The type of the event. Always `response.audio.done`. ' enum: - response.audio.done x-stainless-const: true sequence_number: type: integer description: 'The sequence number of the delta. ' required: - type - sequence_number - response_id x-oaiMeta: name: response.audio.done group: responses example: "{\n \"type\": \"response.audio.done\",\n \"response_id\": \"resp-123\",\n \"sequence_number\": 1\n}\n" FunctionObject: type: object properties: description: type: string description: A description of what the function does, used by the model to choose when and how to call the function. name: type: string description: The name of the function to be called. Must be a-z, A-Z, 0-9, or contain underscores and dashes, with a maximum length of 64. parameters: $ref: '#/components/schemas/FunctionParameters' strict: anyOf: - type: boolean default: false description: Whether to enable strict schema adherence when generating the function call. If set to true, the model will follow the exact schema defined in the `parameters` field. Only a subset of JSON Schema is supported when `strict` is `true`. Learn more about Structured Outputs in the [function calling guide](https://developers.openai.com/api/docs/guides/function-calling). - type: 'null' required: - name ImageGenOutputTokensDetails: properties: image_tokens: type: integer description: The number of image output tokens generated by the model. text_tokens: type: integer description: The number of text output tokens generated by the model. type: object required: - image_tokens - text_tokens title: Image generation output token details description: The output token details for the image generation. ClickParam: properties: type: type: string enum: - click description: Specifies the event type. For a click action, this property is always `click`. default: click x-stainless-const: true button: $ref: '#/components/schemas/ClickButtonType' description: Indicates which mouse button was pressed during the click. One of `left`, `right`, `wheel`, `back`, or `forward`. x: type: integer description: The x-coordinate where the click occurred. y: type: integer description: The y-coordinate where the click occurred. keys: anyOf: - items: type: string type: array description: The keys being held while clicking. - type: 'null' type: object required: - type - button - x - y title: Click description: A click action. CreateChatCompletionResponse: type: object description: Represents a chat completion response returned by model, based on the provided input. properties: id: type: string description: A unique identifier for the chat completion. choices: type: array description: A list of chat completion choices. Can be more than one if `n` is greater than 1. items: type: object required: - finish_reason - index - message - logprobs properties: finish_reason: type: string description: 'The reason the model stopped generating tokens. This will be `stop` if the model hit a natural stop point or a provided stop sequence, `length` if the maximum number of tokens specified in the request was reached, `content_filter` if content was omitted due to a flag from our content filters, `tool_calls` if the model called a tool, or `function_call` (deprecated) if the model called a function. Read the [Model Spec](https://model-spec.openai.com/2025-12-18.html) for more. ' enum: - stop - length - tool_calls - content_filter - function_call index: type: integer description: The index of the choice in the list of choices. message: $ref: '#/components/schemas/ChatCompletionResponseMessage' logprobs: anyOf: - description: Log probability information for the choice. type: object properties: content: anyOf: - description: A list of message content tokens with log probability information. type: array items: $ref: '#/components/schemas/ChatCompletionTokenLogprob' - type: 'null' refusal: anyOf: - description: A list of message refusal tokens with log probability information. type: array items: $ref: '#/components/schemas/ChatCompletionTokenLogprob' - type: 'null' required: - content - refusal - type: 'null' created: type: integer format: unixtime description: The Unix timestamp (in seconds) of when the chat completion was created. model: type: string description: The model used for the chat completion. metadata: $ref: '#/components/schemas/Metadata' service_tier: $ref: '#/components/schemas/ServiceTier' system_fingerprint: type: string deprecated: true description: 'This fingerprint represents the backend configuration that the model runs with. Can be used in conjunction with the `seed` request parameter to understand when backend changes have been made that might impact determinism. ' object: type: string description: The object type, which is always `chat.completion`. enum: - chat.completion x-stainless-const: true usage: $ref: '#/components/schemas/CompletionUsage' moderation: anyOf: - $ref: '#/components/schemas/ChatCompletionModeration' description: 'Moderation results for the request input and generated output, if moderated completions were requested. ' - type: 'null' required: - choices - created - id - model - object x-oaiMeta: name: The chat completion object group: chat example: "{\n \"id\": \"chatcmpl-B9MHDbslfkBeAs8l4bebGdFOJ6PeG\",\n \"object\": \"chat.completion\",\n \ \"created\": 1741570283,\n \"model\": \"gpt-6-astra\",\n \"choices\": [\n {\n \"index\": 0,\n \"message\": {\n \"role\": \"assistant\",\n \"content\": \"The image shows a wooden boardwalk path running through a lush green field or meadow. The sky is bright blue with some scattered clouds, giving the scene a serene and peaceful atmosphere. Trees and shrubs are visible in the background.\",\n \"refusal\": null,\n \"annotations\": []\n },\n \"logprobs\": null,\n \"finish_reason\": \"stop\"\n }\n ],\n \"usage\": {\n \"prompt_tokens\": 1117,\n \"completion_tokens\": 46,\n \"total_tokens\": 1163,\n \ \"prompt_tokens_details\": {\n \"cached_tokens\": 0,\n \"audio_tokens\": 0\n },\n \ \"completion_tokens_details\": {\n \"reasoning_tokens\": 0,\n \"audio_tokens\": 0,\n \"accepted_prediction_tokens\": 0,\n \"rejected_prediction_tokens\": 0\n }\n \ },\n \"service_tier\": \"default\",\n \"system_fingerprint\": \"fp_fc9f1d7035\"\n}\n" CreateSpeechResponseStreamEvent: anyOf: - $ref: '#/components/schemas/SpeechAudioDeltaEvent' - $ref: '#/components/schemas/SpeechAudioDoneEvent' discriminator: propertyName: type ApplyPatchToolCallOutputItemParam: properties: type: type: string enum: - apply_patch_call_output description: The type of the item. Always `apply_patch_call_output`. default: apply_patch_call_output x-stainless-const: true id: anyOf: - type: string description: The unique ID of the apply patch tool call output. Populated when this item is returned via API. example: apco_123 - type: 'null' call_id: type: string maxLength: 64 minLength: 1 description: The unique ID of the apply patch tool call generated by the model. caller: anyOf: - $ref: '#/components/schemas/ToolCallCallerParam' description: The execution context that produced this tool call. - type: 'null' status: $ref: '#/components/schemas/ApplyPatchCallOutputStatusParam' description: The status of the apply patch tool call output. One of `completed` or `failed`. output: anyOf: - type: string maxLength: 10485760 description: Optional human-readable log text from the apply patch tool (e.g., patch results or errors). - type: 'null' type: object required: - type - call_id - status title: Apply patch tool call output description: The streamed output emitted by an apply patch tool call. ApplyPatchToolCallOutput: properties: type: type: string enum: - apply_patch_call_output description: The type of the item. Always `apply_patch_call_output`. default: apply_patch_call_output x-stainless-const: true id: type: string description: The unique ID of the apply patch tool call output. Populated when this item is returned via API. call_id: type: string description: The unique ID of the apply patch tool call generated by the model. caller: anyOf: - $ref: '#/components/schemas/ToolCallCaller' description: The execution context that produced this tool call. - type: 'null' status: $ref: '#/components/schemas/ApplyPatchCallOutputStatus' description: The status of the apply patch tool call output. One of `completed` or `failed`. output: anyOf: - type: string description: Optional textual output returned by the apply patch tool. - type: 'null' created_by: type: string description: The ID of the entity that created this tool call output. type: object required: - type - id - call_id - status title: Apply patch tool call output description: The output emitted by an apply patch tool call. OutputMessageContent: oneOf: - $ref: '#/components/schemas/OutputTextContent' - $ref: '#/components/schemas/RefusalContent' discriminator: propertyName: type LocalEnvironmentParam: properties: type: type: string enum: - local description: Use a local computer environment. default: local x-stainless-const: true skills: items: $ref: '#/components/schemas/LocalSkillParam' type: array maxItems: 200 description: An optional list of skills. type: object required: - type ModerationMode: type: string enum: - score - block ImageGenInputUsageDetails: properties: text_tokens: type: integer description: The number of text tokens in the input prompt. image_tokens: type: integer description: The number of image tokens in the input prompt. type: object required: - text_tokens - image_tokens title: Input usage details description: The input tokens detailed information for the image generation. CompoundFilter: $recursiveAnchor: true type: object additionalProperties: false title: Compound Filter description: Combine multiple filters using `and` or `or`. properties: type: type: string description: 'Type of operation: `and` or `or`.' enum: - and - or filters: type: array description: Array of filters to combine. Items can be `ComparisonFilter` or `CompoundFilter`. items: oneOf: - $ref: '#/components/schemas/ComparisonFilter' - $recursiveRef: '#' discriminator: propertyName: type required: - type - filters x-oaiMeta: name: CompoundFilter ChatCompletionFunctions: type: object deprecated: true properties: description: type: string description: A description of what the function does, used by the model to choose when and how to call the function. name: type: string description: The name of the function to be called. Must be a-z, A-Z, 0-9, or contain underscores and dashes, with a maximum length of 64. parameters: $ref: '#/components/schemas/FunctionParameters' required: - name MCPApprovalResponse: type: object title: MCP approval response description: 'A response to an MCP approval request. ' properties: type: type: string enum: - mcp_approval_response description: 'The type of the item. Always `mcp_approval_response`. ' x-stainless-const: true id: anyOf: - type: string description: 'The unique ID of the approval response ' - type: 'null' approval_request_id: type: string description: 'The ID of the approval request being answered. ' approve: type: boolean description: 'Whether the request was approved. ' reason: anyOf: - type: string description: 'Optional reason for the decision. ' - type: 'null' required: - type - request_id - approve - approval_request_id CodeInterpreterOutputLogs: properties: type: type: string enum: - logs description: The type of the output. Always `logs`. default: logs x-stainless-const: true logs: type: string description: The logs output from the code interpreter. type: object required: - type - logs title: Code interpreter output logs description: The logs output from the code interpreter. ModerationInputType: type: string enum: - text - image ResponseFormatJsonSchema: type: object title: JSON schema description: 'JSON Schema response format. Used to generate structured JSON responses. Learn more about [Structured Outputs](https://developers.openai.com/api/docs/guides/structured-outputs). ' properties: type: type: string description: The type of response format being defined. Always `json_schema`. enum: - json_schema x-stainless-const: true json_schema: type: object title: JSON schema description: 'Structured Outputs configuration options, including a JSON Schema. ' properties: description: type: string description: 'A description of what the response format is for, used by the model to determine how 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 dashes, with a maximum length of 64. ' schema: $ref: '#/components/schemas/ResponseFormatJsonSchemaSchema' strict: anyOf: - type: boolean default: false description: 'Whether to enable strict schema adherence when generating the output. If set to true, the model will always follow the exact schema defined in the `schema` field. Only a subset of JSON Schema is supported when `strict` is `true`. To learn more, read the [Structured Outputs guide](https://developers.openai.com/api/docs/guides/structured-outputs). ' - type: 'null' required: - name required: - type - json_schema VadConfig: type: object additionalProperties: false required: - type properties: type: type: string enum: - server_vad description: Must be set to `server_vad` to enable manual chunking using server side VAD. prefix_padding_ms: type: integer default: 300 description: "Amount of audio to include before the VAD detected speech (in \nmilliseconds).\n" silence_duration_ms: type: integer default: 200 description: "Duration of silence to detect speech stop (in milliseconds).\nWith shorter values the model will respond more quickly, \nbut may jump in on short pauses from the user.\n" threshold: type: number default: 0.5 description: "Sensitivity threshold (0.0 to 1.0) for voice activity detection. A \nhigher threshold will require louder audio to activate the model, and \nthus might perform better in noisy environments.\n" LocalEnvironmentResource: properties: type: type: string enum: - local description: The environment type. Always `local`. default: local x-stainless-const: true type: object required: - type title: Local Environment description: Represents the use of a local environment to perform shell actions. AdditionalToolsItemParam: properties: id: anyOf: - type: string description: The unique ID of this additional tools item. example: at_123 - type: 'null' type: type: string enum: - additional_tools description: The item type. Always `additional_tools`. default: additional_tools x-stainless-const: true role: type: string enum: - developer description: The role that provided the additional tools. Only `developer` is supported. default: developer x-stainless-const: true tools: items: $ref: '#/components/schemas/Tool' type: array description: A list of additional tools made available at this item. type: object required: - type - role - tools ResponseFunctionCallArgumentsDoneEvent: type: object description: Emitted when function-call arguments are finalized. properties: type: type: string enum: - response.function_call_arguments.done x-stainless-const: true item_id: type: string description: The ID of the item. output_index: type: integer description: The index of the output item. sequence_number: type: integer description: The sequence number of this event. arguments: type: string description: The function-call arguments. required: - type - item_id - output_index - arguments - sequence_number x-oaiMeta: name: response.function_call_arguments.done group: responses example: "{\n \"type\": \"response.function_call_arguments.done\",\n \"item_id\": \"item-abc\",\n \ \"output_index\": 1,\n \"arguments\": \"{ \\\"arg\\\": 123 }\",\n \"sequence_number\": 1\n}\n" ApplyPatchOperationParam: oneOf: - $ref: '#/components/schemas/ApplyPatchCreateFileOperationParam' - $ref: '#/components/schemas/ApplyPatchDeleteFileOperationParam' - $ref: '#/components/schemas/ApplyPatchUpdateFileOperationParam' title: Apply patch operation description: One of the create_file, delete_file, or update_file operations supplied to the apply_patch tool. discriminator: propertyName: type ChatCompletionRequestToolMessageContentPart: oneOf: - $ref: '#/components/schemas/ChatCompletionRequestMessageContentPartText' CreateModelResponseProperties: allOf: - $ref: '#/components/schemas/ModelResponseProperties' - type: object properties: prompt_cache_options: $ref: '#/components/schemas/PromptCacheOptionsParam' top_logprobs: description: 'An integer between 0 and 20 specifying the maximum number of most likely tokens to return at each token position, each with an associated log probability. In some cases, the number of returned tokens may be fewer than requested. ' type: integer minimum: 0 maximum: 20 ResponseMCPListToolsFailedEvent: type: object title: ResponseMCPListToolsFailedEvent description: 'Emitted when the attempt to list available MCP tools has failed. ' properties: type: type: string enum: - response.mcp_list_tools.failed description: The type of the event. Always 'response.mcp_list_tools.failed'. x-stainless-const: true item_id: type: string description: The ID of the MCP tool call item that failed. output_index: type: integer description: The index of the output item that failed. sequence_number: type: integer description: The sequence number of this event. required: - type - item_id - output_index - sequence_number x-oaiMeta: name: response.mcp_list_tools.failed group: responses example: "{\n \"type\": \"response.mcp_list_tools.failed\",\n \"sequence_number\": 1,\n \"output_index\": 0,\n \"item_id\": \"mcpl_682d4379df088191886b70f4ec39f90403937d5f622d7a90\"\n}\n" ResponseReasoningSummaryTextDeltaEvent: type: object description: Emitted when a delta is added to a reasoning summary text. properties: type: type: string description: 'The type of the event. Always `response.reasoning_summary_text.delta`. ' enum: - response.reasoning_summary_text.delta x-stainless-const: true item_id: type: string description: 'The ID of the item this summary text delta is associated with. ' output_index: type: integer description: 'The index of the output item this summary text delta is associated with. ' summary_index: type: integer description: 'The index of the summary part within the reasoning summary. ' delta: type: string description: 'The text delta that was added to the summary. ' sequence_number: type: integer description: 'The sequence number of this event. ' required: - type - item_id - output_index - summary_index - delta - sequence_number x-oaiMeta: name: response.reasoning_summary_text.delta group: responses example: "{\n \"type\": \"response.reasoning_summary_text.delta\",\n \"item_id\": \"rs_6806bfca0b2481918a5748308061a2600d3ce51bdffd5476\",\n \ \"output_index\": 0,\n \"summary_index\": 0,\n \"delta\": \"**Responding to a greeting**\\n\\nThe user just said, \\\"Hello!\\\" So, it seems I need to engage. I'll greet them back and offer help since they're looking to chat. I could say something like, \\\"Hello! How can I assist you today?\\\" That feels friendly and open. They didn't ask a specific question, so this approach will work well for starting a conversation. Let's see where it goes from there!\",\n \"sequence_number\": 1\n}\n" CompletionUsage: type: object description: Usage statistics for the completion request. properties: completion_tokens: type: integer default: 0 description: Number of tokens in the generated completion. prompt_tokens: type: integer default: 0 description: Number of tokens in the prompt. total_tokens: type: integer default: 0 description: Total number of tokens used in the request (prompt + completion). completion_tokens_details: type: object description: Breakdown of tokens used in a completion. properties: accepted_prediction_tokens: type: integer default: 0 description: 'When using Predicted Outputs, the number of tokens in the prediction that appeared in the completion. ' audio_tokens: type: integer default: 0 description: Audio input tokens generated by the model. reasoning_tokens: type: integer default: 0 description: Tokens generated by the model for reasoning. text_tokens: type: integer description: Text output tokens generated by the model. rejected_prediction_tokens: type: integer default: 0 description: 'When using Predicted Outputs, the number of tokens in the prediction that did not appear in the completion. However, like reasoning tokens, these tokens are still counted in the total completion tokens for purposes of billing, output, and context window limits. ' prompt_tokens_details: type: object description: Breakdown of tokens used in the prompt. properties: audio_tokens: type: integer default: 0 description: Audio input tokens present in the prompt. cached_tokens: type: integer default: 0 description: Cached tokens present in the prompt. text_tokens: type: integer description: Text input tokens present in the prompt. image_tokens: type: integer description: Image input tokens present in the prompt. cache_write_tokens: type: integer default: 0 description: The unadjusted number of prompt tokens written to cache. required: - prompt_tokens - completion_tokens - total_tokens ChatCompletionMessageToolCall: type: object title: Function tool call description: 'A call to a function tool created by the model. ' properties: id: type: string description: The ID of the tool call. type: type: string enum: - function description: The type of the tool. Currently, only `function` is supported. x-stainless-const: true function: type: object description: The function that the model called. properties: name: type: string description: The name of the function to call. arguments: type: string description: The arguments to call the function with, as generated by the model in JSON format. Note that the model does not always generate valid JSON, and may hallucinate parameters not defined by your function schema. Validate the arguments in your code before calling your function. required: - name - arguments required: - id - type - function LocalShellExecAction: properties: type: type: string enum: - exec description: The type of the local shell action. Always `exec`. default: exec x-stainless-const: true command: items: type: string type: array description: The command to run. timeout_ms: anyOf: - type: integer description: Optional timeout in milliseconds for the command. - type: 'null' working_directory: anyOf: - type: string description: Optional working directory to run the command in. - type: 'null' env: additionalProperties: type: string type: object description: Environment variables to set for the command. x-oaiTypeLabel: map user: anyOf: - type: string description: Optional user to run the command as. - type: 'null' type: object required: - type - command - env title: Local shell exec action description: Execute a shell command on the server. SpecificProgrammaticToolCallingParam: properties: type: type: string enum: - programmatic_tool_calling description: The tool to call. Always `programmatic_tool_calling`. default: programmatic_tool_calling x-stainless-const: true type: object required: - type ChatCompletionNamedToolChoiceCustom: type: object title: Custom tool choice description: Specifies a tool the model should use. Use to force the model to call a specific custom tool. properties: type: type: string enum: - custom description: For custom tool calling, the type is always `custom`. x-stainless-const: true custom: type: object properties: name: type: string description: The name of the custom tool to call. required: - name required: - type - custom InputMessage: type: object title: Input message description: 'A message input to the model with a role indicating instruction following hierarchy. Instructions given with the `developer` or `system` role take precedence over instructions given with the `user` role. ' properties: type: type: string description: 'The type of the message input. Always set to `message`. ' enum: - message x-stainless-const: true role: type: string description: 'The role of the message input. One of `user`, `system`, or `developer`. ' enum: - user - system - developer status: type: string description: 'The status of item. One of `in_progress`, `completed`, or `incomplete`. Populated when items are returned via API. ' enum: - in_progress - completed - incomplete content: $ref: '#/components/schemas/InputMessageContentList' required: - role - content ChatCompletionMessageToolCalls: type: array description: The tool calls generated by the model, such as function calls. items: oneOf: - $ref: '#/components/schemas/ChatCompletionMessageToolCall' - $ref: '#/components/schemas/ChatCompletionMessageCustomToolCall' discriminator: propertyName: type CreateResponse: allOf: - $ref: '#/components/schemas/CreateModelResponseProperties' - $ref: '#/components/schemas/ResponseProperties' - type: object properties: prompt_cache_options: $ref: '#/components/schemas/ResponsePromptCacheOptionsParam' service_tier: $ref: '#/components/schemas/ServiceTierResponses' truncation: deprecated: true anyOf: - type: string description: "The truncation strategy to use for the model response.\n- `auto`: If the input to this Response exceeds\n the model's context window size, the model will truncate the\n \ response to fit the context window by dropping items from the beginning of the conversation.\n- `disabled` (default): If the input size will exceed the context window\n size for a model, the request will fail with a 400 error.\n" enum: - auto - disabled default: disabled - type: 'null' reasoning: anyOf: - $ref: '#/components/schemas/Reasoning' - type: 'null' input: $ref: '#/components/schemas/InputParam' include: anyOf: - type: array description: 'Specify additional output data to include in the model response. Currently supported values are: - `web_search_call.action.sources`: Include the sources of the web search tool call. - `code_interpreter_call.outputs`: Includes the outputs of python code execution in code interpreter tool call items. - `computer_call_output.output.image_url`: Include image urls from the computer call output. - `file_search_call.results`: Include the search results of the file search tool call. - `message.input_image.image_url`: Include image urls from the input message. - `message.output_text.logprobs`: Include logprobs with assistant messages. - `reasoning.encrypted_content`: Includes an encrypted version of reasoning tokens in reasoning item outputs. This enables reasoning items to be used in multi-turn conversations when using the Responses API statelessly (like when the `store` parameter is set to `false`, or when an organization is enrolled in the zero data retention program).' items: $ref: '#/components/schemas/IncludeEnum' - type: 'null' parallel_tool_calls: anyOf: - type: boolean description: 'Whether to allow the model to run tool calls in parallel. ' default: true - type: 'null' store: anyOf: - type: boolean description: 'Whether to store the generated model response for later retrieval via API. Defaults to true when omitted. If set to true, response data will be stored for at least 30 days, subject to the [data retention exceptions](https://developers.openai.com/api/docs/guides/your-data#v1responses). ' default: true - type: 'null' instructions: anyOf: - type: string description: 'A system (or developer) message inserted into the model''s context. When using along with `previous_response_id`, the instructions from a previous response will not be carried over to the next response. This makes it simple to swap out system (or developer) messages in new responses. ' - type: 'null' moderation: anyOf: - $ref: '#/components/schemas/ModerationParam' description: 'Configuration for running moderation on the input and output of this response. ' - type: 'null' stream: anyOf: - description: 'If set to true, the model response data will be streamed to the client as it is generated using [server-sent events](https://developer.mozilla.org/en-US/docs/Web/API/Server-sent_events/Using_server-sent_events#Event_stream_format). See the [Streaming section below](https://developers.openai.com/api/reference/resources/responses/streaming-events) for more information. ' type: boolean default: false - type: 'null' stream_options: $ref: '#/components/schemas/ResponseStreamOptions' conversation: anyOf: - $ref: '#/components/schemas/ConversationParam' - type: 'null' context_management: anyOf: - type: array description: 'Context management configuration for this request. ' minItems: 1 items: $ref: '#/components/schemas/ContextManagementParam' - type: 'null' 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](https://developers.openai.com/api/docs/guides/reasoning). ' type: integer minimum: 16 - type: 'null' CodeInterpreterTool: type: object title: Code interpreter description: 'A tool that runs Python code to help generate a response to a prompt. ' properties: type: type: string enum: - code_interpreter description: 'The type of the code interpreter tool. Always `code_interpreter`. ' x-stainless-const: true container: description: 'The code interpreter container. Can be a container ID or an object that specifies uploaded file IDs to make available to your code, along with an optional `memory_limit` setting. ' oneOf: - type: string description: The container ID. - $ref: '#/components/schemas/AutoCodeInterpreterToolParam' allowed_callers: anyOf: - type: array minItems: 1 items: $ref: '#/components/schemas/CallableToolAllowedCaller' description: The tool invocation context(s). - type: 'null' required: - type - container EditImageBodyJsonParam: type: object description: 'JSON request body for image edits. Use `images` (array of `ImageRefParam`) instead of multipart `image` uploads. You can reference images via external URLs, data URLs, or uploaded file IDs. JSON edits support GPT image models only; DALL-E edits require multipart (`dall-e-2` only). ' properties: model: anyOf: - type: string - type: string enum: - gpt-image-1.5 - gpt-image-2 - gpt-image-2-2026-04-21 - gpt-image-2.5-sunburst - gpt-image-2.5-sunburst-2026-09-08 - gpt-image-2.5-flare - gpt-image-2.5-flare-2026-09-08 - gpt-image-1 - gpt-image-1-mini - chatgpt-image-latest - type: 'null' x-oaiTypeLabel: string default: gpt-image-1.5 example: gpt-image-1.5 description: The GPT image model to use for image editing, including `gpt-image-2`, its dated snapshot `gpt-image-2-2026-04-21`, `gpt-image-2.5-sunburst`, `gpt-image-2.5-sunburst-2026-09-08`, `gpt-image-2.5-flare`, and `gpt-image-2.5-flare-2026-09-08`. images: type: array minItems: 1 maxItems: 16 description: 'Input image references to edit. For GPT image models, you can provide up to 16 images. ' items: $ref: '#/components/schemas/ImageRefParam' mask: $ref: '#/components/schemas/ImageRefParam' prompt: type: string minLength: 1 maxLength: 32000 example: Add a watercolor effect and keep the subject centered description: A text description of the desired image edit. n: anyOf: - type: integer minimum: 1 maximum: 10 - type: 'null' default: 1 example: 1 description: The number of edited images to generate. quality: anyOf: - type: string enum: - low - medium - high - xhigh - max - auto - type: 'null' default: auto example: high description: 'Output quality for GPT image models. The GPT image models support `low`, `medium`, and `high`. `gpt-image-2.5-sunburst` and `gpt-image-2.5-flare`, including their `2026-09-08` snapshots, also support `xhigh` and `max`. Defaults to `auto`. ' input_fidelity: anyOf: - type: string enum: - high - low - type: 'null' description: Controls fidelity to the original input image(s). size: anyOf: - type: string - type: string enum: - auto - 1024x1024 - 1536x1024 - 1024x1536 - type: 'null' default: auto example: 1024x1024 description: The size of the generated images. For `gpt-image-2`, `gpt-image-2-2026-04-21`, `gpt-image-2.5-sunburst`, `gpt-image-2.5-sunburst-2026-09-08`, `gpt-image-2.5-flare`, and `gpt-image-2.5-flare-2026-09-08`, arbitrary resolutions are supported as `WIDTHxHEIGHT` strings, for example `1536x864`. Width and height must both be divisible by 16 and the requested aspect ratio must be between 1:3 and 3:1. Resolutions above `2560x1440` are experimental, and the maximum supported resolution is `3840x2160`. The requested size must also satisfy the model's current pixel and edge limits. The standard sizes `1024x1024`, `1536x1024`, and `1024x1536` are supported by the GPT image models; `auto` is supported for models that allow automatic sizing. user: type: string example: user-1234 description: 'A unique identifier representing your end-user, which can help OpenAI monitor and detect abuse. ' output_format: anyOf: - type: string enum: - png - jpeg - webp - type: 'null' default: png example: png description: Output image format. Supported for GPT image models. output_compression: anyOf: - type: integer minimum: 0 maximum: 100 - type: 'null' example: 100 description: Compression level for `jpeg` or `webp` output. moderation: anyOf: - type: string enum: - low - auto - type: 'null' default: auto example: auto description: Moderation level for GPT image models. background: anyOf: - type: string enum: - transparent - opaque - auto - type: 'null' default: auto example: transparent description: Set the background of the generated image output. `gpt-image-2.5-sunburst` and `gpt-image-2.5-flare`, including their `2026-09-08` snapshots, support `opaque` and `transparent` backgrounds. Transparent backgrounds are available for supported GPT Image models. For `gpt-image-2` and `gpt-image-2-2026-04-21`, this support is in preview. When using `transparent`, set the output format to `png` or `webp`. stream: anyOf: - type: boolean - type: 'null' default: false example: false description: Stream partial image results as events. partial_images: $ref: '#/components/schemas/PartialImages' required: - images - prompt InputImageContentParamAutoParam: properties: type: type: string enum: - input_image description: The type of the input item. Always `input_image`. default: input_image x-stainless-const: true image_url: anyOf: - type: string maxLength: 20971520 format: uri description: The URL of the image to be sent to the model. A fully qualified URL or base64 encoded image in a data URL. - type: 'null' file_id: anyOf: - type: string description: The ID of the file to be sent to the model. example: file-123 - type: 'null' detail: anyOf: - $ref: '#/components/schemas/DetailEnum' description: The detail level of the image to be sent to the model. One of `high`, `low`, `auto`, or `original`. Defaults to `auto`. - type: 'null' prompt_cache_breakpoint: anyOf: - $ref: '#/components/schemas/PromptCacheBreakpointParam' - type: 'null' type: object required: - type title: Input image description: An image input to the model. Learn about [image inputs](https://developers.openai.com/api/docs/guides/images-vision) ApplyPatchCreateFileOperation: properties: type: type: string enum: - create_file description: Create a new file with the provided diff. default: create_file x-stainless-const: true path: type: string description: Path of the file to create. diff: type: string description: Diff to apply. type: object required: - type - path - diff title: Apply patch create file operation description: Instruction describing how to create a file via the apply_patch tool. _MisalignmentErrorType: anyOf: - type: string - type: string enum: - potentially_unintended_data_transfer - potentially_unintended_data_access - potentially_unintended_destructive_activity - other ModerationResultBody: properties: type: type: string enum: - moderation_result description: The object type, which was always `moderation_result` for successful moderation results. default: moderation_result x-stainless-const: true model: type: string description: The moderation model that produced this result. flagged: type: boolean description: A boolean indicating whether the content was flagged by any category. categories: additionalProperties: type: boolean type: object description: A dictionary of moderation categories to booleans, True if the input is flagged under this category. x-oaiTypeLabel: map category_scores: additionalProperties: type: number type: object description: A dictionary of moderation categories to scores. x-oaiTypeLabel: map category_applied_input_types: additionalProperties: items: $ref: '#/components/schemas/ModerationInputType' type: array type: object description: Which modalities of input are reflected by the score for each category. x-oaiTypeLabel: map type: object required: - type - model - flagged - categories - category_scores - category_applied_input_types title: Moderation result description: A moderation result produced for the response input or output. HybridSearchOptions: properties: embedding_weight: type: number description: The weight of the embedding in the reciprocal ranking fusion. text_weight: type: number description: The weight of the text in the reciprocal ranking fusion. type: object required: - embedding_weight - text_weight ResponseCodeInterpreterCallCodeDeltaEvent: type: object description: Emitted when a partial code snippet is streamed by the code interpreter. properties: type: type: string description: The type of the event. Always `response.code_interpreter_call_code.delta`. enum: - response.code_interpreter_call_code.delta x-stainless-const: true output_index: type: integer description: The index of the output item in the response for which the code is being streamed. item_id: type: string description: The unique identifier of the code interpreter tool call item. delta: type: string description: The partial code snippet being streamed by the code interpreter. sequence_number: type: integer description: The sequence number of this event, used to order streaming events. required: - type - output_index - item_id - delta - sequence_number x-oaiMeta: name: response.code_interpreter_call_code.delta group: responses example: "{\n \"type\": \"response.code_interpreter_call_code.delta\",\n \"output_index\": 0,\n \ \"item_id\": \"ci_12345\",\n \"delta\": \"print('Hello, world')\",\n \"sequence_number\": 1\n}\n" CallableToolAllowedCaller: type: string enum: - direct - programmatic ApproximateLocation: properties: type: type: string enum: - approximate description: The type of location approximation. Always `approximate`. default: approximate x-stainless-const: true country: anyOf: - type: string description: The two-letter [ISO country code](https://en.wikipedia.org/wiki/ISO_3166-1) of the user, e.g. `US`. - type: 'null' region: anyOf: - type: string description: Free text input for the region of the user, e.g. `California`. - type: 'null' city: anyOf: - type: string description: Free text input for the city of the user, e.g. `San Francisco`. - type: 'null' timezone: anyOf: - type: string description: The [IANA timezone](https://timeapi.io/documentation/iana-timezones) of the user, e.g. `America/Los_Angeles`. - type: 'null' type: object required: - type PromptCacheModeEnum: type: string enum: - implicit - explicit CacheMissReasonTypeEnum: type: string enum: - model_changed - prompt_cache_key_changed - tools_changed - text_format_changed - reasoning_effort_changed - verbosity_changed - context_compacted - input_changed - service_tier_changed PromptCacheOptions: properties: ttl: $ref: '#/components/schemas/PromptCacheTTLEnum' description: The minimum lifetime applied to each cache breakpoint. mode: $ref: '#/components/schemas/PromptCacheModeEnum' description: Whether implicit prompt-cache breakpoints were enabled. comparison_response_id: anyOf: - type: string description: The response ID supplied as the prompt cache diagnostics comparison. - type: 'null' type: object required: - ttl - mode title: Prompt cache options description: The prompt-caching options that were applied to the response. Supported for `gpt-5.6` and later models. FileInputDetail: type: string enum: - auto - low - high ResponseFunctionCallArgumentsDeltaEvent: type: object description: Emitted when there is a partial function-call arguments delta. properties: type: type: string description: 'The type of the event. Always `response.function_call_arguments.delta`. ' enum: - response.function_call_arguments.delta x-stainless-const: true item_id: type: string description: 'The ID of the output item that the function-call arguments delta is added to. ' output_index: type: integer description: 'The index of the output item that the function-call arguments delta is added to. ' sequence_number: type: integer description: The sequence number of this event. delta: type: string description: 'The function-call arguments delta that is added. ' required: - type - item_id - output_index - delta - sequence_number x-oaiMeta: name: response.function_call_arguments.delta group: responses example: "{\n \"type\": \"response.function_call_arguments.delta\",\n \"item_id\": \"item-abc\",\n \ \"output_index\": 0,\n \"delta\": \"{ \\\"arg\\\":\"\n \"sequence_number\": 1\n}\n" IncludeEnum: type: string enum: - file_search_call.results - web_search_call.results - web_search_call.action.sources - message.input_image.image_url - computer_call_output.output.image_url - code_interpreter_call.outputs - reasoning.encrypted_content - message.output_text.logprobs description: 'Specify additional output data to include in the model response. Currently supported values are: - `web_search_call.results`: Include the search results of the web search tool call. - `web_search_call.action.sources`: Include the sources of the web search tool call. - `code_interpreter_call.outputs`: Includes the outputs of python code execution in code interpreter tool call items. - `computer_call_output.output.image_url`: Include image urls from the computer call output. - `file_search_call.results`: Include the search results of the file search tool call. - `message.input_image.image_url`: Include image urls from the input message. - `message.output_text.logprobs`: Include logprobs with assistant messages. - `reasoning.encrypted_content`: Includes an encrypted version of reasoning tokens in reasoning item outputs. This enables reasoning items to be used in multi-turn conversations when using the Responses API statelessly (like when the `store` parameter is set to `false`, or when an organization is enrolled in the zero data retention program).' ContainerNetworkPolicyAllowlistParam: properties: type: type: string enum: - allowlist description: Allow outbound network access only to specified domains. Always `allowlist`. default: allowlist x-stainless-const: true allowed_domains: items: type: string type: array minItems: 1 description: A list of allowed domains when type is `allowlist`. domain_secrets: items: $ref: '#/components/schemas/ContainerNetworkPolicyDomainSecretParam' type: array minItems: 1 description: Optional domain-scoped secrets for allowlisted domains. type: object required: - type - allowed_domains SummaryTextContent: properties: type: type: string enum: - summary_text description: The type of the object. Always `summary_text`. default: summary_text x-stainless-const: true text: type: string description: A summary of the reasoning output from the model so far. type: object required: - type - text title: Summary text description: A summary text from the model. ComputerToolCall: type: object title: Computer tool call description: 'A tool call to a computer use tool. See the [computer use guide](https://developers.openai.com/api/docs/guides/tools-computer-use) for more information. ' properties: type: type: string description: The type of the computer call. Always `computer_call`. enum: - computer_call default: computer_call id: type: string description: The unique ID of the computer call. call_id: type: string description: 'An identifier used when responding to the tool call with output. ' action: $ref: '#/components/schemas/ComputerAction' actions: $ref: '#/components/schemas/ComputerActionList' pending_safety_checks: type: array items: $ref: '#/components/schemas/ComputerCallSafetyCheckParam' description: 'The pending safety checks for the computer call. ' status: type: string description: 'The status of the item. One of `in_progress`, `completed`, or `incomplete`. Populated when items are returned via API. ' enum: - in_progress - completed - incomplete required: - type - id - call_id - pending_safety_checks - status LocalShellToolCall: type: object title: Local shell call description: 'A tool call to run a command on the local shell. ' properties: type: type: string enum: - local_shell_call description: 'The type of the local shell call. Always `local_shell_call`. ' x-stainless-const: true id: type: string description: 'The unique ID of the local shell call. ' call_id: type: string description: 'The unique ID of the local shell tool call generated by the model. ' action: $ref: '#/components/schemas/LocalShellExecAction' status: type: string enum: - in_progress - completed - incomplete description: 'The status of the local shell call. ' required: - type - id - call_id - action - status ChatCompletionStreamResponseDelta: type: object description: A chat completion delta generated by streamed model responses. properties: content: anyOf: - type: string description: The contents of the chunk message. - type: 'null' function_call: deprecated: true type: object description: Deprecated and replaced by `tool_calls`. The name and arguments of a function that should be called, as generated by the model. properties: arguments: type: string description: The arguments to call the function with, as generated by the model in JSON format. Note that the model does not always generate valid JSON, and may hallucinate parameters not defined by your function schema. Validate the arguments in your code before calling your function. name: type: string description: The name of the function to call. tool_calls: type: array items: $ref: '#/components/schemas/ChatCompletionMessageToolCallChunk' role: type: string enum: - developer - system - user - assistant - tool description: The role of the author of this message. refusal: anyOf: - type: string description: The refusal message generated by the model. - type: 'null' ModerationErrorBody: properties: type: type: string enum: - error description: The object type, which was always `error` for moderation failures. default: error x-stainless-const: true code: type: string description: The error code. message: type: string description: The error message. type: object required: - type - code - message title: Moderation error description: An error produced while attempting moderation for the response input or output. FunctionToolCallOutput: type: object title: Function tool call output description: 'The output of a function tool call. ' properties: id: type: string description: 'The unique ID of the function tool call output. Populated when this item is returned via API. ' type: type: string enum: - function_call_output description: 'The type of the function tool call output. Always `function_call_output`. ' x-stainless-const: true call_id: type: string description: 'The unique ID of the function tool call generated by the model. ' name: type: string description: 'The name of the tool that produced the output. ' namespace: type: string description: 'The namespace of the tool that produced the output. ' caller: anyOf: - $ref: '#/components/schemas/ToolCallCallerParam' - type: 'null' output: description: 'The output from the function call generated by your code. Can be a string or an list of output content. ' oneOf: - type: string description: 'A string of the output of the function call. ' title: string output - type: array items: $ref: '#/components/schemas/FunctionAndCustomToolCallOutput' title: output content list description: 'Text, image, or file output of the function call. ' status: type: string description: 'The status of the item. One of `in_progress`, `completed`, or `incomplete`. Populated when items are returned via API. ' enum: - in_progress - completed - incomplete required: - type - output ComputerUsePreviewTool: properties: type: type: string enum: - computer_use_preview description: The type of the computer use tool. Always `computer_use_preview`. default: computer_use_preview x-stainless-const: true environment: $ref: '#/components/schemas/ComputerEnvironment' description: The type of computer environment to control. display_width: type: integer description: The width of the computer display. display_height: type: integer description: The height of the computer display. type: object required: - type - environment - display_width - display_height title: Computer use preview description: A tool that controls a virtual computer. Learn more about the [computer tool](https://developers.openai.com/api/docs/guides/tools-computer-use). WebSearchContextSize: type: string description: "High level guidance for the amount of context window space to use for the \nsearch. One of `low`, `medium`, or `high`. `medium` is the default.\n" enum: - low - medium - high default: medium SpeechAudioDeltaEvent: type: object description: Emitted for each chunk of audio data generated during speech synthesis. properties: type: type: string description: 'The type of the event. Always `speech.audio.delta`. ' enum: - speech.audio.delta x-stainless-const: true audio: type: string description: 'A chunk of Base64-encoded audio data. ' required: - type - audio x-oaiMeta: name: Stream Event (speech.audio.delta) group: speech example: "{\n \"type\": \"speech.audio.delta\",\n \"audio\": \"base64-encoded-audio-data\"\n}\n" ResponseOutputItemDoneEvent: type: object description: Emitted when an output item is marked done. properties: type: type: string description: 'The type of the event. Always `response.output_item.done`. ' enum: - response.output_item.done x-stainless-const: true output_index: type: integer description: 'The index of the output item that was marked done. ' sequence_number: type: integer description: 'The sequence number of this event. ' item: $ref: '#/components/schemas/OutputItem' description: 'The output item that was marked done. ' required: - type - output_index - item - sequence_number x-oaiMeta: name: response.output_item.done group: responses example: "{\n \"type\": \"response.output_item.done\",\n \"output_index\": 0,\n \"item\": {\n \ \"id\": \"msg_123\",\n \"status\": \"completed\",\n \"type\": \"message\",\n \"role\": \"assistant\",\n \"content\": [\n {\n \"type\": \"output_text\",\n \"text\": \"In a shimmering forest under a sky full of stars, a lonely unicorn named Lila discovered a hidden pond that glowed with moonlight. Every night, she would leave sparkling, magical flowers by the water's edge, hoping to share her beauty with others. One enchanting evening, she woke to find a group of friendly animals gathered around, eager to be friends and share in her magic.\",\n \ \"annotations\": []\n }\n ]\n },\n \"sequence_number\": 1\n}\n" ResponseImageGenCallCompletedEvent: type: object title: ResponseImageGenCallCompletedEvent description: 'Emitted when an image generation tool call has completed and the final image is available. ' properties: type: type: string enum: - response.image_generation_call.completed description: The type of the event. Always 'response.image_generation_call.completed'. x-stainless-const: true output_index: type: integer description: The index of the output item in the response's output array. sequence_number: type: integer description: The sequence number of this event. item_id: type: string description: The unique identifier of the image generation item being processed. required: - type - output_index - item_id - sequence_number x-oaiMeta: name: response.image_generation_call.completed group: responses example: "{\n \"type\": \"response.image_generation_call.completed\",\n \"output_index\": 0,\n \ \"item_id\": \"item-123\",\n \"sequence_number\": 1\n}\n" TranscriptionSegment: type: object properties: id: type: integer description: Unique identifier of the segment. seek: type: integer description: Seek offset of the segment. start: type: number format: double description: Start time of the segment in seconds. end: type: number format: double description: End time of the segment in seconds. text: type: string description: Text content of the segment. tokens: type: array items: type: integer description: Array of token IDs for the text content. temperature: type: number format: float description: Temperature parameter used for generating the segment. avg_logprob: type: number format: float description: Average logprob of the segment. If the value is lower than -1, consider the logprobs failed. compression_ratio: type: number format: float description: Compression ratio of the segment. If the value is greater than 2.4, consider the compression failed. no_speech_prob: type: number format: float description: Probability of no speech in the segment. If the value is higher than 1.0 and the `avg_logprob` is below -1, consider this segment silent. required: - id - seek - start - end - text - tokens - temperature - avg_logprob - compression_ratio - no_speech_prob ScreenshotParam: properties: type: type: string enum: - screenshot description: Specifies the event type. For a screenshot action, this property is always set to `screenshot`. default: screenshot x-stainless-const: true type: object required: - type title: Screenshot description: A screenshot action. Reasoning: type: object description: 'Configuration options for [reasoning models](https://developers.openai.com/api/docs/guides/reasoning). ' title: Reasoning properties: mode: $ref: '#/components/schemas/ReasoningModeEnum' description: 'Controls the reasoning execution mode for the request. When returned on a response, this is the effective execution mode. ' effort: $ref: '#/components/schemas/ReasoningEffort' summary: anyOf: - type: string description: 'A summary of the reasoning performed by the model. This can be useful for debugging and understanding the model''s reasoning process. One of `auto`, `concise`, or `detailed`. `concise` is supported for `computer-use-preview` models and all reasoning models after `gpt-5`. ' enum: - auto - concise - detailed - type: 'null' context: anyOf: - type: string description: 'Controls which reasoning items are rendered back to the model on later turns. If omitted or set to `auto`, the model determines the context mode. The `gpt-5.6` model family defaults to `all_turns`; earlier models default to `current_turn`. When returned on a response, this is the effective reasoning context mode used for the response. ' enum: - auto - current_turn - all_turns - type: 'null' generate_summary: anyOf: - type: string deprecated: true description: '**Deprecated:** use `summary` instead. A summary of the reasoning performed by the model. This can be useful for debugging and understanding the model''s reasoning process. One of `auto`, `concise`, or `detailed`. ' enum: - auto - concise - detailed - type: 'null' MoveParam: properties: type: type: string enum: - move description: Specifies the event type. For a move action, this property is always set to `move`. default: move x-stainless-const: true x: type: integer description: The x-coordinate to move to. y: type: integer description: The y-coordinate to move to. keys: anyOf: - items: type: string type: array description: The keys being held while moving the mouse. - type: 'null' type: object required: - type - x - y title: Move description: A mouse move action. RefusalContent: properties: type: type: string enum: - refusal description: The type of the refusal. Always `refusal`. default: refusal x-stainless-const: true refusal: type: string description: The refusal explanation from the model. type: object required: - type - refusal title: Refusal description: A refusal from the model. ChatCompletionNamedToolChoice: type: object title: Function tool choice description: Specifies a tool the model should use. Use to force the model to call a specific function. properties: type: type: string enum: - function description: For function calling, the type is always `function`. x-stainless-const: true function: type: object properties: name: type: string description: The name of the function to call. required: - name required: - type - function ReasoningEffort: anyOf: - type: string enum: - none - minimal - low - medium - high - xhigh - max default: medium description: 'Constrains effort on reasoning for reasoning models. Currently supported values are `none`, `minimal`, `low`, `medium`, `high`, `xhigh`, and `max`. Reducing reasoning effort can result in faster responses and fewer tokens used on reasoning in a response. Not all reasoning models support every value. See the [reasoning guide](https://developers.openai.com/api/docs/guides/reasoning) for model-specific support. ' - type: 'null' RankingOptions: properties: ranker: $ref: '#/components/schemas/RankerVersionType' description: The ranker to use for the file search. score_threshold: type: number description: The score threshold for the file search, a number between 0 and 1. Numbers closer to 1 will attempt to return only the most relevant results, but may return fewer results. hybrid_search: $ref: '#/components/schemas/HybridSearchOptions' description: Weights that control how reciprocal rank fusion balances semantic embedding matches versus sparse keyword matches when hybrid search is enabled. type: object required: [] FunctionShellCallOutputTimeoutOutcome: properties: type: type: string enum: - timeout description: The outcome type. Always `timeout`. default: timeout x-stainless-const: true type: object required: - type title: Shell call timeout outcome description: Indicates that the shell call exceeded its configured time limit. ImageEditStreamEvent: anyOf: - $ref: '#/components/schemas/ImageEditPartialImageEvent' - $ref: '#/components/schemas/ImageEditCompletedEvent' discriminator: propertyName: type BatchError: type: object properties: code: type: string description: An error code identifying the error type. message: type: string description: A human-readable message providing more details about the error. param: anyOf: - type: string description: The name of the parameter that caused the error, if applicable. - type: 'null' line: anyOf: - type: integer description: The line number of the input file where the error occurred, if applicable. - type: 'null' AutoCodeInterpreterToolParam: properties: type: type: string enum: - auto description: Always `auto`. default: auto x-stainless-const: true file_ids: items: type: string example: file-123 type: array maxItems: 50 description: An optional list of uploaded files to make available to your code. memory_limit: anyOf: - $ref: '#/components/schemas/ContainerMemoryLimit' description: The memory limit for the code interpreter container. - type: 'null' network_policy: oneOf: - $ref: '#/components/schemas/ContainerNetworkPolicyDisabledParam' - $ref: '#/components/schemas/ContainerNetworkPolicyAllowlistParam' description: Network access policy for the container. discriminator: propertyName: type type: object required: - type title: CodeInterpreterToolAuto description: Configuration for a code interpreter container. Optionally specify the IDs of the files to run the code on. MCPProtocolError: properties: type: type: string enum: - mcp_protocol_error default: mcp_protocol_error x-stainless-const: true code: type: integer message: type: string type: object required: - type - code - message ResponseFormatJsonObject: type: object title: JSON object description: 'JSON object response format. An older method of generating JSON responses. Using `json_schema` is recommended for models that support it. Note that the model will not generate JSON without a system or user message instructing it to do so. ' properties: type: type: string description: The type of response format being defined. Always `json_object`. enum: - json_object x-stainless-const: true required: - type LocalShellToolCallOutput: type: object title: Local shell call output description: 'The output of a local shell tool call. ' properties: type: type: string enum: - local_shell_call_output description: 'The type of the local shell tool call output. Always `local_shell_call_output`. ' x-stainless-const: true id: type: string description: 'The unique ID of the local shell tool call generated by the model. ' output: type: string description: 'A JSON string of the output of the local shell tool call. ' status: anyOf: - type: string enum: - in_progress - completed - incomplete description: 'The status of the item. One of `in_progress`, `completed`, or `incomplete`. ' - type: 'null' required: - id - type - call_id - output ResponseTextParam: type: object description: 'Configuration options for a text response from the model. Can be plain text or structured JSON data. Learn more: - [Text inputs and outputs](https://developers.openai.com/api/docs/guides/text) - [Structured Outputs](https://developers.openai.com/api/docs/guides/structured-outputs) ' properties: format: $ref: '#/components/schemas/TextResponseFormatConfiguration' verbosity: $ref: '#/components/schemas/Verbosity' LocalShellToolParam: properties: type: type: string enum: - local_shell description: The type of the local shell tool. Always `local_shell`. default: local_shell x-stainless-const: true type: object required: - type title: Local shell tool description: A tool that allows the model to execute shell commands in a local environment. CreateFileRequest: type: object additionalProperties: false properties: file: description: 'The File object (not file name) to be uploaded. ' type: string format: binary purpose: description: 'The intended purpose of the uploaded file. One of: - `assistants`: Used in the Assistants API - `batch`: Used in the Batch API - `fine-tune`: Used for fine-tuning - `vision`: Images used for vision fine-tuning - `user_data`: Flexible file type for any purpose - `evals`: Used for eval data sets ' type: string enum: - assistants - batch - fine-tune - vision - user_data - evals expires_after: $ref: '#/components/schemas/FileExpirationAfter' required: - file - purpose InputMessageContentList: type: array title: Input item content list description: "A list of one or many input items to the model, containing different content \ntypes.\n" items: $ref: '#/components/schemas/InputContent' ContainerMemoryLimit: type: string enum: - 1g - 4g - 16g - 64g FunctionShellCallOutput: properties: type: type: string enum: - shell_call_output description: The type of the shell call output. Always `shell_call_output`. default: shell_call_output x-stainless-const: true id: type: string description: The unique ID of the shell call output. Populated when this item is returned via API. call_id: type: string description: The unique ID of the shell tool call generated by the model. caller: anyOf: - $ref: '#/components/schemas/ToolCallCaller' description: The execution context that produced this tool call. - type: 'null' status: $ref: '#/components/schemas/FunctionShellCallOutputStatusEnum' description: The status of the shell call output. One of `in_progress`, `completed`, or `incomplete`. output: items: $ref: '#/components/schemas/FunctionShellCallOutputContent' type: array description: An array of shell call output contents max_output_length: anyOf: - type: integer description: The maximum length of the shell command output. This is generated by the model and should be passed back with the raw output. - type: 'null' created_by: type: string description: The identifier of the actor that created the item. type: object required: - type - id - call_id - status - output - max_output_length title: Shell call output description: The output of a shell tool call that was emitted. OpenAIFile: title: OpenAIFile description: The `File` object represents a document that has been uploaded to OpenAI. properties: id: type: string description: The file identifier, which can be referenced in the API endpoints. bytes: type: integer description: The size of the file, in bytes. created_at: type: integer format: unixtime description: The Unix timestamp (in seconds) for when the file was created. expires_at: type: integer format: unixtime description: The Unix timestamp (in seconds) for when the file will expire. filename: type: string description: The name of the file. object: type: string description: The object type, which is always `file`. enum: - file x-stainless-const: true purpose: type: string description: The intended purpose of the file. Supported values are `assistants`, `assistants_output`, `batch`, `batch_output`, `fine-tune`, `fine-tune-results`, `vision`, and `user_data`. enum: - assistants - assistants_output - batch - batch_output - fine-tune - fine-tune-results - vision - user_data status: type: string deprecated: true description: Deprecated. The current status of the file, which can be either `uploaded`, `processed`, or `error`. enum: - uploaded - processed - error status_details: type: string deprecated: true description: Deprecated. For details on why a fine-tuning training file failed validation, see the `error` field on `fine_tuning.job`. required: - id - object - bytes - created_at - filename - purpose - status x-oaiMeta: name: The file object example: "{\n \"id\": \"file-abc123\",\n \"object\": \"file\",\n \"bytes\": 120000,\n \"created_at\": 1677610602,\n \"expires_at\": 1680202602,\n \"filename\": \"salesOverview.pdf\",\n \"purpose\": \"assistants\",\n}\n" ResponsePromptVariables: anyOf: - type: object title: Prompt Variables description: 'Optional map of values to substitute in for variables in your prompt. The substitution values can either be strings, or other Response input types like images or files. ' x-oaiExpandable: true x-oaiTypeLabel: map additionalProperties: x-oaiExpandable: true x-oaiTypeLabel: map oneOf: - type: string - $ref: '#/components/schemas/InputTextContent' - $ref: '#/components/schemas/InputImageContent' - $ref: '#/components/schemas/InputFileContent' - type: 'null' FilePath: type: object title: File path description: 'A path to a file. ' properties: type: type: string description: 'The type of the file path. Always `file_path`. ' enum: - file_path x-stainless-const: true file_id: type: string description: 'The ID of the file. ' index: type: integer description: 'The index of the file in the list of files. ' required: - type - file_id - index CreateTranslationRequest: type: object additionalProperties: false properties: file: description: 'The audio file object (not file name) translate, in one of these formats: flac, mp3, mp4, mpeg, mpga, m4a, ogg, wav, or webm. The request must include enough format metadata for the file to be identified. We recommend an extension-bearing filename and an appropriate content type. ' type: string x-oaiTypeLabel: file format: binary model: description: 'ID of the model to use. Only `whisper-1` (which is powered by our open source Whisper V2 model) is currently available. ' example: whisper-1 anyOf: - type: string - type: string enum: - whisper-1 x-stainless-const: true x-oaiTypeLabel: string prompt: description: 'An optional text to guide the model''s style or continue a previous audio segment. The [prompt](https://developers.openai.com/api/docs/guides/speech-to-text#prompting) should be in English. ' type: string response_format: description: 'The format of the output, in one of these options: `json`, `text`, `srt`, `verbose_json`, or `vtt`. ' type: string enum: - json - text - srt - verbose_json - vtt default: json temperature: description: 'The sampling temperature, between 0 and 1. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. If set to 0, the model will use [log probability](https://en.wikipedia.org/wiki/Log_probability) to automatically increase the temperature until certain thresholds are hit. ' type: number default: 0 required: - file - model ToolSearchOutputItemParam: properties: id: anyOf: - type: string description: The unique ID of this tool search output. example: tso_123 - type: 'null' call_id: anyOf: - type: string maxLength: 64 minLength: 1 description: The unique ID of the tool search call generated by the model. - type: 'null' type: type: string enum: - tool_search_output description: The item type. Always `tool_search_output`. default: tool_search_output x-stainless-const: true execution: $ref: '#/components/schemas/ToolSearchExecutionType' description: Whether tool search was executed by the server or by the client. tools: items: $ref: '#/components/schemas/Tool' type: array description: The loaded tool definitions returned by the tool search output. status: anyOf: - $ref: '#/components/schemas/FunctionCallItemStatus' description: The status of the tool search output. - type: 'null' type: object required: - type - tools ProgramToolCallCallerParam: properties: type: type: string enum: - program description: The caller type. Always `program`. default: program x-stainless-const: true caller_id: type: string maxLength: 64 minLength: 1 description: The call ID of the program item that produced this tool call. type: object required: - type - caller_id DetailEnum: type: string enum: - low - high - auto - original ResponseReasoningTextDoneEvent: type: object description: Emitted when a reasoning text is completed. properties: type: type: string description: 'The type of the event. Always `response.reasoning_text.done`. ' enum: - response.reasoning_text.done x-stainless-const: true item_id: type: string description: 'The ID of the item this reasoning text is associated with. ' output_index: type: integer description: 'The index of the output item this reasoning text is associated with. ' content_index: type: integer description: 'The index of the reasoning content part. ' text: type: string description: 'The full text of the completed reasoning content. ' sequence_number: type: integer description: 'The sequence number of this event. ' required: - type - item_id - output_index - content_index - text - sequence_number x-oaiMeta: name: response.reasoning_text.done group: responses example: "{\n \"type\": \"response.reasoning_text.done\",\n \"item_id\": \"rs_123\",\n \"output_index\": 0,\n \"content_index\": 0,\n \"text\": \"The user is asking...\",\n \"sequence_number\": 4\n}\n" ChatCompletionMessageCustomToolCall: type: object title: Custom tool call description: 'A call to a custom tool created by the model. ' properties: id: type: string description: The ID of the tool call. type: type: string enum: - custom description: The type of the tool. Always `custom`. x-stainless-const: true custom: type: object description: The custom tool that the model called. properties: name: type: string description: The name of the custom tool to call. input: type: string description: The input for the custom tool call generated by the model. required: - name - input required: - id - type - custom ConversationParam-2: properties: id: type: string description: The unique ID of the conversation. example: conv_123 type: object required: - id title: Conversation object description: The conversation that this response belongs to. ListModelsResponse: type: object properties: object: type: string enum: - list x-stainless-const: true data: type: array items: $ref: '#/components/schemas/Model' required: - object - data ResponseOutputItemAddedEvent: type: object description: Emitted when a new output item is added. properties: type: type: string description: 'The type of the event. Always `response.output_item.added`. ' enum: - response.output_item.added x-stainless-const: true output_index: type: integer description: 'The index of the output item that was added. ' sequence_number: type: integer description: 'The sequence number of this event. ' item: $ref: '#/components/schemas/OutputItem' description: 'The output item that was added. For reasoning items, `encrypted_content` may be incomplete while the item is in progress. Use the reasoning item from the corresponding `response.output_item.done` event when passing it as input to a subsequent request. ' required: - type - output_index - item - sequence_number x-oaiMeta: name: response.output_item.added group: responses example: "{\n \"type\": \"response.output_item.added\",\n \"output_index\": 0,\n \"item\": {\n \"id\": \"msg_123\",\n \"status\": \"in_progress\",\n \"type\": \"message\",\n \ \"role\": \"assistant\",\n \"content\": []\n },\n \"sequence_number\": 1\n}\n" AudioResponseFormat: description: 'The format of the output, in one of these options: `json`, `text`, `srt`, `verbose_json`, `vtt`, or `diarized_json`. For `gpt-4o-transcribe` and `gpt-4o-mini-transcribe`, the only supported format is `json`. For `gpt-4o-transcribe-diarize`, the supported formats are `json`, `text`, and `diarized_json`, with `diarized_json` required to receive speaker annotations. ' type: string enum: - json - text - srt - verbose_json - vtt - diarized_json default: json ImagesUsage: type: object description: 'For the GPT image models only, the token usage information for the image generation. ' required: - total_tokens - input_tokens - output_tokens - input_tokens_details properties: total_tokens: type: integer description: 'The total number of tokens (images and text) used for the image generation. ' input_tokens: type: integer description: The number of tokens (images and text) in the input prompt. output_tokens: type: integer description: The number of image tokens in the output image. input_tokens_details: type: object description: The input tokens detailed information for the image generation. required: - text_tokens - image_tokens properties: text_tokens: type: integer description: The number of text tokens in the input prompt. image_tokens: type: integer description: The number of image tokens in the input prompt. CreateTranslationResponseJson: type: object properties: text: type: string required: - text SpecificFunctionShellParam: properties: type: type: string enum: - shell description: The tool to call. Always `shell`. default: shell x-stainless-const: true type: object required: - type title: Specific shell tool choice description: Forces the model to call the shell tool when a tool call is required. MisalignmentErrorDetailsResource: properties: error_type: $ref: '#/components/schemas/_MisalignmentErrorType' description: An optional classification; clients must accept additional values. detailed_explanation: type: string description: The public explanation for this block. steer: $ref: '#/components/schemas/_MisalignmentSteer' description: An optional public continuation instruction. type: object required: [] ToolChoiceCustom: type: object title: Custom tool description: 'Use this option to force the model to call a specific custom tool. ' properties: type: type: string enum: - custom description: For custom tool calling, the type is always `custom`. x-stainless-const: true name: type: string description: The name of the custom tool to call. required: - type - name ResponseOutputTextAnnotationAddedEvent: type: object title: ResponseOutputTextAnnotationAddedEvent description: 'Emitted when an annotation is added to output text content. ' properties: type: type: string enum: - response.output_text.annotation.added description: The type of the event. Always 'response.output_text.annotation.added'. x-stainless-const: true item_id: type: string description: The unique identifier of the item to which the annotation is being added. output_index: type: integer description: The index of the output item in the response's output array. content_index: type: integer description: The index of the content part within the output item. annotation_index: type: integer description: The index of the annotation within the content part. sequence_number: type: integer description: The sequence number of this event. annotation: anyOf: - $ref: '#/components/schemas/Annotation' - type: 'null' description: The annotation object being added. (See annotation schema for details.) required: - type - item_id - output_index - content_index - annotation_index - annotation - sequence_number x-oaiMeta: name: response.output_text.annotation.added group: responses example: "{\n \"type\": \"response.output_text.annotation.added\",\n \"item_id\": \"item-abc\",\n \ \"output_index\": 0,\n \"content_index\": 0,\n \"annotation_index\": 0,\n \"annotation\": {\n \"type\": \"file_citation\",\n \"file_id\": \"file-abc\",\n \"index\": 0,\n \"filename\": \"example.txt\"\n },\n \"sequence_number\": 1\n}\n" ResponseImageGenCallGeneratingEvent: type: object title: ResponseImageGenCallGeneratingEvent description: 'Emitted when an image generation tool call is actively generating an image (intermediate state). ' properties: type: type: string enum: - response.image_generation_call.generating description: The type of the event. Always 'response.image_generation_call.generating'. x-stainless-const: true output_index: type: integer description: The index of the output item in the response's output array. item_id: type: string description: The unique identifier of the image generation item being processed. sequence_number: type: integer description: The sequence number of the image generation item being processed. required: - type - output_index - item_id - sequence_number x-oaiMeta: name: response.image_generation_call.generating group: responses example: "{\n \"type\": \"response.image_generation_call.generating\",\n \"output_index\": 0,\n \ \"item_id\": \"item-123\",\n \"sequence_number\": 0\n}\n" FunctionToolParam: properties: name: type: string maxLength: 128 minLength: 1 pattern: ^[a-zA-Z0-9_-]+$ description: anyOf: - type: string - type: 'null' parameters: anyOf: - $ref: '#/components/schemas/EmptyModelParam' - type: 'null' strict: anyOf: - type: boolean description: Whether to enforce strict parameter validation. If omitted, Responses attempts to use strict validation when the schema is compatible, and falls back to non-strict validation otherwise. - type: 'null' type: type: string enum: - function default: function x-stainless-const: true async: type: boolean description: Whether the tool response can be returned asynchronously versus immediately returned on next response creation. output_schema: anyOf: - additionalProperties: {} type: object description: A JSON Schema describing the JSON value encoded in string outputs for this function tool. This does not describe content-array outputs. x-oaiTypeLabel: map - type: 'null' defer_loading: type: boolean description: Whether this function should be deferred and discovered via tool search. allowed_callers: anyOf: - items: $ref: '#/components/schemas/CallableToolAllowedCaller' type: array minItems: 1 description: The tool invocation context(s). - type: 'null' type: object required: - name - type UrlCitationBody: properties: type: type: string enum: - url_citation description: The type of the URL citation. Always `url_citation`. default: url_citation x-stainless-const: true url: type: string format: uri 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. type: object required: - type - url - start_index - end_index - title title: URL citation description: A citation for a web resource used to generate a model response. ContainerAutoParam: properties: type: type: string enum: - container_auto description: Automatically creates a container for this request default: container_auto x-stainless-const: true file_ids: items: type: string example: file-123 type: array maxItems: 50 description: An optional list of uploaded files to make available to your code. memory_limit: anyOf: - $ref: '#/components/schemas/ContainerMemoryLimit' description: The memory limit for the container. - type: 'null' network_policy: oneOf: - $ref: '#/components/schemas/ContainerNetworkPolicyDisabledParam' - $ref: '#/components/schemas/ContainerNetworkPolicyAllowlistParam' description: Network access policy for the container. discriminator: propertyName: type skills: items: oneOf: - $ref: '#/components/schemas/SkillReferenceParam' - $ref: '#/components/schemas/InlineSkillParam' discriminator: propertyName: type type: array maxItems: 200 description: An optional list of skills referenced by id or inline data. type: object required: - type FunctionShellCallOutputContent: properties: stdout: type: string description: The standard output that was captured. stderr: type: string description: The standard error output that was captured. outcome: oneOf: - $ref: '#/components/schemas/FunctionShellCallOutputTimeoutOutcome' - $ref: '#/components/schemas/FunctionShellCallOutputExitOutcome' title: Shell call outcome description: Represents either an exit outcome (with an exit code) or a timeout outcome for a shell call output chunk. discriminator: propertyName: type created_by: type: string description: The identifier of the actor that created the item. type: object required: - stdout - stderr - outcome title: Shell call output content description: The content of a shell tool call output that was emitted. ConversationParam: description: 'The conversation that this response belongs to. Items from this conversation are prepended to `input_items` for this response request. Input items and output items from this response are automatically added to this conversation after this response completes. ' default: null oneOf: - type: string title: Conversation ID description: 'The unique ID of the conversation. ' - $ref: '#/components/schemas/ConversationParam-2' ResponseQueuedEvent: type: object title: ResponseQueuedEvent description: 'Emitted when a response is queued and waiting to be processed. ' properties: type: type: string enum: - response.queued description: The type of the event. Always 'response.queued'. x-stainless-const: true response: $ref: '#/components/schemas/Response' description: The full response object that is queued. sequence_number: type: integer description: The sequence number for this event. required: - type - response - sequence_number x-oaiMeta: name: response.queued group: responses example: "{\n \"type\": \"response.queued\",\n \"response\": {\n \"id\": \"res_123\",\n \"status\": \"queued\",\n \"created_at\": \"2021-01-01T00:00:00Z\",\n \"updated_at\": \"2021-01-01T00:00:00Z\"\n \ },\n \"sequence_number\": 1\n}\n" SearchContextSize: type: string enum: - low - medium - high ResponseCodeInterpreterCallCompletedEvent: type: object description: Emitted when the code interpreter call is completed. properties: type: type: string description: The type of the event. Always `response.code_interpreter_call.completed`. enum: - response.code_interpreter_call.completed x-stainless-const: true output_index: type: integer description: The index of the output item in the response for which the code interpreter call is completed. item_id: type: string description: The unique identifier of the code interpreter tool call item. sequence_number: type: integer description: The sequence number of this event, used to order streaming events. required: - type - output_index - item_id - sequence_number x-oaiMeta: name: response.code_interpreter_call.completed group: responses example: "{\n \"type\": \"response.code_interpreter_call.completed\",\n \"output_index\": 5,\n \ \"item_id\": \"ci_12345\",\n \"sequence_number\": 1\n}\n" LogProb: properties: token: type: string logprob: type: number bytes: items: type: integer type: array top_logprobs: items: $ref: '#/components/schemas/TopLogProb' type: array type: object required: - token - logprob - bytes - top_logprobs title: Log probability description: The log probability of a token. ImageRefParam: type: object description: 'Reference an input image by either URL or uploaded file ID. Provide exactly one of `image_url` or `file_id`. ' properties: image_url: type: string format: uri maxLength: 20971520 description: A fully qualified URL or base64-encoded data URL. example: https://example.com/source-image.png file_id: type: string description: The File API ID of an uploaded image to use as input. example: file-abc123 anyOf: - required: - image_url - required: - file_id not: required: - image_url - file_id additionalProperties: false ResponseTextDoneEvent: type: object description: Emitted when text content is finalized. properties: type: type: string description: 'The type of the event. Always `response.output_text.done`. ' enum: - response.output_text.done x-stainless-const: true item_id: type: string description: 'The ID of the output item that the text content is finalized. ' output_index: type: integer description: 'The index of the output item that the text content is finalized. ' content_index: type: integer description: 'The index of the content part that the text content is finalized. ' text: type: string description: 'The text content that is finalized. ' sequence_number: type: integer description: The sequence number for this event. logprobs: type: array description: 'The log probabilities of the tokens in the delta. ' items: $ref: '#/components/schemas/ResponseLogProb' required: - type - item_id - output_index - content_index - text - sequence_number - logprobs x-oaiMeta: name: response.output_text.done group: responses example: "{\n \"type\": \"response.output_text.done\",\n \"item_id\": \"msg_123\",\n \"output_index\": 0,\n \"content_index\": 0,\n \"text\": \"In a shimmering forest under a sky full of stars, a lonely unicorn named Lila discovered a hidden pond that glowed with moonlight. Every night, she would leave sparkling, magical flowers by the water's edge, hoping to share her beauty with others. One enchanting evening, she woke to find a group of friendly animals gathered around, eager to be friends and share in her magic.\",\n \"sequence_number\": 1\n}\n" PredictionContent: type: object title: Static Content description: 'Static predicted output content, such as the content of a text file that is being regenerated. ' required: - type - content properties: type: type: string enum: - content description: 'The type of the predicted content you want to provide. This type is currently always `content`. ' x-stainless-const: true content: description: 'The content that should be matched when generating a model response. If generated tokens would match this content, the entire model response can be returned much more quickly. ' oneOf: - type: string title: Text content description: 'The content used for a Predicted Output. This is often the text of a file you are regenerating with minor changes. ' - type: array description: An array of content parts with a defined type. Supported options differ based on the [model](https://developers.openai.com/api/docs/models) being used to generate the response. Can contain text inputs. title: Array of content parts items: $ref: '#/components/schemas/ChatCompletionRequestMessageContentPartText' minItems: 1 InputFileContent: properties: type: type: string enum: - input_file description: The type of the input item. Always `input_file`. default: input_file x-stainless-const: true file_id: anyOf: - type: string description: The ID of the file to be sent to the model. - type: 'null' filename: type: string description: The name of the file to be sent to the model. file_data: type: string description: 'The content of the file to be sent to the model. ' prompt_cache_breakpoint: $ref: '#/components/schemas/PromptCacheBreakpointConfig' file_url: type: string format: uri description: The URL of the file to be sent to the model. detail: $ref: '#/components/schemas/FileInputDetail' description: The detail level of the file to be sent to the model. Use `auto` to let the system select the detail level; for GPT-5.6 and later models, `auto` uses high-quality rendering, which may increase input token usage. Use `low` for lower-cost rendering, or `high` to render the file at higher quality. Defaults to `auto`. type: object required: - type title: Input file description: A file input to the model. InputTextContentParam: properties: type: type: string enum: - input_text description: The type of the input item. Always `input_text`. default: input_text x-stainless-const: true text: type: string maxLength: 10485760 description: The text input to the model. prompt_cache_breakpoint: anyOf: - $ref: '#/components/schemas/PromptCacheBreakpointParam' - type: 'null' type: object required: - type - text title: Input text description: A text input to the model. ImageGenActionEnum: type: string enum: - generate - edit - auto KeyPressAction: properties: type: type: string enum: - keypress description: Specifies the event type. For a keypress action, this property is always set to `keypress`. default: keypress x-stainless-const: true keys: items: type: string description: One of the keys the model is requesting to be pressed. type: array description: The combination of keys the model is requesting to be pressed. This is an array of strings, each representing a key. type: object required: - type - keys title: KeyPress description: A collection of keypresses the model would like to perform. ResponseReasoningTextDeltaEvent: type: object description: Emitted when a delta is added to a reasoning text. properties: type: type: string description: 'The type of the event. Always `response.reasoning_text.delta`. ' enum: - response.reasoning_text.delta x-stainless-const: true item_id: type: string description: 'The ID of the item this reasoning text delta is associated with. ' output_index: type: integer description: 'The index of the output item this reasoning text delta is associated with. ' content_index: type: integer description: 'The index of the reasoning content part this delta is associated with. ' delta: type: string description: 'The text delta that was added to the reasoning content. ' sequence_number: type: integer description: 'The sequence number of this event. ' required: - type - item_id - output_index - content_index - delta - sequence_number x-oaiMeta: name: response.reasoning_text.delta group: responses example: "{\n \"type\": \"response.reasoning_text.delta\",\n \"item_id\": \"rs_123\",\n \"output_index\": 0,\n \"content_index\": 0,\n \"delta\": \"The\",\n \"sequence_number\": 1\n}\n" FunctionShellCallOutputTimeoutOutcomeParam: properties: type: type: string enum: - timeout description: The outcome type. Always `timeout`. default: timeout x-stainless-const: true type: object required: - type title: Shell call timeout outcome description: Indicates that the shell call exceeded its configured time limit. CreateEmbeddingResponse: type: object properties: data: type: array description: The list of embeddings generated by the model. items: $ref: '#/components/schemas/Embedding' model: type: string description: The name of the model used to generate the embedding. object: type: string description: The object type, which is always "list". enum: - list x-stainless-const: true usage: type: object description: The usage information for the request. properties: prompt_tokens: type: integer description: The number of tokens used by the prompt. total_tokens: type: integer description: The total number of tokens used by the request. required: - prompt_tokens - total_tokens required: - object - model - data - usage FunctionShellCallItemStatus: type: string enum: - in_progress - completed - incomplete title: Shell call status description: Status values reported for shell tool calls. TranscriptionWord: type: object properties: word: type: string description: The text content of the word. start: type: number format: double description: Start time of the word in seconds. end: type: number format: double description: End time of the word in seconds. required: - word - start - end InputFileContentParam: properties: type: type: string enum: - input_file description: The type of the input item. Always `input_file`. default: input_file x-stainless-const: true file_id: anyOf: - type: string description: The ID of the file to be sent to the model. example: file-123 - type: 'null' filename: anyOf: - type: string description: The name of the file to be sent to the model. - type: 'null' file_data: anyOf: - type: string maxLength: 73400320 description: The base64-encoded data of the file to be sent to the model. - type: 'null' file_url: anyOf: - type: string format: uri description: The URL of the file to be sent to the model. - type: 'null' detail: $ref: '#/components/schemas/FileDetailEnum' description: The detail level of the file to be sent to the model. Use `auto` to let the system select the detail level; for GPT-5.6 and later models, `auto` uses high-quality rendering, which may increase input token usage. Use `low` for lower-cost rendering, or `high` to render the file at higher quality. Defaults to `auto`. prompt_cache_breakpoint: anyOf: - $ref: '#/components/schemas/PromptCacheBreakpointParam' - type: 'null' type: object required: - type title: Input file description: A file input to the model. ChatCompletionRequestDeveloperMessage: type: object title: Developer message description: 'Developer-provided instructions that the model should follow, regardless of messages sent by the user. With o1 models and newer, `developer` messages replace the previous `system` messages. ' properties: content: description: The contents of the developer message. oneOf: - type: string description: The contents of the developer message. title: Text content - type: array description: An array of content parts with a defined type. For developer messages, only type `text` is supported. title: Array of content parts items: $ref: '#/components/schemas/ChatCompletionRequestMessageContentPartText' minItems: 1 role: type: string enum: - developer description: The role of the messages author, in this case `developer`. x-stainless-const: true name: type: string description: An optional name for the participant. Provides the model information to differentiate between participants of the same role. required: - content - role ResponseMCPCallArgumentsDoneEvent: type: object title: ResponseMCPCallArgumentsDoneEvent description: 'Emitted when the arguments for an MCP tool call are finalized. ' properties: type: type: string enum: - response.mcp_call_arguments.done description: The type of the event. Always 'response.mcp_call_arguments.done'. x-stainless-const: true output_index: type: integer description: The index of the output item in the response's output array. item_id: type: string description: The unique identifier of the MCP tool call item being processed. arguments: type: string description: 'A JSON string containing the finalized arguments for the MCP tool call. ' sequence_number: type: integer description: The sequence number of this event. required: - type - output_index - item_id - arguments - sequence_number x-oaiMeta: name: response.mcp_call_arguments.done group: responses example: "{\n \"type\": \"response.mcp_call_arguments.done\",\n \"output_index\": 0,\n \"item_id\": \"item-abc\",\n \"arguments\": \"{\\\"arg1\\\": \\\"value1\\\", \\\"arg2\\\": \\\"value2\\\"}\",\n \ \"sequence_number\": 1\n}\n" PartialImages: anyOf: - type: integer maximum: 3 minimum: 0 default: 0 example: 1 description: 'The number of partial images to generate. This parameter is used for streaming responses that return partial images. Value must be between 0 and 3. When set to 0, the response will be a single image sent in one streaming event. Note that the final image may be sent before the full number of partial images are generated if the full image is generated more quickly. ' - type: 'null' ApplyPatchCallStatus: type: string enum: - in_progress - completed CreateCompletionResponse: type: object description: 'Represents a completion response from the API. Note: both the streamed and non-streamed response objects share the same shape (unlike the chat endpoint). ' properties: id: type: string description: A unique identifier for the completion. choices: type: array description: The list of completion choices the model generated for the input prompt. items: type: object required: - finish_reason - index - logprobs - text properties: finish_reason: type: string description: 'The reason the model stopped generating tokens. This will be `stop` if the model hit a natural stop point or a provided stop sequence, `length` if the maximum number of tokens specified in the request was reached, or `content_filter` if content was omitted due to a flag from our content filters. ' enum: - stop - length - content_filter index: type: integer logprobs: anyOf: - type: object properties: text_offset: type: array items: type: integer token_logprobs: type: array items: type: number tokens: type: array items: type: string top_logprobs: type: array items: type: object additionalProperties: type: number - type: 'null' text: type: string created: type: integer format: unixtime description: The Unix timestamp (in seconds) of when the completion was created. model: type: string description: The model used for completion. system_fingerprint: type: string description: 'This fingerprint represents the backend configuration that the model runs with. Can be used in conjunction with the `seed` request parameter to understand when backend changes have been made that might impact determinism. ' object: type: string description: The object type, which is always "text_completion" enum: - text_completion x-stainless-const: true usage: $ref: '#/components/schemas/CompletionUsage' required: - id - object - created - model - choices x-oaiMeta: name: The completion object legacy: true example: "{\n \"id\": \"cmpl-uqkvlQyYK7bGYrRHQ0eXlWi7\",\n \"object\": \"text_completion\",\n \ \"created\": 1589478378,\n \"model\": \"gpt-3.5-turbo-instruct\",\n \"choices\": [\n {\n \ \"text\": \"\\n\\nThis is indeed a test\",\n \"index\": 0,\n \"logprobs\": null,\n \ \"finish_reason\": \"length\"\n }\n ],\n \"usage\": {\n \"prompt_tokens\": 5,\n \ \"completion_tokens\": 7,\n \"total_tokens\": 12\n }\n}\n" MCPToolCallStatus: type: string enum: - in_progress - completed - incomplete - calling - failed TranscriptTextSegmentEvent: type: object description: 'Emitted when a diarized transcription returns a completed segment with speaker information. Only emitted when you [create a transcription](https://developers.openai.com/api/reference/resources/audio/subresources/transcriptions/methods/create) with `stream` set to `true` and `response_format` set to `diarized_json`. ' properties: type: type: string description: The type of the event. Always `transcript.text.segment`. enum: - transcript.text.segment x-stainless-const: true id: type: string description: Unique identifier for the segment. start: type: number format: double description: Start timestamp of the segment in seconds. end: type: number format: double description: End timestamp of the segment in seconds. text: type: string description: Transcript text for this segment. speaker: type: string description: Speaker label for this segment. required: - type - id - start - end - text - speaker x-oaiMeta: name: Stream Event (transcript.text.segment) group: transcript example: "{\n \"type\": \"transcript.text.segment\",\n \"id\": \"seg_002\",\n \"start\": 5.2,\n \ \"end\": 12.8,\n \"text\": \"Hi, I need help with diarization.\",\n \"speaker\": \"A\"\n}\n" CreateImageEditRequest: type: object properties: image: anyOf: - type: string format: binary - type: array maxItems: 16 items: type: string format: binary description: 'The image(s) to edit. Must be a supported image file or an array of images. For the GPT image models (`gpt-image-1`, `gpt-image-1-mini`, `gpt-image-1.5`, `gpt-image-2`, `gpt-image-2-2026-04-21`, `gpt-image-2.5-sunburst`, `gpt-image-2.5-sunburst-2026-09-08`, `gpt-image-2.5-flare`, and `gpt-image-2.5-flare-2026-09-08`), each image should be a `png`, `webp`, or `jpg` file less than 50MB. You can provide up to 16 images. `chatgpt-image-latest` follows the same input constraints as GPT image models. For `dall-e-2`, you can only provide one image, and it should be a square `png` file less than 4MB. ' prompt: description: A text description of the desired image(s). The maximum length is 1000 characters for `dall-e-2`, and 32000 characters for the GPT image models. type: string example: A cute baby sea otter wearing a beret mask: description: An additional image whose fully transparent areas (e.g. where alpha is zero) indicate where `image` should be edited. If there are multiple images provided, the mask will be applied on the first image. Must be a valid PNG file, less than 4MB, and have the same dimensions as `image`. type: string format: binary background: type: string enum: - transparent - opaque - auto default: auto example: transparent nullable: true description: 'Set the background of the generated image(s). This parameter is only supported for the GPT image models. Must be one of `transparent`, `opaque`, or `auto` (default value). When `auto` is used, the model will automatically determine the best background for the image. `gpt-image-2.5-sunburst` and `gpt-image-2.5-flare`, including their `2026-09-08` snapshots, support `opaque` and `transparent` backgrounds. Transparent backgrounds are available for supported GPT Image models. For `gpt-image-2` and `gpt-image-2-2026-04-21`, this support is in preview. When using `transparent`, set the output format to `png` or `webp`. ' model: anyOf: - type: string - type: string enum: - gpt-image-1.5 - gpt-image-2 - gpt-image-2-2026-04-21 - gpt-image-2.5-sunburst - gpt-image-2.5-sunburst-2026-09-08 - gpt-image-2.5-flare - gpt-image-2.5-flare-2026-09-08 - dall-e-2 - gpt-image-1 - gpt-image-1-mini - chatgpt-image-latest x-stainless-const: true x-oaiTypeLabel: string default: gpt-image-1.5 example: gpt-image-1.5 nullable: true description: The model to use for image generation. One of `dall-e-2` or a GPT image model (`gpt-image-1`, `gpt-image-1-mini`, `gpt-image-1.5`, `gpt-image-2`, `gpt-image-2-2026-04-21`, `gpt-image-2.5-sunburst`, `gpt-image-2.5-sunburst-2026-09-08`, `gpt-image-2.5-flare`, `gpt-image-2.5-flare-2026-09-08`, or `chatgpt-image-latest`). Defaults to `gpt-image-1.5`. n: type: integer minimum: 1 maximum: 10 default: 1 example: 1 nullable: true description: The number of images to generate. Must be between 1 and 10. size: anyOf: - type: string - type: string enum: - 256x256 - 512x512 - 1024x1024 - 1536x1024 - 1024x1536 - auto default: 1024x1024 example: 1024x1024 nullable: true description: The size of the generated images. For `gpt-image-2`, `gpt-image-2-2026-04-21`, `gpt-image-2.5-sunburst`, `gpt-image-2.5-sunburst-2026-09-08`, `gpt-image-2.5-flare`, and `gpt-image-2.5-flare-2026-09-08`, arbitrary resolutions are supported as `WIDTHxHEIGHT` strings, for example `1536x864`. Width and height must both be divisible by 16 and the requested aspect ratio must be between 1:3 and 3:1. Resolutions above `2560x1440` are experimental, and the maximum supported resolution is `3840x2160`. The requested size must also satisfy the model's current pixel and edge limits. The standard sizes `1024x1024`, `1536x1024`, and `1024x1536` are supported by the GPT image models; `auto` is supported for models that allow automatic sizing. For `dall-e-2`, use one of `256x256`, `512x512`, or `1024x1024`. For `dall-e-3`, use one of `1024x1024`, `1792x1024`, or `1024x1792`. response_format: type: string enum: - url - b64_json example: url nullable: true description: The format in which the generated images are returned. Must be one of `url` or `b64_json`. URLs are only valid for 60 minutes after the image has been generated. This parameter is only supported for `dall-e-2` (default is `url` for `dall-e-2`), as GPT image models always return base64-encoded images. output_format: type: string enum: - png - jpeg - webp default: png example: png nullable: true description: 'The format in which the generated images are returned. This parameter is only supported for the GPT image models. Must be one of `png`, `jpeg`, or `webp`. The default value is `png`. ' output_compression: type: integer default: 100 example: 100 nullable: true description: 'The compression level (0-100%) for the generated images. This parameter is only supported for the GPT image models with the `webp` or `jpeg` output formats, and defaults to 100. ' user: type: string example: user-1234 description: 'A unique identifier representing your end-user, which can help OpenAI to monitor and detect abuse. [Learn more](https://developers.openai.com/api/docs/guides/safety-best-practices#implement-safety-identifiers). ' input_fidelity: anyOf: - $ref: '#/components/schemas/InputFidelity' - type: 'null' stream: type: boolean default: false example: false nullable: true description: 'Edit the image in streaming mode. Defaults to `false`. See the [Image generation guide](https://developers.openai.com/api/docs/guides/image-generation) for more information. ' partial_images: $ref: '#/components/schemas/PartialImages' quality: type: string enum: - standard - low - medium - high - xhigh - max - auto default: auto example: high nullable: true description: 'The quality of the image that will be generated for GPT image models. The GPT image models support `low`, `medium`, and `high`. `gpt-image-2.5-sunburst` and `gpt-image-2.5-flare`, including their `2026-09-08` snapshots, also support `xhigh` and `max`. Defaults to `auto`. ' required: - prompt - image MessagePhase: type: string description: 'Labels an `assistant` message as intermediate commentary (`commentary`) or the final answer (`final_answer`). For models like `gpt-5.3-codex` and beyond, when sending follow-up requests, preserve and resend phase on all assistant messages — dropping it can degrade performance. Not used for user messages. ' enum: - commentary - final_answer ApplyPatchCallOutputStatusParam: type: string enum: - completed - failed title: Apply patch call output status description: Outcome values reported for apply_patch tool call outputs. ResponseLogProb: type: object description: "A logprob is the logarithmic probability that the model assigns to producing \na particular token at a given position in the sequence. Less-negative (higher) \nlogprob values indicate greater model confidence in that token choice.\n" properties: token: description: A possible text token. type: string logprob: description: 'The log probability of this token. ' type: number top_logprobs: description: 'The log probabilities of up to 20 of the most likely tokens. ' type: array items: type: object properties: token: description: A possible text token. type: string logprob: description: The log probability of this token. type: number required: - token - logprob FunctionShellCallItemParam: properties: id: anyOf: - type: string description: The unique ID of the shell tool call. Populated when this item is returned via API. example: sh_123 - type: 'null' call_id: type: string maxLength: 64 minLength: 1 description: The unique ID of the shell tool call generated by the model. caller: anyOf: - $ref: '#/components/schemas/ToolCallCallerParam' description: The execution context that produced this tool call. - type: 'null' type: type: string enum: - shell_call description: The type of the item. Always `shell_call`. default: shell_call x-stainless-const: true action: $ref: '#/components/schemas/FunctionShellActionParam' description: The shell commands and limits that describe how to run the tool call. status: anyOf: - $ref: '#/components/schemas/FunctionShellCallItemStatus' description: The status of the shell call. One of `in_progress`, `completed`, or `incomplete`. - type: 'null' environment: anyOf: - oneOf: - $ref: '#/components/schemas/LocalEnvironmentParam' - $ref: '#/components/schemas/ContainerReferenceParam' description: The environment to execute the shell commands in. discriminator: propertyName: type - type: 'null' type: object required: - call_id - type - action title: Shell tool call description: A tool representing a request to execute one or more shell commands. TranscriptionLanguage: type: object description: A language detected in transcribed audio. properties: code: type: string description: The code of a language detected in the audio. required: - code ResponseConfigurationUpdateItemParam: type: object description: 'An update to the conversation''s response configuration. The configuration remains in effect for subsequent responses until it is replaced by another configuration update. ' properties: id: anyOf: - type: string description: The unique ID of the configuration update item. example: cnfu_123 - type: 'null' type: type: string enum: - configuration_update description: The item type. Always `configuration_update`. default: configuration_update x-stainless-const: true reasoning: type: object description: Updates to reasoning configuration. Only effort is supported. properties: effort: $ref: '#/components/schemas/ReasoningEffort' description: 'The reasoning effort to use for subsequent responses until another configuration update replaces it. ' required: - type DirectToolCallCallerParam: properties: type: type: string enum: - direct description: The caller type. Always `direct`. default: direct x-stainless-const: true type: object required: - type ChatCompletionTool: type: object title: Function tool description: 'A function tool that can be used to generate a response. ' properties: type: type: string enum: - function description: The type of the tool. Currently, only `function` is supported. x-stainless-const: true function: $ref: '#/components/schemas/FunctionObject' required: - type - function ContainerNetworkPolicyDisabledParam: properties: type: type: string enum: - disabled description: Disable outbound network access. Always `disabled`. default: disabled x-stainless-const: true type: object required: - type TextResponseFormatJsonSchema: type: object title: JSON schema description: 'JSON Schema response format. Used to generate structured JSON responses. Learn more about [Structured Outputs](https://developers.openai.com/api/docs/guides/structured-outputs). ' properties: type: type: string description: The type of response format being defined. Always `json_schema`. enum: - json_schema x-stainless-const: true description: type: string description: 'A description of what the response format is for, used by the model to determine how 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 dashes, with a maximum length of 64. ' schema: $ref: '#/components/schemas/ResponseFormatJsonSchemaSchema' strict: anyOf: - type: boolean default: false description: 'Whether to enable strict schema adherence when generating the output. If set to true, the model will always follow the exact schema defined in the `schema` field. Only a subset of JSON Schema is supported when `strict` is `true`. To learn more, read the [Structured Outputs guide](https://developers.openai.com/api/docs/guides/structured-outputs). ' - type: 'null' required: - type - schema - name ResponseModalities: anyOf: - type: array description: 'Output types that you would like the model to generate. Most models are capable of generating text, which is the default: `["text"]` The `gpt-4o-audio-preview` model can also be used to [generate audio](https://developers.openai.com/api/docs/guides/audio). To request that this model generate both text and audio responses, you can use: `["text", "audio"]` ' items: type: string enum: - text - audio - type: 'null' ResponseMCPCallFailedEvent: type: object title: ResponseMCPCallFailedEvent description: 'Emitted when an MCP tool call has failed. ' properties: type: type: string enum: - response.mcp_call.failed description: The type of the event. Always 'response.mcp_call.failed'. x-stainless-const: true item_id: type: string description: The ID of the MCP tool call item that failed. output_index: type: integer description: The index of the output item that failed. sequence_number: type: integer description: The sequence number of this event. required: - type - item_id - output_index - sequence_number x-oaiMeta: name: response.mcp_call.failed group: responses example: "{\n \"type\": \"response.mcp_call.failed\",\n \"sequence_number\": 1,\n \"item_id\": \"mcp_682d437d90a88191bf88cd03aae0c3e503937d5f622d7a90\",\n \"output_index\": 0\n}\n" InlineSkillSourceParam: properties: type: type: string enum: - base64 description: The type of the inline skill source. Must be `base64`. default: base64 x-stainless-const: true media_type: type: string enum: - application/zip description: The media type of the inline skill payload. Must be `application/zip`. default: application/zip x-stainless-const: true data: type: string maxLength: 70254592 minLength: 1 description: Base64-encoded skill zip bundle. type: object required: - type - media_type - data description: Inline skill payload SearchContentType: type: string enum: - text - image CompactionBody: properties: type: type: string enum: - compaction description: The type of the item. Always `compaction`. default: compaction x-stainless-const: true 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. type: object required: - type - id - encrypted_content title: Compaction item description: A compaction item generated by the [`v1/responses/compact` API](https://developers.openai.com/api/reference/resources/responses/methods/compact). CreateEmbeddingRequest: type: object additionalProperties: false properties: input: description: 'Input text to embed, encoded as a string or array of tokens. To embed multiple inputs in a single request, pass an array of strings or array of token arrays. The input must not exceed the max input tokens for the model (8192 tokens for all embedding models), cannot be an empty string, and any array must be 2048 dimensions or less. [Example Python code](https://cookbook.openai.com/examples/how_to_count_tokens_with_tiktoken) for counting tokens. In addition to the per-input token limit, all embedding models enforce a maximum of 300,000 tokens summed across all inputs in a single request. ' example: The quick brown fox jumped over the lazy dog oneOf: - type: string title: string description: The string that will be turned into an embedding. default: '' example: This is a test. - type: array title: array description: The array of strings that will be turned into an embedding. minItems: 1 maxItems: 2048 items: type: string default: '' example: '[''This is a test.'']' - type: array title: array description: The array of integers that will be turned into an embedding. minItems: 1 maxItems: 2048 items: type: integer example: '[1212, 318, 257, 1332, 13]' - type: array title: array description: The array of arrays containing integers that will be turned into an embedding. minItems: 1 maxItems: 2048 items: type: array minItems: 1 items: type: integer example: '[[1212, 318, 257, 1332, 13]]' model: description: 'ID of the model to use. You can use the [List models](https://developers.openai.com/api/reference/resources/models/methods/list) API to see all of your available models, or see our [Model overview](https://developers.openai.com/api/docs/models) for descriptions of them. ' example: text-embedding-3-small anyOf: - type: string - type: string enum: - text-embedding-ada-002 - text-embedding-3-small - text-embedding-3-large x-oaiTypeLabel: string encoding_format: description: The format to return the embeddings in. Can be either `float` or [`base64`](https://pypi.org/project/pybase64/). example: float default: float type: string enum: - float - base64 dimensions: description: 'The number of dimensions the resulting output embeddings should have. Only supported in `text-embedding-3` and later models. ' type: integer minimum: 1 user: type: string example: user-1234 description: 'A unique identifier representing your end-user, which can help OpenAI to monitor and detect abuse. [Learn more](https://developers.openai.com/api/docs/guides/safety-best-practices#implement-safety-identifiers). ' required: - model - input BatchRequestCounts: type: object properties: total: type: integer description: Total number of requests in the batch. completed: type: integer description: Number of requests that have been completed successfully. failed: type: integer description: Number of requests that have failed. required: - total - completed - failed description: The request counts for different statuses within the batch. ModerationParam: properties: model: type: string description: The moderation model to use for moderated completions, e.g. 'omni-moderation-latest'. policy: anyOf: - $ref: '#/components/schemas/ModerationPolicyParam' description: The policy to apply to moderated response input and output. - type: 'null' type: object required: - model description: Configuration for running moderation on the input and output of this response. ResponseTextDeltaEvent: type: object description: Emitted when there is an additional text delta. properties: type: type: string description: 'The type of the event. Always `response.output_text.delta`. ' enum: - response.output_text.delta x-stainless-const: true item_id: type: string description: 'The ID of the output item that the text delta was added to. ' output_index: type: integer description: 'The index of the output item that the text delta was added to. ' content_index: type: integer description: 'The index of the content part that the text delta was added to. ' delta: type: string description: 'The text delta that was added. ' sequence_number: type: integer description: The sequence number for this event. logprobs: type: array description: 'The log probabilities of the tokens in the delta. ' items: $ref: '#/components/schemas/ResponseLogProb' required: - type - item_id - output_index - content_index - delta - sequence_number - logprobs x-oaiMeta: name: response.output_text.delta group: responses example: "{\n \"type\": \"response.output_text.delta\",\n \"item_id\": \"msg_123\",\n \"output_index\": 0,\n \"content_index\": 0,\n \"delta\": \"In\",\n \"sequence_number\": 1\n}\n" ToolsArray: type: array description: "An array of tools the model may call while generating a response. You\ncan specify which tool to use by setting the `tool_choice` parameter.\n\nWe support the following categories of tools:\n- **Built-in tools**: Tools that are provided by OpenAI that extend the\n model's capabilities, like [web search](https://developers.openai.com/api/docs/guides/tools-web-search)\n \ or [file search](https://developers.openai.com/api/docs/guides/tools-file-search). Learn more about\n [built-in tools](https://developers.openai.com/api/docs/guides/tools).\n- **MCP Tools**: Integrations with third-party systems via custom MCP servers\n or predefined connectors such as Google Drive and SharePoint. Learn more about\n [MCP Tools](https://developers.openai.com/api/docs/guides/tools-connectors-mcp).\n- **Function calls (custom tools)**: Functions that are defined by you,\n enabling the model to call your own code with strongly typed arguments\n and outputs. Learn more about\n [function calling](https://developers.openai.com/api/docs/guides/function-calling). You can also use\n custom tools to call your own code.\n" items: $ref: '#/components/schemas/Tool' ToolCallCallerParam: oneOf: - $ref: '#/components/schemas/DirectToolCallCallerParam' - $ref: '#/components/schemas/ProgramToolCallCallerParam' description: The execution context that produced this tool call. discriminator: propertyName: type ChatCompletionRequestToolMessage: type: object title: Tool message properties: role: type: string enum: - tool description: The role of the messages author, in this case `tool`. x-stainless-const: true content: oneOf: - type: string description: The contents of the tool message. title: Text content - type: array description: An array of content parts with a defined type. For tool messages, only type `text` is supported. title: Array of content parts items: $ref: '#/components/schemas/ChatCompletionRequestToolMessageContentPart' minItems: 1 description: The contents of the tool message. tool_call_id: type: string description: Tool call that this message is responding to. required: - role - content - tool_call_id CreateSpeechRequest: type: object additionalProperties: false properties: model: description: 'One of the available [TTS models](https://developers.openai.com/api/docs/guides/text-to-speech): `tts-1`, `tts-1-hd`, `gpt-4o-mini-tts`, or `gpt-4o-mini-tts-2025-12-15`. ' anyOf: - type: string - type: string enum: - tts-1 - tts-1-hd - gpt-4o-mini-tts - gpt-4o-mini-tts-2025-12-15 x-oaiTypeLabel: string input: type: string description: The text to generate audio for. The maximum length is 4096 characters. maxLength: 4096 instructions: type: string description: Control the voice of your generated audio with additional instructions. Does not work with `tts-1` or `tts-1-hd`. maxLength: 4096 voice: description: 'The voice to use when generating the audio. Supported built-in voices are `alloy`, `ash`, `ballad`, `coral`, `echo`, `fable`, `onyx`, `nova`, `sage`, `shimmer`, `verse`, `marin`, and `cedar`. You may also provide a custom voice object with an `id`, for example `{ "id": "voice_1234" }`. Previews of the voices are available in the [Text to speech guide](https://developers.openai.com/api/docs/guides/text-to-speech#voice-options).' $ref: '#/components/schemas/VoiceIdsOrCustomVoice' response_format: description: The format to audio in. Supported formats are `mp3`, `opus`, `aac`, `flac`, `wav`, and `pcm`. default: mp3 type: string enum: - mp3 - opus - aac - flac - wav - pcm speed: description: The speed of the generated audio. Select a value from `0.25` to `4.0`. `1.0` is the default. type: number default: 1 minimum: 0.25 maximum: 4 stream_format: description: The format to stream the audio in. Supported formats are `sse` and `audio`. `sse` is not supported for `tts-1` or `tts-1-hd`. type: string default: audio enum: - sse - audio required: - model - input - voice WebSearchTool: type: object title: Web search description: 'Search the Internet for sources related to the prompt. Learn more about the [web search tool](https://developers.openai.com/api/docs/guides/tools-web-search). ' properties: type: type: string enum: - web_search - web_search_2025_08_26 description: The type of the web search tool. One of `web_search` or `web_search_2025_08_26`. default: web_search external_web_access: type: boolean default: true description: Allow live internet access for web search. Defaults to true when omitted. When false, the web search tool runs in offline/cache-only mode and will not fetch new external content. filters: anyOf: - type: object description: 'Filters for the search. ' properties: allowed_domains: anyOf: - type: array title: Allowed domains for the search. description: 'Allowed domains for the search. If not provided, all domains are allowed. Subdomains of the provided domains are allowed as well. Example: `["pubmed.ncbi.nlm.nih.gov"]` ' items: type: string description: Allowed domain for the search. default: [] - type: 'null' - type: 'null' user_location: $ref: '#/components/schemas/WebSearchApproximateLocation' search_context_size: type: string enum: - low - medium - high default: medium description: High level guidance for the amount of context window space to use for the search. One of `low`, `medium`, or `high`. `medium` is the default. required: - type ToolChoiceParam: description: 'How the model should select which tool (or tools) to use when generating a response. See the `tools` parameter to see how to specify which tools the model can call. ' oneOf: - $ref: '#/components/schemas/ToolChoiceOptions' - $ref: '#/components/schemas/ToolChoiceAllowed' - $ref: '#/components/schemas/ToolChoiceTypes' - $ref: '#/components/schemas/ToolChoiceFunction' - $ref: '#/components/schemas/ToolChoiceMCP' - $ref: '#/components/schemas/ToolChoiceCustom' - $ref: '#/components/schemas/SpecificProgrammaticToolCallingParam' - $ref: '#/components/schemas/SpecificApplyPatchParam' - $ref: '#/components/schemas/SpecificFunctionShellParam' ComputerTool: properties: type: type: string enum: - computer description: The type of the computer tool. Always `computer`. default: computer x-stainless-const: true type: object required: - type title: Computer description: A tool that controls a virtual computer. Learn more about the [computer tool](https://developers.openai.com/api/docs/guides/tools-computer-use). ResponseCreatedEvent: type: object description: 'An event that is emitted when a response is created. ' properties: type: type: string description: 'The type of the event. Always `response.created`. ' enum: - response.created x-stainless-const: true response: $ref: '#/components/schemas/Response' description: 'The response that was created. ' sequence_number: type: integer description: The sequence number for this event. required: - type - response - sequence_number x-oaiMeta: name: response.created group: responses example: "{\n \"type\": \"response.created\",\n \"response\": {\n \"id\": \"resp_67ccfcdd16748190a91872c75d38539e09e4d4aac714747c\",\n \ \"object\": \"response\",\n \"created_at\": 1741487325,\n \"status\": \"in_progress\",\n \ \"completed_at\": null,\n \"error\": null,\n \"incomplete_details\": null,\n \"instructions\": null,\n \"max_output_tokens\": null,\n \"model\": \"gpt-6-astra\",\n \"output\": [],\n \ \"parallel_tool_calls\": true,\n \"previous_response_id\": null,\n \"reasoning\": {\n \"effort\": null,\n \"summary\": null\n },\n \"store\": true,\n \"temperature\": 1,\n \"text\": {\n \"format\": {\n \"type\": \"text\"\n }\n },\n \"tool_choice\": \"auto\",\n \"tools\": [],\n \"top_p\": 1,\n \"truncation\": \"disabled\",\n \"usage\": null,\n \"user\": null,\n \"metadata\": {}\n },\n \"sequence_number\": 1\n}\n" ContainerNetworkPolicyDomainSecretParam: properties: domain: type: string minLength: 1 description: The domain associated with the secret. name: type: string minLength: 1 description: The name of the secret to inject for the domain. value: type: string maxLength: 10485760 minLength: 1 description: The secret value to inject for the domain. type: object required: - domain - name - value ResponseMCPCallInProgressEvent: type: object title: ResponseMCPCallInProgressEvent description: 'Emitted when an MCP tool call is in progress. ' properties: type: type: string enum: - response.mcp_call.in_progress description: The type of the event. Always 'response.mcp_call.in_progress'. x-stainless-const: true sequence_number: type: integer description: The sequence number of this event. output_index: type: integer description: The index of the output item in the response's output array. item_id: type: string description: The unique identifier of the MCP tool call item being processed. required: - type - output_index - item_id - sequence_number x-oaiMeta: name: response.mcp_call.in_progress group: responses example: "{\n \"type\": \"response.mcp_call.in_progress\",\n \"sequence_number\": 1,\n \"output_index\": 0,\n \"item_id\": \"mcp_682d437d90a88191bf88cd03aae0c3e503937d5f622d7a90\"\n}\n" FunctionShellCallOutputStatusEnum: type: string enum: - in_progress - completed - incomplete Metadata: anyOf: - type: object description: 'Set of 16 key-value pairs that can be attached to an object. This can be useful for storing additional information about the object in a structured format, and querying for objects via API or the dashboard. Keys are strings with a maximum length of 64 characters. Values are strings with a maximum length of 512 characters. ' additionalProperties: type: string x-oaiTypeLabel: map - type: 'null' ToolSearchExecutionType: type: string enum: - server - client ServiceTierResponses: anyOf: - type: string description: "Specifies the processing type used for serving the request.\n - If set to 'auto', then the request will be processed with the service tier configured in the Project settings. Unless otherwise configured, the Project will use 'default'.\n - If set to 'default', then the request will be processed with the standard pricing and performance for the selected model.\n \ - If set to '[flex](https://developers.openai.com/api/docs/guides/flex-processing)', then the request will be processed with the Flex Processing service tier.\n - To opt-in to [Fast mode](https://developers.openai.com/api/docs/guides/fast-mode) at the request level, include the `service_tier=fast` or `service_tier=priority` parameter for Responses or Chat Completions. The response will show `service_tier=priority` regardless of if you specify `service_tier=fast` or `priority` in your request.\n - If set to 'ultrafast', then the request will be processed with the access-controlled Ultrafast Processing service tier. This tier is currently available for `gpt-5.6-sol`; a response served through it will show `service_tier=ultrafast`.\n - When not set, the default behavior is 'auto'.\n\n When the `service_tier` parameter is set, the response body will include the `service_tier` value based on the processing mode actually used to serve the request. This response value may be different from the value set in the parameter.\n" enum: - auto - default - flex - scale - priority - fast - ultrafast default: auto - type: 'null' ChatCompletionResponseMessage: type: object description: A chat completion message generated by the model. properties: content: anyOf: - type: string description: The contents of the message. - type: 'null' refusal: anyOf: - type: string description: The refusal message generated by the model. - type: 'null' tool_calls: $ref: '#/components/schemas/ChatCompletionMessageToolCalls' annotations: type: array description: 'Annotations for the message, when applicable, as when using the [web search tool](https://developers.openai.com/api/docs/guides/tools-web-search). ' items: type: object description: 'A URL citation when using web search. ' required: - type - url_citation properties: type: type: string description: The type of the URL citation. Always `url_citation`. enum: - url_citation x-stainless-const: true url_citation: type: object description: A URL citation when using web search. required: - end_index - start_index - url - title properties: end_index: type: integer description: The index of the last character of the URL citation in the message. start_index: type: integer description: The index of the first character of the URL citation in the message. url: type: string format: uri description: The URL of the web resource. title: type: string description: The title of the web resource. role: type: string enum: - assistant description: The role of the author of this message. x-stainless-const: true function_call: type: object deprecated: true description: Deprecated and replaced by `tool_calls`. The name and arguments of a function that should be called, as generated by the model. properties: arguments: type: string description: The arguments to call the function with, as generated by the model in JSON format. Note that the model does not always generate valid JSON, and may hallucinate parameters not defined by your function schema. Validate the arguments in your code before calling your function. name: type: string description: The name of the function to call. required: - name - arguments audio: anyOf: - type: object description: 'If the audio output modality is requested, this object contains data about the audio response from the model. [Learn more](https://developers.openai.com/api/docs/guides/audio). ' required: - id - expires_at - data - transcript properties: id: type: string description: Unique identifier for this audio response. expires_at: type: integer format: unixtime description: 'The Unix timestamp (in seconds) for when this audio response will no longer be accessible on the server for use in multi-turn conversations. ' data: type: string description: 'Base64 encoded audio bytes generated by the model, in the format specified in the request. ' transcript: type: string description: Transcript of the audio generated by the model. - type: 'null' required: - role - content - refusal FunctionCallOutputItemParam: properties: id: anyOf: - type: string description: The unique ID of the function tool call output. Populated when this item is returned via API. example: fc_123 - type: 'null' call_id: anyOf: - type: string maxLength: 64 minLength: 1 description: The unique ID of the function tool call generated by the model. - type: 'null' type: type: string enum: - function_call_output description: The type of the function tool call output. Always `function_call_output`. default: function_call_output x-stainless-const: true output: oneOf: - type: string maxLength: 10485760 description: A JSON string of the output of the function tool call. - 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: array description: An array of content outputs (text, image, file) for the function tool call. description: Text, image, or file output of the function tool call. name: anyOf: - type: string maxLength: 128 minLength: 1 description: The name of the tool that produced the output. - type: 'null' namespace: anyOf: - type: string maxLength: 64 minLength: 1 pattern: ^[a-zA-Z0-9_-]+$ description: The namespace of the tool that produced the output. - type: 'null' caller: anyOf: - $ref: '#/components/schemas/ToolCallCallerParam' description: The execution context that produced this tool call. - type: 'null' status: anyOf: - $ref: '#/components/schemas/FunctionCallItemStatus' description: The status of the item. One of `in_progress`, `completed`, or `incomplete`. Populated when items are returned via API. - type: 'null' type: object required: - type - output title: Function tool call output description: The output of a function tool call. DeleteFileResponse: type: object properties: id: type: string object: type: string enum: - file x-stainless-const: true deleted: type: boolean required: - id - object - deleted ShellCallOutputDelta: properties: stdout: type: string description: The stdout delta that was emitted. stderr: type: string description: The stderr delta that was emitted. type: object required: [] title: Shell call output delta description: A delta of stdout/stderr emitted while a shell call was running. CustomToolParam: properties: type: type: string enum: - custom description: The type of the custom tool. Always `custom`. default: custom x-stainless-const: true name: type: string description: The name of the custom tool, used to identify it in tool calls. async: type: boolean description: Whether the tool response can be returned asynchronously versus immediately returned on next response creation. description: type: string description: Optional description of the custom tool, used to provide more context. format: oneOf: - $ref: '#/components/schemas/CustomTextFormatParam' - $ref: '#/components/schemas/CustomGrammarFormatParam' description: The input format for the custom tool. Default is unconstrained text. discriminator: propertyName: type defer_loading: type: boolean description: Whether this tool should be deferred and discovered via tool search. allowed_callers: anyOf: - items: $ref: '#/components/schemas/CallableToolAllowedCaller' type: array minItems: 1 description: The tool invocation context(s). - type: 'null' type: object required: - type - name title: Custom tool description: A custom tool that processes input using a specified format. Learn more about [custom tools](https://developers.openai.com/api/docs/guides/function-calling#custom-tools) ResponseRefusalDeltaEvent: type: object description: Emitted when there is a partial refusal text. properties: type: type: string description: 'The type of the event. Always `response.refusal.delta`. ' enum: - response.refusal.delta x-stainless-const: true item_id: type: string description: 'The ID of the output item that the refusal text is added to. ' output_index: type: integer description: 'The index of the output item that the refusal text is added to. ' content_index: type: integer description: 'The index of the content part that the refusal text is added to. ' delta: type: string description: 'The refusal text that is added. ' sequence_number: type: integer description: 'The sequence number of this event. ' required: - type - item_id - output_index - content_index - delta - sequence_number x-oaiMeta: name: response.refusal.delta group: responses example: "{\n \"type\": \"response.refusal.delta\",\n \"item_id\": \"msg_123\",\n \"output_index\": 0,\n \"content_index\": 0,\n \"delta\": \"refusal text so far\",\n \"sequence_number\": 1\n}\n" TranscriptTextDoneEvent: type: object description: Emitted when the transcription is complete. Contains the complete transcription text. Only emitted when you [create a transcription](https://developers.openai.com/api/reference/resources/audio/subresources/transcriptions/methods/create) with the `Stream` parameter set to `true`. properties: type: type: string description: 'The type of the event. Always `transcript.text.done`. ' enum: - transcript.text.done x-stainless-const: true text: type: string description: 'The text that was transcribed. ' languages: type: array description: 'The languages detected in the audio. Returned by `gpt-transcribe`. An empty array indicates that no language could be reliably detected. ' items: $ref: '#/components/schemas/TranscriptionLanguage' logprobs: type: array description: 'The log probabilities of the individual tokens in the transcription. Only included if you [create a transcription](https://developers.openai.com/api/reference/resources/audio/subresources/transcriptions/methods/create) with the `include[]` parameter set to `logprobs`. ' items: type: object properties: token: type: string description: 'The token that was used to generate the log probability. ' logprob: type: number description: 'The log probability of the token. ' bytes: type: array items: type: integer description: 'The bytes that were used to generate the log probability. ' usage: $ref: '#/components/schemas/TranscriptTextUsageTokens' required: - type - text x-oaiMeta: name: Stream Event (transcript.text.done) group: transcript example: "{\n \"type\": \"transcript.text.done\",\n \"text\": \"I see skies of blue and clouds of white, the bright blessed days, the dark sacred nights, and I think to myself, what a wonderful world.\",\n \"usage\": {\n \"type\": \"tokens\",\n \"input_tokens\": 14,\n \"input_token_details\": {\n \"text_tokens\": 10,\n \"audio_tokens\": 4\n },\n \"output_tokens\": 31,\n \ \"total_tokens\": 45\n }\n}\n" ChatCompletionRequestUserMessageContentPart: oneOf: - $ref: '#/components/schemas/ChatCompletionRequestMessageContentPartText' - $ref: '#/components/schemas/ChatCompletionRequestMessageContentPartImage' - $ref: '#/components/schemas/ChatCompletionRequestMessageContentPartAudio' - $ref: '#/components/schemas/ChatCompletionRequestMessageContentPartFile' ErrorResponse: type: object properties: error: $ref: '#/components/schemas/Error' required: - error TranscriptionDiarizedSegment: type: object description: A segment of diarized transcript text with speaker metadata. properties: type: type: string description: 'The type of the segment. Always `transcript.text.segment`. ' enum: - transcript.text.segment x-stainless-const: true id: type: string description: Unique identifier for the segment. start: type: number format: double description: Start timestamp of the segment in seconds. end: type: number format: double description: End timestamp of the segment in seconds. text: type: string description: Transcript text for this segment. speaker: type: string description: 'Speaker label for this segment. When known speakers are provided, the label matches `known_speaker_names[]`. Otherwise speakers are labeled sequentially using capital letters (`A`, `B`, ...). ' required: - type - id - start - end - text - speaker AdditionalTools: properties: type: type: string enum: - additional_tools description: The type of the item. Always `additional_tools`. default: additional_tools x-stainless-const: true id: type: string description: The unique ID of the additional tools item. role: $ref: '#/components/schemas/MessageRole' description: The role that provided the additional tools. tools: items: $ref: '#/components/schemas/Tool' type: array description: The additional tool definitions made available at this item. type: object required: - type - id - role - tools MessageRole: type: string enum: - unknown - user - assistant - system - critic - discriminator - developer - tool FunctionShellToolParam: properties: type: type: string enum: - shell description: The type of the shell tool. Always `shell`. default: shell x-stainless-const: true environment: anyOf: - oneOf: - $ref: '#/components/schemas/ContainerAutoParam' - $ref: '#/components/schemas/LocalEnvironmentParam' - $ref: '#/components/schemas/ContainerReferenceParam' discriminator: propertyName: type - type: 'null' allowed_callers: anyOf: - items: $ref: '#/components/schemas/CallableToolAllowedCaller' type: array minItems: 1 description: The tool invocation context(s). - type: 'null' type: object required: - type title: Shell tool description: A tool that allows the model to execute shell commands. CreateTranslationResponseVerboseJson: type: object properties: language: type: string description: The language of the output translation (always `english`). duration: type: number format: double description: The duration of the input audio. text: type: string description: The translated text. segments: type: array description: Segments of the translated text and their corresponding details. items: $ref: '#/components/schemas/TranscriptionSegment' required: - language - duration - text OutputTextContent: properties: type: type: string enum: - output_text description: The type of the output text. Always `output_text`. default: output_text x-stainless-const: true text: type: string description: The text output from the model. annotations: items: $ref: '#/components/schemas/Annotation' type: array description: The annotations of the text output. logprobs: items: $ref: '#/components/schemas/LogProb' type: array type: object required: - type - text - annotations - logprobs title: Output text description: A text output from the model. CreateTranscriptionResponseVerboseJson: type: object description: Represents a verbose json transcription response returned by model, based on the provided input. properties: language: type: string description: The language of the input audio. duration: type: number format: double description: The duration of the input audio. text: type: string description: The transcribed text. words: type: array description: Extracted words and their corresponding timestamps. items: $ref: '#/components/schemas/TranscriptionWord' segments: type: array description: Segments of the transcribed text and their corresponding details. items: $ref: '#/components/schemas/TranscriptionSegment' usage: $ref: '#/components/schemas/TranscriptTextUsageDuration' required: - language - duration - text x-oaiMeta: name: The transcription object (Verbose JSON) group: audio example: "{\n \"task\": \"transcribe\",\n \"language\": \"english\",\n \"duration\": 8.470000267028809,\n \ \"text\": \"The beach was a popular spot on a hot summer day. People were swimming in the ocean, building sandcastles, and playing beach volleyball.\",\n \"segments\": [\n {\n \"id\": 0,\n \"seek\": 0,\n \"start\": 0.0,\n \"end\": 3.319999933242798,\n \"text\": \" The beach was a popular spot on a hot summer day.\",\n \"tokens\": [\n 50364, 440, 7534, 390, 257, 3743, 4008, 322, 257, 2368, 4266, 786, 13, 50530\n ],\n \"temperature\": 0.0,\n \"avg_logprob\": -0.2860786020755768,\n \"compression_ratio\": 1.2363636493682861,\n \ \"no_speech_prob\": 0.00985979475080967\n },\n ...\n ],\n \"usage\": {\n \"type\": \"duration\",\n \"seconds\": 9\n }\n}\n" FileDetailEnum: type: string enum: - auto - low - high FunctionCallOutputStatusEnum: type: string enum: - in_progress - completed - incomplete ApplyPatchUpdateFileOperationParam: properties: type: type: string enum: - update_file description: The operation type. Always `update_file`. default: update_file x-stainless-const: true path: type: string minLength: 1 description: Path of the file to update relative to the workspace root. diff: type: string maxLength: 10485760 description: Unified diff content to apply to the existing file. type: object required: - type - path - diff title: Apply patch update file operation description: Instruction for updating an existing file via the apply_patch tool. PromptCacheComparisonResponseNotFoundDiagnosticsBody: properties: type: type: string enum: - comparison_response_not_found default: comparison_response_not_found x-stainless-const: true type: object required: - type ResponseAudioTranscriptDeltaEvent: type: object description: Emitted when there is a partial transcript of audio. properties: type: type: string description: 'The type of the event. Always `response.audio.transcript.delta`. ' enum: - response.audio.transcript.delta x-stainless-const: true delta: type: string description: 'The partial transcript of the audio response. ' sequence_number: type: integer description: The sequence number of this event. required: - type - response_id - delta - sequence_number x-oaiMeta: name: response.audio.transcript.delta group: responses example: "{\n \"type\": \"response.audio.transcript.delta\",\n \"response_id\": \"resp_123\",\n \ \"delta\": \" ... partial transcript ... \",\n \"sequence_number\": 1\n}\n" CodeInterpreterToolCall: type: object title: Code interpreter tool call description: 'A tool call to run code. ' properties: type: type: string enum: - code_interpreter_call default: code_interpreter_call x-stainless-const: true description: 'The type of the code interpreter tool call. Always `code_interpreter_call`. ' id: type: string description: 'The unique ID of the code interpreter tool call. ' status: type: string enum: - in_progress - completed - incomplete - interpreting - failed description: 'The status of the code interpreter tool call. Valid values are `in_progress`, `completed`, `incomplete`, `interpreting`, and `failed`. ' container_id: type: string description: 'The ID of the container used to run the code. ' code: anyOf: - type: string description: 'The code to run, or null if not available. ' - type: 'null' outputs: anyOf: - type: array items: oneOf: - $ref: '#/components/schemas/CodeInterpreterOutputLogs' - $ref: '#/components/schemas/CodeInterpreterOutputImage' discriminator: propertyName: type discriminator: propertyName: type description: 'The outputs generated by the code interpreter, such as logs or images. Can be null if no outputs are available. ' - type: 'null' required: - type - id - status - container_id - code - outputs MCPApprovalRequest: type: object title: MCP approval request description: 'A request for human approval of a tool invocation. ' properties: type: type: string enum: - mcp_approval_request description: 'The type of the item. Always `mcp_approval_request`. ' x-stainless-const: true id: type: string description: 'The unique ID of the approval request. ' server_label: type: string description: 'The label of the MCP server making the request. ' name: type: string description: 'The name of the tool to run. ' arguments: type: string description: 'A JSON string of arguments for the tool. ' required: - type - id - server_label - name - arguments TextResponseFormatConfiguration: description: 'An object specifying the format that the model must output. Configuring `{ "type": "json_schema" }` enables Structured Outputs, which ensures the model will match your supplied JSON schema. Learn more in the [Structured Outputs guide](https://developers.openai.com/api/docs/guides/structured-outputs). The default format is `{ "type": "text" }` with no additional options. **Not recommended for gpt-4o and newer models:** Setting to `{ "type": "json_object" }` enables the older JSON mode, which ensures the message the model generates is valid JSON. Using `json_schema` is preferred for models that support it. ' oneOf: - $ref: '#/components/schemas/ResponseFormatText' - $ref: '#/components/schemas/TextResponseFormatJsonSchema' - $ref: '#/components/schemas/ResponseFormatJsonObject' ChatCompletionRequestUserMessage: type: object title: User message description: 'Messages sent by an end user, containing prompts or additional context information. ' properties: content: description: 'The contents of the user message. ' oneOf: - type: string description: The text contents of the message. title: Text content - type: array description: An array of content parts with a defined type. Supported options differ based on the [model](https://developers.openai.com/api/docs/models) being used to generate the response. Can contain text, image, or audio inputs. title: Array of content parts items: $ref: '#/components/schemas/ChatCompletionRequestUserMessageContentPart' minItems: 1 role: type: string enum: - user description: The role of the messages author, in this case `user`. x-stainless-const: true name: type: string description: An optional name for the participant. Provides the model information to differentiate between participants of the same role. required: - content - role ApplyPatchToolCall: properties: type: type: string enum: - apply_patch_call description: The type of the item. Always `apply_patch_call`. default: apply_patch_call x-stainless-const: true id: type: string description: The unique ID of the apply patch tool call. Populated when this item is returned via API. call_id: type: string description: The unique ID of the apply patch tool call generated by the model. caller: anyOf: - $ref: '#/components/schemas/ToolCallCaller' description: The execution context that produced this tool call. - type: 'null' status: $ref: '#/components/schemas/ApplyPatchCallStatus' description: The status of the apply patch tool call. One of `in_progress` or `completed`. operation: oneOf: - $ref: '#/components/schemas/ApplyPatchCreateFileOperation' - $ref: '#/components/schemas/ApplyPatchDeleteFileOperation' - $ref: '#/components/schemas/ApplyPatchUpdateFileOperation' title: Apply patch operation description: One of the create_file, delete_file, or update_file operations applied via apply_patch. discriminator: propertyName: type created_by: type: string description: The ID of the entity that created this tool call. type: object required: - type - id - call_id - status - operation title: Apply patch tool call description: A tool call that applies file diffs by creating, deleting, or updating files. CodeInterpreterOutputImage: properties: type: type: string enum: - image description: The type of the output. Always `image`. default: image x-stainless-const: true url: type: string format: uri description: The URL of the image output from the code interpreter. type: object required: - type - url title: Code interpreter output image description: The image output from the code interpreter. FunctionShellCall: properties: type: type: string enum: - shell_call description: The type of the item. Always `shell_call`. default: shell_call x-stainless-const: true id: type: string description: The unique ID of the shell tool call. Populated when this item is returned via API. call_id: type: string description: The unique ID of the shell tool call generated by the model. caller: anyOf: - $ref: '#/components/schemas/ToolCallCaller' description: The execution context that produced this tool call. - type: 'null' action: $ref: '#/components/schemas/FunctionShellAction' description: The shell commands and limits that describe how to run the tool call. status: $ref: '#/components/schemas/FunctionShellCallStatus' description: The status of the shell call. One of `in_progress`, `completed`, or `incomplete`. environment: anyOf: - oneOf: - $ref: '#/components/schemas/LocalEnvironmentResource' - $ref: '#/components/schemas/ContainerReferenceResource' discriminator: propertyName: type - type: 'null' created_by: type: string description: The ID of the entity that created this tool call. type: object required: - type - id - call_id - action - status - environment title: Shell tool call description: A tool call that executes one or more shell commands in a managed environment. ResponseIncompleteEvent: type: object description: 'An event that is emitted when a response finishes as incomplete. Over WebSocket, steering can finish a response with `response.incomplete_details.reason` set to `steered`, followed automatically by a successor `response.created` that commits the queued steering input. ' properties: type: type: string description: 'The type of the event. Always `response.incomplete`. ' enum: - response.incomplete x-stainless-const: true response: $ref: '#/components/schemas/Response' description: 'The response that was incomplete. ' sequence_number: type: integer description: The sequence number of this event. required: - type - response - sequence_number x-oaiMeta: name: response.incomplete group: responses example: "{\n \"type\": \"response.incomplete\",\n \"response\": {\n \"id\": \"resp_123\",\n \ \"object\": \"response\",\n \"created_at\": 1740855869,\n \"status\": \"incomplete\",\n \ \"completed_at\": null,\n \"error\": null,\n \"incomplete_details\": {\n \"reason\": \"max_tokens\"\n },\n \"instructions\": null,\n \"max_output_tokens\": null,\n \"model\": \"gpt-6-astra\",\n \"output\": [],\n \"previous_response_id\": null,\n \"reasoning_effort\": null,\n \"store\": false,\n \"temperature\": 1,\n \"text\": {\n \"format\": {\n \ \"type\": \"text\"\n }\n },\n \"tool_choice\": \"auto\",\n \"tools\": [],\n \"top_p\": 1,\n \"truncation\": \"disabled\",\n \"usage\": null,\n \"user\": null,\n \"metadata\": {}\n },\n \"sequence_number\": 1\n}\n" ChatCompletionTokenLogprob: type: object properties: token: description: The token. type: string logprob: description: The log probability of this token, if it is within the top 20 most likely tokens. Otherwise, the value `-9999.0` is used to signify that the token is very unlikely. type: number bytes: anyOf: - description: A list of integers representing the UTF-8 bytes representation of the token. Useful in instances where characters are represented by multiple tokens and their byte representations must be combined to generate the correct text representation. Can be `null` if there is no bytes representation for the token. type: array items: type: integer - type: 'null' top_logprobs: description: List of the most likely tokens and their log probability, at this token position. The number of entries may be fewer than the requested `top_logprobs`. type: array items: type: object properties: token: description: The token. type: string logprob: description: The log probability of this token, if it is within the top 20 most likely tokens. Otherwise, the value `-9999.0` is used to signify that the token is very unlikely. type: number bytes: anyOf: - description: A list of integers representing the UTF-8 bytes representation of the token. Useful in instances where characters are represented by multiple tokens and their byte representations must be combined to generate the correct text representation. Can be `null` if there is no bytes representation for the token. type: array items: type: integer - type: 'null' required: - token - logprob - bytes required: - token - logprob - bytes - top_logprobs ResponseStreamOptions: anyOf: - description: 'Options for streaming responses. Only set this when you set `stream: true`. ' type: object default: null properties: include_obfuscation: type: boolean description: 'When true, stream obfuscation will be enabled. Stream obfuscation adds random characters to an `obfuscation` field on streaming delta events to normalize payload sizes as a mitigation to certain side-channel attacks. These obfuscation fields are included by default, but add a small amount of overhead to the data stream. You can set `include_obfuscation` to false to optimize for bandwidth if you trust the network links between your application and the OpenAI API. ' - type: 'null' ComputerCallOutputStatus: type: string enum: - completed - incomplete - failed CompactionTriggerItemParam: properties: id: anyOf: - type: string description: The unique ID of this compaction trigger. example: msg_123 - type: 'null' type: type: string enum: - compaction_trigger description: The type of the item. Always `compaction_trigger`. default: compaction_trigger x-stainless-const: true type: object required: - type title: Compaction trigger description: Compacts the current context. Must be the final input item. _MisalignmentSteer: properties: message: type: string description: The public continuation instruction. type: object required: - message VoiceIdsShared: example: ash anyOf: - type: string - type: string enum: - alloy - ash - ballad - coral - echo - sage - shimmer - verse - marin - cedar ApplyPatchDeleteFileOperationParam: properties: type: type: string enum: - delete_file description: The operation type. Always `delete_file`. default: delete_file x-stainless-const: true path: type: string minLength: 1 description: Path of the file to delete relative to the workspace root. type: object required: - type - path title: Apply patch delete file operation description: Instruction for deleting an existing file via the apply_patch tool. ParallelToolCalls: description: Whether to enable [parallel function calling](https://developers.openai.com/api/docs/guides/function-calling#parallel-function-calling) during tool use. type: boolean default: true FunctionParameters: type: object description: 'The parameters the functions accepts, described as a JSON Schema object. See the [guide](https://developers.openai.com/api/docs/guides/function-calling) for examples, and the [JSON Schema reference](https://json-schema.org/understanding-json-schema/) for documentation about the format. Omitting `parameters` defines a function with an empty parameter list.' additionalProperties: true ChatCompletionRequestMessageContentPartImage: type: object title: Image content part description: 'Learn about [image inputs](https://developers.openai.com/api/docs/guides/images-vision). ' properties: type: type: string enum: - image_url description: The type of the content part. x-stainless-const: true image_url: type: object properties: url: type: string description: Either a URL of the image or the base64 encoded image data. format: uri detail: type: string description: Specifies the detail level of the image. Learn more in the [Vision guide](https://developers.openai.com/api/docs/guides/images-vision#choose-an-image-detail-level). enum: - auto - low - high default: auto required: - url prompt_cache_breakpoint: $ref: '#/components/schemas/PromptCacheBreakpointParam' required: - type - image_url StopConfiguration: description: 'Not supported with latest reasoning models `o3` and `o4-mini`. Up to 4 sequences where the API will stop generating further tokens. The returned text will not contain the stop sequence. ' default: null nullable: true oneOf: - type: string default: <|endoftext|> example: ' ' nullable: true - type: array minItems: 1 maxItems: 4 items: type: string example: '["\n"]' ApplyPatchDeleteFileOperation: properties: type: type: string enum: - delete_file description: Delete the specified file. default: delete_file x-stainless-const: true path: type: string description: Path of the file to delete. type: object required: - type - path title: Apply patch delete file operation description: Instruction describing how to delete a file via the apply_patch tool. ImageGenStreamEvent: anyOf: - $ref: '#/components/schemas/ImageGenPartialImageEvent' - $ref: '#/components/schemas/ImageGenCompletedEvent' discriminator: propertyName: type ResponseCustomToolCallInputDoneEvent: title: ResponseCustomToolCallInputDone type: object description: 'Event indicating that input for a custom tool call is complete. ' properties: type: type: string enum: - response.custom_tool_call_input.done description: The event type identifier. x-stainless-const: true sequence_number: type: integer description: The sequence number of this event. output_index: type: integer description: The index of the output this event applies to. item_id: type: string description: Unique identifier for the API item associated with this event. input: type: string description: The complete input data for the custom tool call. required: - type - output_index - item_id - input - sequence_number x-oaiMeta: name: response.custom_tool_call_input.done group: responses example: "{\n \"type\": \"response.custom_tool_call_input.done\",\n \"output_index\": 0,\n \"item_id\": \"ctc_1234567890abcdef\",\n \"input\": \"final complete input text\"\n}\n" ResponseFormatText: type: object title: Text description: 'Default response format. Used to generate text responses. ' properties: type: type: string description: The type of response format being defined. Always `text`. enum: - text x-stainless-const: true required: - type WebSearchCallStatus: type: string enum: - in_progress - searching - completed - failed - incomplete ListFilesResponse: type: object properties: object: type: string example: list data: type: array items: $ref: '#/components/schemas/OpenAIFile' first_id: type: string example: file-abc123 last_id: type: string example: file-abc456 has_more: type: boolean example: false required: - object - data - first_id - last_id - has_more ChatCompletionRequestAssistantMessage: type: object title: Assistant message description: 'Messages sent by the model in response to user messages. ' properties: content: anyOf: - oneOf: - type: string description: The contents of the assistant message. title: Text content - type: array description: An array of content parts with a defined type. Can be one or more of type `text`, or exactly one of type `refusal`. title: Array of content parts items: $ref: '#/components/schemas/ChatCompletionRequestAssistantMessageContentPart' minItems: 1 description: 'The contents of the assistant message. Required unless `tool_calls` or `function_call` is specified. ' - type: 'null' refusal: anyOf: - type: string description: The refusal message by the assistant. - type: 'null' role: type: string enum: - assistant description: The role of the messages author, in this case `assistant`. x-stainless-const: true name: type: string description: An optional name for the participant. Provides the model information to differentiate between participants of the same role. audio: anyOf: - type: object description: 'Data about a previous audio response from the model. [Learn more](https://developers.openai.com/api/docs/guides/audio). ' required: - id properties: id: type: string description: 'Unique identifier for a previous audio response from the model. ' - type: 'null' tool_calls: $ref: '#/components/schemas/ChatCompletionMessageToolCalls' function_call: anyOf: - type: object deprecated: true description: Deprecated and replaced by `tool_calls`. The name and arguments of a function that should be called, as generated by the model. properties: arguments: type: string description: The arguments to call the function with, as generated by the model in JSON format. Note that the model does not always generate valid JSON, and may hallucinate parameters not defined by your function schema. Validate the arguments in your code before calling your function. name: type: string description: The name of the function to call. required: - arguments - name - type: 'null' required: - role ToolChoiceOptions: type: string title: Tool choice mode description: 'Controls which (if any) tool is called by the model. `none` means the model will not call any tool and instead generates a message. `auto` means the model can pick between generating a message or calling one or more tools. `required` means the model must call one or more tools. ' enum: - none - auto - required ReasoningTextContent: properties: type: type: string enum: - reasoning_text description: The type of the reasoning text. Always `reasoning_text`. default: reasoning_text x-stainless-const: true text: type: string description: The reasoning text from the model. type: object required: - type - text title: Reasoning text description: Reasoning text from the model. SpecificApplyPatchParam: properties: type: type: string enum: - apply_patch description: The tool to call. Always `apply_patch`. default: apply_patch x-stainless-const: true type: object required: - type title: Specific apply patch tool choice description: Forces the model to call the apply_patch tool when executing a tool call. ResponseCodeInterpreterCallInProgressEvent: type: object description: Emitted when a code interpreter call is in progress. properties: type: type: string description: The type of the event. Always `response.code_interpreter_call.in_progress`. enum: - response.code_interpreter_call.in_progress x-stainless-const: true output_index: type: integer description: The index of the output item in the response for which the code interpreter call is in progress. item_id: type: string description: The unique identifier of the code interpreter tool call item. sequence_number: type: integer description: The sequence number of this event, used to order streaming events. required: - type - output_index - item_id - sequence_number x-oaiMeta: name: response.code_interpreter_call.in_progress group: responses example: "{\n \"type\": \"response.code_interpreter_call.in_progress\",\n \"output_index\": 0,\n \"item_id\": \"ci_12345\",\n \"sequence_number\": 1\n}\n" Annotation: oneOf: - $ref: '#/components/schemas/FileCitationBody' - $ref: '#/components/schemas/UrlCitationBody' - $ref: '#/components/schemas/ContainerFileCitationBody' - $ref: '#/components/schemas/FilePath' description: An annotation that applies to a span of output text. discriminator: propertyName: type CoordParam: properties: x: type: integer description: The x-coordinate. y: type: integer description: The y-coordinate. type: object required: - x - y title: Coordinate description: 'An x/y coordinate pair, e.g. `{ x: 100, y: 200 }`.' ReasoningItem: type: object description: 'A description of the chain of thought used by a reasoning model while generating a response. Be sure to include these items in your `input` to the Responses API for subsequent turns of a conversation if you are manually [managing context](https://developers.openai.com/api/docs/guides/conversation-state). ' title: Reasoning properties: type: type: string description: 'The type of the object. Always `reasoning`. ' enum: - reasoning x-stainless-const: true id: type: string description: 'The unique identifier of the reasoning content. ' encrypted_content: anyOf: - type: string description: 'The encrypted content of the reasoning item. This is populated by default for reasoning items returned by `POST /v1/responses` and WebSocket `response.create` requests. When streaming, use the completed reasoning item and its `encrypted_content` from the `response.output_item.done` event in subsequent requests. The `encrypted_content` in `response.output_item.added` may be incomplete. This is especially important when `store` is `false` or when using Zero Data Retention. ' - type: 'null' summary: type: array description: 'Reasoning summary content. ' items: $ref: '#/components/schemas/SummaryTextContent' content: type: array description: 'Reasoning text content. ' items: $ref: '#/components/schemas/ReasoningTextContent' status: type: string description: 'The status of the item. One of `in_progress`, `completed`, or `incomplete`. Populated when items are returned via API. ' enum: - in_progress - completed - incomplete required: - id - summary - type CreateBatchRequest: type: object required: - input_file_id - endpoint - completion_window properties: input_file_id: type: string description: 'The ID of an uploaded file that contains requests for the new batch. See [upload file](https://developers.openai.com/api/reference/resources/files/methods/create) for how to upload a file. Your input file must be formatted as a [JSONL file](https://developers.openai.com/api/docs/guides/batch#1-prepare-your-batch-file), and must be uploaded with the purpose `batch`. The file can contain up to 50,000 requests, and can be up to 200 MB in size. ' endpoint: type: string enum: - /v1/responses - /v1/chat/completions - /v1/embeddings - /v1/completions - /v1/moderations - /v1/images/generations - /v1/images/edits - /v1/videos description: The endpoint to be used for all requests in the batch. Currently `/v1/responses`, `/v1/chat/completions`, `/v1/embeddings`, `/v1/completions`, `/v1/moderations`, `/v1/images/generations`, `/v1/images/edits`, and `/v1/videos` are supported. Note that `/v1/embeddings` batches are also restricted to a maximum of 50,000 embedding inputs across all requests in the batch. completion_window: type: string enum: - 24h description: The time frame within which the batch should be processed. Currently only `24h` is supported. metadata: $ref: '#/components/schemas/Metadata' output_expires_after: $ref: '#/components/schemas/BatchFileExpirationAfter' ImageEditPartialImageEvent: type: object description: 'Emitted when a partial image is available during image editing streaming. ' properties: type: type: string description: 'The type of the event. Always `image_edit.partial_image`. ' enum: - image_edit.partial_image x-stainless-const: true b64_json: type: string description: 'Base64-encoded partial image data, suitable for rendering as an image. ' created_at: type: integer format: unixtime description: 'The Unix timestamp when the event was created. ' size: anyOf: - type: string - type: string enum: - 1024x1024 - 1024x1536 - 1536x1024 - auto description: The image dimensions as a `WIDTHxHEIGHT` string, for example `1536x864`. quality: type: string description: 'The quality setting for the requested edited image. ' enum: - low - medium - high - xhigh - max - auto background: type: string description: 'The background setting for the requested edited image. ' enum: - transparent - opaque - auto output_format: type: string description: 'The output format for the requested edited image. ' enum: - png - webp - jpeg partial_image_index: type: integer description: '0-based index for the partial image (streaming). ' required: - type - b64_json - created_at - size - quality - background - output_format - partial_image_index x-oaiMeta: name: image_edit.partial_image group: images example: "{\n \"type\": \"image_edit.partial_image\",\n \"b64_json\": \"...\",\n \"created_at\": 1620000000,\n \"size\": \"1024x1024\",\n \"quality\": \"high\",\n \"background\": \"transparent\",\n \ \"output_format\": \"png\",\n \"partial_image_index\": 0\n}\n" FunctionToolCallOutputResource: allOf: - $ref: '#/components/schemas/FunctionToolCallOutput' - type: object properties: id: type: string description: 'The unique ID of the function call tool output. ' status: description: 'The status of the item. One of `in_progress`, `completed`, or `incomplete`. Populated when items are returned via API. ' $ref: '#/components/schemas/FunctionCallOutputStatusEnum' created_by: type: string description: 'The identifier of the actor that created the item. ' required: - id - status ContainerReferenceResource: properties: type: type: string enum: - container_reference description: The environment type. Always `container_reference`. default: container_reference x-stainless-const: true container_id: type: string type: object required: - type - container_id title: Container Reference description: Represents a container created with /v1/containers. ResponseContentPartAddedEvent: type: object description: Emitted when a new content part is added. properties: type: type: string description: 'The type of the event. Always `response.content_part.added`. ' enum: - response.content_part.added x-stainless-const: true item_id: type: string description: 'The ID of the output item that the content part was added to. ' output_index: type: integer description: 'The index of the output item that the content part was added to. ' content_index: type: integer description: 'The index of the content part that was added. ' part: $ref: '#/components/schemas/OutputContent' description: 'The content part that was added. ' sequence_number: type: integer description: The sequence number of this event. required: - type - item_id - output_index - content_index - part - sequence_number x-oaiMeta: name: response.content_part.added group: responses example: "{\n \"type\": \"response.content_part.added\",\n \"item_id\": \"msg_123\",\n \"output_index\": 0,\n \"content_index\": 0,\n \"part\": {\n \"type\": \"output_text\",\n \"text\": \"\",\n \ \"annotations\": []\n },\n \"sequence_number\": 1\n}\n" ResponseFailedEvent: type: object description: 'An event that is emitted when a response fails. ' properties: type: type: string description: 'The type of the event. Always `response.failed`. ' enum: - response.failed x-stainless-const: true sequence_number: type: integer description: The sequence number of this event. response: $ref: '#/components/schemas/Response' description: 'The response that failed. ' required: - type - response - sequence_number x-oaiMeta: name: response.failed group: responses example: "{\n \"type\": \"response.failed\",\n \"response\": {\n \"id\": \"resp_123\",\n \ \"object\": \"response\",\n \"created_at\": 1740855869,\n \"status\": \"failed\",\n \ \"completed_at\": null,\n \"error\": {\n \"code\": \"server_error\",\n \"message\": \"The model failed to generate a response.\"\n },\n \"incomplete_details\": null,\n \"instructions\": null,\n \"max_output_tokens\": null,\n \"model\": \"gpt-6-astra\",\n \"output\": [],\n \ \"previous_response_id\": null,\n \"reasoning_effort\": null,\n \"store\": false,\n \ \"temperature\": 1,\n \"text\": {\n \"format\": {\n \"type\": \"text\"\n \ }\n },\n \"tool_choice\": \"auto\",\n \"tools\": [],\n \"top_p\": 1,\n \"truncation\": \"disabled\",\n \"usage\": null,\n \"user\": null,\n \"metadata\": {}\n }\n}\n" ToolSearchCallItemParam: properties: id: anyOf: - type: string description: The unique ID of this tool search call. example: tsc_123 - type: 'null' call_id: anyOf: - type: string maxLength: 64 minLength: 1 description: The unique ID of the tool search call generated by the model. - type: 'null' type: type: string enum: - tool_search_call description: The item type. Always `tool_search_call`. default: tool_search_call x-stainless-const: true execution: $ref: '#/components/schemas/ToolSearchExecutionType' description: Whether tool search was executed by the server or by the client. arguments: $ref: '#/components/schemas/EmptyModelParam' description: The arguments supplied to the tool search call. status: anyOf: - $ref: '#/components/schemas/FunctionCallItemStatus' description: The status of the tool search call. - type: 'null' type: object required: - type - arguments ResponseFormatJsonSchemaSchema: type: object title: JSON schema description: 'The schema for the response format, described as a JSON Schema object. Learn how to build JSON schemas [here](https://json-schema.org/). ' additionalProperties: true ImageGenCompletedEvent: type: object description: 'Emitted when image generation has completed and the final image is available. ' properties: type: type: string description: 'The type of the event. Always `image_generation.completed`. ' enum: - image_generation.completed x-stainless-const: true b64_json: type: string description: 'Base64-encoded image data, suitable for rendering as an image. ' created_at: type: integer format: unixtime description: 'The Unix timestamp when the event was created. ' size: anyOf: - type: string - type: string enum: - 1024x1024 - 1024x1536 - 1536x1024 - auto description: The image dimensions as a `WIDTHxHEIGHT` string, for example `1536x864`. quality: type: string description: 'The quality setting for the generated image. ' enum: - low - medium - high - xhigh - max - auto background: type: string description: 'The background setting for the generated image. ' enum: - transparent - opaque - auto output_format: type: string description: 'The output format for the generated image. ' enum: - png - webp - jpeg usage: $ref: '#/components/schemas/ImagesUsage' required: - type - b64_json - created_at - size - quality - background - output_format - usage x-oaiMeta: name: image_generation.completed group: images example: "{\n \"type\": \"image_generation.completed\",\n \"b64_json\": \"...\",\n \"created_at\": 1620000000,\n \"size\": \"1024x1024\",\n \"quality\": \"high\",\n \"background\": \"transparent\",\n \ \"output_format\": \"png\",\n \"usage\": {\n \"total_tokens\": 100,\n \"input_tokens\": 50,\n \"output_tokens\": 50,\n \"input_tokens_details\": {\n \"text_tokens\": 10,\n \ \"image_tokens\": 40\n }\n }\n}\n" ChatCompletionModeration: type: object description: Moderation results or errors for the request input and generated output. properties: input: oneOf: - $ref: '#/components/schemas/ChatCompletionModerationResults' - $ref: '#/components/schemas/ChatCompletionModerationError' discriminator: propertyName: type description: Moderation for the request input. output: oneOf: - $ref: '#/components/schemas/ChatCompletionModerationResults' - $ref: '#/components/schemas/ChatCompletionModerationError' discriminator: propertyName: type description: Moderation for the generated output. required: - input - output TypeParam: properties: type: type: string enum: - type description: Specifies the event type. For a type action, this property is always set to `type`. default: type x-stainless-const: true text: type: string description: The text to type. type: object required: - type - text title: Type description: An action to type in text. ComputerAction: oneOf: - $ref: '#/components/schemas/ClickParam' - $ref: '#/components/schemas/DoubleClickAction' - $ref: '#/components/schemas/DragParam' - $ref: '#/components/schemas/KeyPressAction' - $ref: '#/components/schemas/MoveParam' - $ref: '#/components/schemas/ScreenshotParam' - $ref: '#/components/schemas/ScrollParam' - $ref: '#/components/schemas/TypeParam' - $ref: '#/components/schemas/WaitParam' discriminator: propertyName: type CustomToolCallOutput: type: object title: Custom tool call output description: 'The output of a custom tool call from your code, being sent back to the model. ' properties: type: type: string enum: - custom_tool_call_output x-stainless-const: true description: 'The type of the custom tool call output. Always `custom_tool_call_output`. ' id: type: string description: 'The unique ID of the custom tool call output in the OpenAI platform. ' call_id: type: string description: 'The call ID, used to map this custom tool call output to a custom tool call. ' caller: anyOf: - $ref: '#/components/schemas/ToolCallCallerParam' - type: 'null' output: description: 'The output from the custom tool call generated by your code. Can be a string or an list of output content. ' oneOf: - type: string description: 'A string of the output of the custom tool call. ' title: string output - type: array items: $ref: '#/components/schemas/FunctionAndCustomToolCallOutput' title: output content list description: 'Text, image, or file output of the custom tool call. ' required: - type - call_id - output ItemReferenceParam: properties: type: anyOf: - type: string enum: - item_reference description: The type of item to reference. Always `item_reference`. default: item_reference x-stainless-const: true - type: 'null' id: type: string description: The ID of the item to reference. type: object required: - id title: Item reference description: An internal identifier for an item to reference. FunctionShellCallOutputContentParam: properties: stdout: type: string maxLength: 10485760 description: Captured stdout output for the shell call. stderr: type: string maxLength: 10485760 description: Captured stderr output for the shell call. outcome: $ref: '#/components/schemas/FunctionShellCallOutputOutcomeParam' description: The exit or timeout outcome associated with this shell call. type: object required: - stdout - stderr - outcome title: Shell output content description: Captured stdout and stderr for a portion of a shell tool call output. FunctionShellCallOutputExitOutcomeParam: properties: type: type: string enum: - exit description: The outcome type. Always `exit`. default: exit x-stainless-const: true exit_code: type: integer description: The exit code returned by the shell process. type: object required: - type - exit_code title: Shell call exit outcome description: Indicates that the shell commands finished and returned an exit code. ToolChoiceFunction: type: object title: Function tool description: 'Use this option to force the model to call a specific function. ' properties: type: type: string enum: - function description: For function calling, the type is always `function`. x-stainless-const: true name: type: string description: The name of the function to call. required: - type - name ChatCompletionRequestMessageContentPartAudio: type: object title: Audio content part description: 'Learn about [audio inputs](https://developers.openai.com/api/docs/guides/audio). ' properties: type: type: string enum: - input_audio description: The type of the content part. Always `input_audio`. x-stainless-const: true input_audio: type: object properties: data: type: string description: Base64 encoded audio data. format: type: string enum: - wav - mp3 description: 'The format of the encoded audio data. Currently supports "wav" and "mp3". ' required: - data - format prompt_cache_breakpoint: $ref: '#/components/schemas/PromptCacheBreakpointParam' required: - type - input_audio CreateImageRequest: type: object properties: prompt: description: A text description of the desired image(s). The maximum length is 32000 characters for the GPT image models, 1000 characters for `dall-e-2` and 4000 characters for `dall-e-3`. type: string example: A cute baby sea otter model: anyOf: - type: string - type: string enum: - gpt-image-1.5 - gpt-image-2 - gpt-image-2-2026-04-21 - gpt-image-2.5-sunburst - gpt-image-2.5-sunburst-2026-09-08 - gpt-image-2.5-flare - gpt-image-2.5-flare-2026-09-08 - dall-e-2 - dall-e-3 - gpt-image-1 - gpt-image-1-mini x-oaiTypeLabel: string default: dall-e-2 example: gpt-image-1.5 nullable: true description: The model to use for image generation. One of `dall-e-2`, `dall-e-3`, or a GPT image model (`gpt-image-1`, `gpt-image-1-mini`, `gpt-image-1.5`, `gpt-image-2`, `gpt-image-2-2026-04-21`, `gpt-image-2.5-sunburst`, `gpt-image-2.5-sunburst-2026-09-08`, `gpt-image-2.5-flare`, `gpt-image-2.5-flare-2026-09-08`). Defaults to `dall-e-2` unless a parameter specific to the GPT image models is used. n: type: integer minimum: 1 maximum: 10 default: 1 example: 1 nullable: true description: The number of images to generate. Must be between 1 and 10. For `dall-e-3`, only `n=1` is supported. quality: type: string enum: - standard - hd - low - medium - high - xhigh - max - auto default: auto example: medium nullable: true description: "The quality of the image that will be generated.\n\n- `auto` (default value) will automatically select the best quality for the given\n model.\n- `high`, `medium` and `low` are supported for the GPT image models.\n- `gpt-image-2.5-sunburst` and `gpt-image-2.5-flare`, including their `2026-09-08`\n snapshots, also support `xhigh` and `max`.\n- `hd` and `standard` are supported for `dall-e-3`.\n- `standard` is the only option for `dall-e-2`.\n" response_format: type: string enum: - url - b64_json default: url example: url nullable: true description: The format in which generated images with `dall-e-2` and `dall-e-3` are returned. Must be one of `url` or `b64_json`. URLs are only valid for 60 minutes after the image has been generated. This parameter isn't supported for the GPT image models, which always return base64-encoded images. output_format: type: string enum: - png - jpeg - webp default: png example: png nullable: true description: The format in which the generated images are returned. This parameter is only supported for the GPT image models. Must be one of `png`, `jpeg`, or `webp`. output_compression: type: integer default: 100 example: 100 nullable: true description: The compression level (0-100%) for the generated images. This parameter is only supported for the GPT image models with the `webp` or `jpeg` output formats, and defaults to 100. stream: type: boolean default: false example: false nullable: true description: 'Generate the image in streaming mode. Defaults to `false`. See the [Image generation guide](https://developers.openai.com/api/docs/guides/image-generation) for more information. This parameter is only supported for the GPT image models. ' partial_images: $ref: '#/components/schemas/PartialImages' size: anyOf: - type: string - type: string enum: - auto - 1024x1024 - 1536x1024 - 1024x1536 - 256x256 - 512x512 - 1792x1024 - 1024x1792 default: auto example: 1024x1024 nullable: true description: The size of the generated images. For `gpt-image-2`, `gpt-image-2-2026-04-21`, `gpt-image-2.5-sunburst`, `gpt-image-2.5-sunburst-2026-09-08`, `gpt-image-2.5-flare`, and `gpt-image-2.5-flare-2026-09-08`, arbitrary resolutions are supported as `WIDTHxHEIGHT` strings, for example `1536x864`. Width and height must both be divisible by 16 and the requested aspect ratio must be between 1:3 and 3:1. Resolutions above `2560x1440` are experimental, and the maximum supported resolution is `3840x2160`. The requested size must also satisfy the model's current pixel and edge limits. The standard sizes `1024x1024`, `1536x1024`, and `1024x1536` are supported by the GPT image models; `auto` is supported for models that allow automatic sizing. For `dall-e-2`, use one of `256x256`, `512x512`, or `1024x1024`. For `dall-e-3`, use one of `1024x1024`, `1792x1024`, or `1024x1792`. moderation: type: string enum: - low - auto default: auto example: low nullable: true description: Control the content-moderation level for images generated by the GPT image models. Must be either `low` for less restrictive filtering or `auto` (default value). background: type: string enum: - transparent - opaque - auto default: auto example: transparent nullable: true description: 'Set the background of the generated image(s). This parameter is only supported for the GPT image models. Must be one of `transparent`, `opaque`, or `auto` (default value). When `auto` is used, the model will automatically determine the best background for the image. `gpt-image-2.5-sunburst` and `gpt-image-2.5-flare`, including their `2026-09-08` snapshots, support `opaque` and `transparent` backgrounds. Transparent backgrounds are available for supported GPT Image models. For `gpt-image-2` and `gpt-image-2-2026-04-21`, this support is in preview. When using `transparent`, set the output format to `png` or `webp`. ' style: type: string enum: - vivid - natural default: vivid example: vivid nullable: true description: The style of the generated images. This parameter is only supported for `dall-e-3`. Must be one of `vivid` or `natural`. Vivid causes the model to lean towards generating hyper-real and dramatic images. Natural causes the model to produce more natural, less hyper-real looking images. user: type: string example: user-1234 description: 'A unique identifier representing your end-user, which can help OpenAI to monitor and detect abuse. [Learn more](https://developers.openai.com/api/docs/guides/safety-best-practices#implement-safety-identifiers). ' required: - prompt ModelIdsShared: example: gpt-6-astra anyOf: - type: string - type: string enum: - gpt-6-astra - gpt-5.6-sol - gpt-5.6-terra - gpt-5.6-luna - gpt-5.5 - gpt-5.5-2026-04-23 - gpt-5.4 - gpt-5.4-mini - gpt-5.4-nano - gpt-5.4-mini-2026-03-17 - gpt-5.4-nano-2026-03-17 - gpt-5.3-chat-latest - gpt-5.2 - gpt-5.2-2025-12-11 - gpt-5.2-chat-latest - gpt-5.2-pro - gpt-5.2-pro-2025-12-11 - gpt-5.1 - gpt-5.1-2025-11-13 - gpt-5.1-codex - gpt-5.1-mini - gpt-5.1-chat-latest - gpt-5 - gpt-5-mini - gpt-5-nano - gpt-5-2025-08-07 - gpt-5-mini-2025-08-07 - gpt-5-nano-2025-08-07 - gpt-5-chat-latest - gpt-4.1 - gpt-4.1-mini - gpt-4.1-nano - gpt-4.1-2025-04-14 - gpt-4.1-mini-2025-04-14 - gpt-4.1-nano-2025-04-14 - o4-mini - o4-mini-2025-04-16 - o3 - o3-2025-04-16 - o3-mini - o3-mini-2025-01-31 - o1 - o1-2024-12-17 - o1-preview - o1-preview-2024-09-12 - o1-mini - o1-mini-2024-09-12 - gpt-4o - gpt-4o-2024-11-20 - gpt-4o-2024-08-06 - gpt-4o-2024-05-13 - gpt-4o-audio-preview - gpt-4o-audio-preview-2024-10-01 - gpt-4o-audio-preview-2024-12-17 - gpt-4o-audio-preview-2025-06-03 - gpt-4o-mini-audio-preview - gpt-4o-mini-audio-preview-2024-12-17 - gpt-4o-search-preview - gpt-4o-mini-search-preview - gpt-4o-search-preview-2025-03-11 - gpt-4o-mini-search-preview-2025-03-11 - chatgpt-4o-latest - codex-mini-latest - gpt-4o-mini - gpt-4o-mini-2024-07-18 - gpt-4-turbo - gpt-4-turbo-2024-04-09 - gpt-4-0125-preview - gpt-4-turbo-preview - gpt-4-1106-preview - gpt-4-vision-preview - gpt-4 - gpt-4-0314 - gpt-4-0613 - gpt-4-32k - gpt-4-32k-0314 - gpt-4-32k-0613 - gpt-3.5-turbo - gpt-3.5-turbo-16k - gpt-3.5-turbo-0301 - gpt-3.5-turbo-0613 - gpt-3.5-turbo-1106 - gpt-3.5-turbo-0125 - gpt-3.5-turbo-16k-0613 PromptCacheTTLEnum: type: string enum: - 30m ImageGenUsage: properties: input_tokens: type: integer description: The number of tokens (images and text) in the input prompt. total_tokens: type: integer description: The total number of tokens (images and text) used for the image generation. output_tokens: type: integer description: The number of output tokens generated by the model. output_tokens_details: $ref: '#/components/schemas/ImageGenOutputTokensDetails' input_tokens_details: $ref: '#/components/schemas/ImageGenInputUsageDetails' type: object required: - input_tokens - total_tokens - output_tokens - input_tokens_details title: Image generation usage description: For `gpt-image-1` only, the token usage information for the image generation. NamespaceToolParam: properties: type: type: string enum: - namespace description: The type of the tool. Always `namespace`. default: namespace x-stainless-const: true name: type: string minLength: 1 description: The namespace name used in tool calls (for example, `crm`). description: type: string description: A description of the namespace shown to the model. tools: items: oneOf: - $ref: '#/components/schemas/FunctionToolParam' - $ref: '#/components/schemas/CustomToolParam' description: A function or custom tool that belongs to a namespace. discriminator: propertyName: type type: array minItems: 1 description: The function/custom tools available inside this namespace. type: object required: - type - name - description - tools title: Namespace description: Groups function/custom tools under a shared namespace. responses: TooManyRequests: description: The request was rejected because a rate limit was exceeded. headers: Retry-After: description: The minimum number of seconds to wait before retrying. This header is returned when the server has computed a retry delay and may be omitted for 429 responses that require user action. schema: type: integer minimum: 1 content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' InferenceRateLimited: description: The request was rejected because a rate limit was exceeded. A slow_down error means traffic increased too quickly; reduce your request rate, then increase it gradually. headers: Retry-After: description: The minimum number of seconds to wait before retrying. This header is returned when the server has computed a retry delay and may be omitted. schema: type: integer minimum: 1 content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' examples: slowDown: summary: Traffic increased too quickly value: error: message: Your request rate increased too quickly. Please reduce the request rate and gradually increase it again. type: rate_limit_error param: null code: slow_down InferenceServiceUnavailable: description: The service is temporarily unavailable. A server_is_overloaded error means the requested model is temporarily overloaded; retry after a brief delay. headers: Retry-After: description: The minimum number of seconds to wait before retrying. This header is returned when the server has computed a retry delay and may be omitted. schema: type: integer minimum: 1 content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' examples: serverOverloaded: summary: The requested model is temporarily overloaded value: error: message: The model is temporarily overloaded. Please retry your request after a brief delay. type: service_unavailable_error param: null code: server_is_overloaded