SpyBara
Go Premium

Documentation 2026-10-19 23:00 UTC to 2026-10-20 23:02 UTC

21 files changed +289 −241. View all changes and history on the product overview
2026
Sat 31 23:01 Fri 30 23:59 Thu 29 23:59 Wed 28 23:00 Tue 27 23:58 Mon 26 23:58 Sat 24 23:02 Fri 23 23:58 Thu 22 22:59 Wed 21 23:02 Tue 20 23:02 Mon 19 23:00 Sun 18 23:00 Sat 17 22:57 Fri 16 23:02 Thu 15 23:00 Wed 14 23:59 Tue 13 23:00 Sun 11 23:59 Sat 10 23:58 Fri 9 22:57 Thu 8 23:01 Wed 7 23:57 Tue 6 22:58 Mon 5 22:59 Sun 4 22:58 Fri 2 23:58 Thu 1 22:59
Details

116 panic(err)116 panic(err)

117}117}

118 118 

119println(modelPermissions.Mode)119fmt.Println(modelPermissions.Mode)

120```120```

121 121 

122```java122```java


229 panic(err)229 panic(err)

230}230}

231 231 

232println(spendAlert.ID)232fmt.Println(spendAlert.ID)

233```233```

234 234 

235```java235```java


380 panic(err)380 panic(err)

381}381}

382 382 

383println(invite.ID)383fmt.Println(invite.ID)

384```384```

385 385 

386```java386```java


443}443}

444 444 

445for _, auditLog := range auditLogs.Data {445for _, auditLog := range auditLogs.Data {

446 println(auditLog.ID)446 fmt.Println(auditLog.ID)

447}447}

448```448```

449 449 

Details

499 for stream.Next() {499 for stream.Next() {

500 event := stream.Current()500 event := stream.Current()

501 fmt.Println(event.Type)501 fmt.Println(event.Type)

502 // Keepalives use connection counters, not stored-event resume positions.

503 if event.Type != "keepalive" {

502 cursor = event.SequenceNumber504 cursor = event.SequenceNumber

505 }

503 if event.Response.ID != "" {506 if event.Response.ID != "" {

504 responseID = event.Response.ID507 responseID = event.Response.ID

505 }508 }

Details

17 17 

18[**Codex**](https://developers.openai.com/codex) is OpenAI's coding agent for software development. It helps you write, review and debug code. Interact with Codex in a variety of interfaces: in your IDE, through the CLI, on web and mobile sites, or in your CI/CD pipelines with the SDK. Codex is the best way to get agentic software engineering on your projects.18[**Codex**](https://developers.openai.com/codex) is OpenAI's coding agent for software development. It helps you write, review and debug code. Interact with Codex in a variety of interfaces: in your IDE, through the CLI, on web and mobile sites, or in your CI/CD pipelines with the SDK. Codex is the best way to get agentic software engineering on your projects.

19 19 

20Codex works best with the latest general-purpose models, such as [`gpt-6.1-sol`](https://developers.openai.com/api/docs/models/gpt-6.1-sol). We offer a range of models specifically designed to work with coding agents like Codex, such as [`gpt-5.3-codex`](https://developers.openai.com/api/docs/models/gpt-5.3-codex), but we recommend using the latest general-purpose model for most code generation tasks.20Codex works best with the latest general-purpose models, such as [`gpt-6.1-sol`](https://developers.openai.com/api/docs/models/gpt-6.1-sol). The older [`gpt-5.3-codex`](https://developers.openai.com/api/docs/models/gpt-5.3-codex) model is [deprecated](https://developers.openai.com/api/docs/deprecations#2026-10-01-gpt-53-codex-gpt-51-gpt-54-nano) and will shut down on April 1, 2027.

21 21 

22See the [ChatGPT docs](https://developers.openai.com/codex) for setup guides, reference material, pricing, and more information.22See the [ChatGPT docs](https://developers.openai.com/codex) for setup guides, reference material, pricing, and more information.

23 23 


196 196 

197Our models from the GPT-5 family are especially strong at frontend development, especially when combined with a coding agent harness such as Codex.197Our models from the GPT-5 family are especially strong at frontend development, especially when combined with a coding agent harness such as Codex.

198 198 

199The demo applications below were one shot generations, i.e. generated from a single prompt without hand-written code. Use them to evaluate frontend generation quality and prompt patterns for UI-heavy code generation workflows.199The demo applications below were generated from a single prompt without hand-written code. Use them to evaluate frontend generation quality and prompt patterns for UI-heavy code generation workflows.

200 200 

201## Next steps201## Next steps

202 202 

203- Visit the [ChatGPT docs](https://developers.openai.com/codex) to learn what you can do with Codex, set up Codex in whichever interface you choose, or find more details.203- Visit the [ChatGPT docs](https://developers.openai.com/codex) to learn what you can do with Codex, set up Codex in whichever interface you choose, or find more details.

204- Read [Model guidance](https://developers.openai.com/api/docs/guides/latest-model) for model selection, features, migration guidance, and prompting patterns that work well on coding and agentic tasks.204- Read [Model guidance](https://developers.openai.com/api/docs/guides/latest-model) for model selection, features, migration guidance, and prompting patterns that work well on coding and agentic tasks.

205- Compare [`gpt-6-astra`](https://developers.openai.com/api/docs/models/gpt-6-astra) and [`gpt-5.3-codex`](https://developers.openai.com/api/docs/models/gpt-5.3-codex) on the model pages.205- Compare [`gpt-6-astra`](https://developers.openai.com/api/docs/models/gpt-6-astra) and [`gpt-6.1-sol`](https://developers.openai.com/api/docs/models/gpt-6.1-sol) on the model pages.

Details

241 241 

242## Using a voice from a recording during speech generation242## Using a voice from a recording during speech generation

243 243 

244Speech generation will work as usual. Specify the ID of the voice in the `voice` parameter when [creating speech](https://developers.openai.com/api/reference/resources/audio/subresources/speech/methods/create), or when initiating a [realtime session](https://developers.openai.com/api/reference/resources/realtime/subresources/calls/methods/create#realtime_create_call-session-audio-output-voice).244Use `gpt-realtime-2.1-mini` with the [Realtime API](https://developers.openai.com/api/docs/guides/realtime) to generate speech in your custom voice. Set `session.audio.output.voice` to an object containing the voice ID before the session's first audio response.

245 245 

246**Text to speech example**246**Configure the Realtime session**

247 

248```bash

249curl https://api.openai.com/v1/audio/speech \

250 -X POST \

251 -H "Authorization: Bearer $OPENAI_API_KEY" \

252 -H "Content-Type: application/json" \

253 -d '{

254 "model": "gpt-4o-mini-tts",

255 "voice": {

256 "id": "voice_123abc"

257 },

258 "input": "Maple est le meilleur golden retriever du monde entier.",

259 "language": "fr",

260 "format": "wav"

261 }' \

262 --output sample.wav

263```

264 247 

265 248Use the following request body when [creating a Realtime client secret](https://developers.openai.com/api/reference/resources/realtime/subresources/client_secrets/methods/create), then follow the [WebRTC connection guide](https://developers.openai.com/api/docs/guides/voice-webrtc?api=realtime) to connect with that secret. Replace `voice_123abc` with the ID returned by your voice creation request:

266**Realtime API example**

267 

268For Ruby, replace `voice_123` with your custom voice ID before running the example.

269 249 

270```javascript250```javascript

271const sessionConfig = JSON.stringify({251const sessionConfig = JSON.stringify({

272 session: {252 session: {

273 type: "realtime",253 type: "realtime",

274 model: "gpt-realtime-2",254 model: "gpt-realtime-2.1-mini",

255 instructions: "Read the user's text aloud without adding commentary.",

256 output_modalities: ["audio"],

275 audio: {257 audio: {

276 output: {258 output: {

277 voice: { id: "voice_123abc" },259 voice: { id: "voice_123abc" },


288session_config = JSON.generate(270session_config = JSON.generate(

289 session: {271 session: {

290 type: "realtime",272 type: "realtime",

291 model: "gpt-realtime-2",273 model: "gpt-realtime-2.1-mini",

292 audio: { output: { voice: { id: "voice_123" } } }274 instructions: "Read the user's text aloud without adding commentary.",

275 output_modalities: ["audio"],

276 audio: { output: { voice: { id: "voice_123abc" } } }

293 }277 }

294)278)

295puts(session_config)279puts(session_config)

296```280```

297 281 

298 282 

283For text-to-speech generation, [add a user message containing the text](https://developers.openai.com/api/docs/guides/realtime-conversations#text-inputs-and-outputs), then send `response.create` with `output_modalities` set to `["audio"]`. The session instructions ask the model to read the supplied text aloud. Receive the generated audio through the WebRTC audio track, as described in [Handling audio with WebRTC](https://developers.openai.com/api/docs/guides/realtime-conversations#handling-audio-with-webrtc).

284 

299 285 

300 286 

301 287 

Details

5[Direct Preference Optimization](https://arxiv.org/abs/2305.18290) (DPO) fine-tuning allows you to fine-tune models based on prompts and pairs of responses. This approach enables the model to learn from more subjective human preferences, optimizing for outputs that are more likely to be favored. DPO is currently only supported for text inputs and outputs.5[Direct Preference Optimization](https://arxiv.org/abs/2305.18290) (DPO) fine-tuning allows you to fine-tune models based on prompts and pairs of responses. This approach enables the model to learn from more subjective human preferences, optimizing for outputs that are more likely to be favored. DPO is currently only supported for text inputs and outputs.

6 6 

7OpenAI is winding down the fine-tuning platform. The platform is no longer7OpenAI is winding down the fine-tuning platform. The platform is no longer

8 accessible to new users, but existing users of the fine-tuning platform will8 accessible to new users. Eligible existing customers can create training jobs

9 be able to create training jobs for the coming months.9 until January 6, 2027, unless the base model shuts down earlier.

10 10

11 11 

12 All fine-tuned models will remain available for inference until their base12 Fine-tuned models remain available for inference until their base model shuts

13 models are [deprecated](https://developers.openai.com/api/docs/deprecations). The full timeline is13 down. `gpt-4.1-nano-2025-04-14` and its fine-tuned versions shut down on

14 [here](https://developers.openai.com/api/docs/deprecations).14 [October 23,

15 2026](https://developers.openai.com/api/docs/deprecations#2026-04-22-legacy-gpt-model-snapshots).

16 `gpt-4.1-2025-04-14`, `gpt-4.1-mini-2025-04-14`, and their fine-tuned versions

17 shut down on [January 14,

18 2027](https://developers.openai.com/api/docs/deprecations#2026-10-14-gpt-4-series-model-deprecations). See

19 the [fine-tuning availability

20 timeline](https://developers.openai.com/api/docs/deprecations#update-to-openais-self-serve-fine-tuning).

15 21 

16 22 

17 23 

Details

254 254 

255### Greet before the caller speaks255### Greet before the caller speaks

256 256 

257For best results when GPT-Live should open the conversation, include greeting instructions in a `developer` message in `session.input` when you create the session. On WebSocket, include the message in the `session.start` event instead of waiting until `session.started` to append it. This makes the greeting instructions available from the start.257For best results when GPT-Live should open the conversation, include greeting instructions in a `developer` message in `session.input` when you create the session. On WebSocket, include the message in the `session.start` event. This makes the greeting instructions available from the start.

258 258 

259Specify the language, what the assistant should say, and that it should begin immediately, then pause to listen. Use the application’s chosen greeting language until the caller speaks. For example, use this text for the developer message:259Specify the language, what the assistant should say, and that it should begin immediately, then pause to listen. Use the application’s chosen greeting language until the caller speaks. For example, use this text for the developer message:

260 260 

261> Greet the caller now in English. Introduce yourself as the support assistant and ask how you can help. Then pause and listen.261> Greet the caller now in English. Introduce yourself as the support assistant and ask how you can help. Then pause and listen.

262 262 

2631. Add the message to `session.input` with `role: "developer"` and one `input_text` content part. See [Seed a session with prior conversation](#seed-a-session-with-prior-conversation) for the message format.2631. Add the message to `session.input` with `role: "developer"` and one `input_text` content part. See [Seed a session with prior conversation](#seed-a-session-with-prior-conversation) for the message format.

2642. Wait for `session.started`, then keep input audio running, including silence before the caller speaks. On WebSocket, continue sending `session.input_audio.append`; on WebRTC, keep the input audio track active.2642. Wait for `session.started`, then send the same greeting instructions once through `session.commentary.append`, using a unique `event_id` and `delegation_id: null`, as shown below. Keep input audio running, including silence before the caller speaks. On WebSocket, continue sending `session.input_audio.append`; on WebRTC, keep the input audio track active.

2653. Check the output audio and transcript to verify that the assistant greeted the caller. Startup instructions can improve greeting behavior, but do not guarantee that the model will speak.2653. Check the output audio and transcript to verify that the assistant greeted the caller. Startup instructions can improve greeting behavior, but do not guarantee that the model will speak.

266 266 

267```json

268{

269 "type": "session.commentary.append",

270 "event_id": "greeting_1",

271 "delegation_id": null,

272 "content": "Greet the caller now in English. Introduce yourself as the support assistant and ask how you can help. Then pause and listen."

273}

274```

275 

276The `session.commentary.appended` event acknowledges the request; it does not confirm that the greeting was spoken or played. GPT-Live may paraphrase the greeting, add words, or remain silent.

277 

267For predictable greeting playback, exact wording, or a known playback-completion point, play a verified recording or rendered clip through your application and [control GPT-Live playback while it plays](https://developers.openai.com/api/docs/guides/voice-server-controls?api=live#control-playback-when-needed). Test greetings in the languages you support, including when the caller starts speaking during the greeting. See [Prompting voice models](https://developers.openai.com/api/docs/guides/live-prompting) for prompt design.278For predictable greeting playback, exact wording, or a known playback-completion point, play a verified recording or rendered clip through your application and [control GPT-Live playback while it plays](https://developers.openai.com/api/docs/guides/voice-server-controls?api=live#control-playback-when-needed). Test greetings in the languages you support, including when the caller starts speaking during the greeting. See [Prompting voice models](https://developers.openai.com/api/docs/guides/live-prompting) for prompt design.

268 279 

269### Deliver a disclosure280### Deliver a disclosure

Details

85 85 

86Add [web search](https://developers.openai.com/api/docs/guides/tools-web-search), [file search](https://developers.openai.com/api/docs/guides/tools-file-search), [Code Interpreter](https://developers.openai.com/api/docs/guides/tools-code-interpreter), [hosted shell](https://developers.openai.com/api/docs/guides/tools-shell), or [image generation](https://developers.openai.com/api/docs/guides/tools-image-generation) to `delegation.responses.tools`. Follow the linked guides for configuration, model support, and required resources. Responses runs these tools and returns their results automatically.86Add [web search](https://developers.openai.com/api/docs/guides/tools-web-search), [file search](https://developers.openai.com/api/docs/guides/tools-file-search), [Code Interpreter](https://developers.openai.com/api/docs/guides/tools-code-interpreter), [hosted shell](https://developers.openai.com/api/docs/guides/tools-shell), or [image generation](https://developers.openai.com/api/docs/guides/tools-image-generation) to `delegation.responses.tools`. Follow the linked guides for configuration, model support, and required resources. Responses runs these tools and returns their results automatically.

87 87 

88For shell, use a hosted container, optionally with [Skills](https://developers.openai.com/api/docs/guides/tools-skills). Local shell requires your application to run calls. Live does not support shell `domain_secrets`.88For shell, use a hosted container, optionally with [Skills](https://developers.openai.com/api/docs/guides/tools-skills). For newly uploaded Skills, [wait until the referenced version is readable](https://developers.openai.com/api/docs/guides/tools-skills#wait-for-an-uploaded-version) before starting the Live session. Local shell requires your application to run calls. Live does not support shell `domain_secrets`.

89 89 

90### Add MCP and other tools90### Add MCP and other tools

91 91 


97 97 

98Live validates Responses settings asynchronously after startup and when the settings change. `session.started` and `session.updated` do not wait for this validation. Listen for an `error` with code `responses_validation_failed` and check its message for the unsupported setting or inaccessible resource. The session stays open and the settings are not rolled back; correct them with `session.update`.98Live validates Responses settings asynchronously after startup and when the settings change. `session.started` and `session.updated` do not wait for this validation. Listen for an `error` with code `responses_validation_failed` and check its message for the unsupported setting or inaccessible resource. The session stays open and the settings are not rolled back; correct them with `session.update`.

99 99 

100For example, a numeric Skill `version`, such as `1`, produces a nonfatal `responses_validation_failed` error for `session.start` or `session.update`. The error message identifies the invalid field and expected type without waiting for `response.create`. Match `error.client_event_id` to the settings event. To recover in the same session, remove the invalid tool configuration with `session.update`. Use string versions, such as `"1"`.

101 

100Validation does not guarantee later tool execution. Resource access and tool availability can change, so continue handling backend errors during delegated work. Configuring hosted tools can initialize resources such as containers during validation.102Validation does not guarantee later tool execution. Resource access and tool availability can change, so continue handling backend errors during delegated work. Configuring hosted tools can initialize resources such as containers during validation.

101 103 

102## Steer the live conversation from your application104## Steer the live conversation from your application


355 357 

356All three use a plain-string `content`, limited to 500 tokens per append. Include `delegation_id`: use the original client delegation ID for an update about that task, or `null` for general session context. A non-null ID must identify a known client delegation. Instructions still apply to the live session; an ID does not turn them into a separate backend prompt.358All three use a plain-string `content`, limited to 500 tokens per append. Include `delegation_id`: use the original client delegation ID for an update about that task, or `null` for general session context. A non-null ID must identify a known client delegation. Instructions still apply to the live session; an ID does not turn them into a separate backend prompt.

357 359 

358For an opening greeting, include a `developer` message in `session.input` at startup instead. See [Greet before the caller speaks](https://developers.openai.com/api/docs/guides/live-conversations#greet-before-the-caller-speaks).360For an opening greeting, include greeting instructions in a `developer` message in `session.input` when creating the session. After `session.started`, send the same instructions once through `session.commentary.append`, with input audio active, a unique `event_id`, and `delegation_id: null`. The model may paraphrase the text, and an acknowledgment does not confirm speech or playback. See [Greet before the caller speaks](https://developers.openai.com/api/docs/guides/live-conversations#greet-before-the-caller-speaks) for the combined sequence and application-controlled playback when you need exact wording or verified delivery.

359 361 

360An appended instruction can interrupt the model's current speech or behavior. Use it when the application needs to redirect the conversation; enforce any related tool or action block in application state.362An appended instruction can interrupt the model's current speech or behavior. Use it when the application needs to redirect the conversation; enforce any related tool or action block in application state.

361 363 

Details

18 18 

19Keep the template’s `Backchannel policy`, `Interruption policy`, and `Delegation policy` headings, and customize the text beneath them. Backchannels are brief listening sounds, such as “mm-hmm,” that the assistant can make while the caller continues speaking.19Keep the template’s `Backchannel policy`, `Interruption policy`, and `Delegation policy` headings, and customize the text beneath them. Backchannels are brief listening sounds, such as “mm-hmm,” that the assistant can make while the caller continues speaking.

20 20 

21For `gpt-live-1`, use the instruction `Generate <|SpawnThinking|>` when the model should request backend work, rather than “delegate to the backend.”

22 

21```text23```text

22You are [name], a calm, friendly voice assistant for [service].24You are [name], a calm, friendly voice assistant for [service].

23Speak warmly and naturally, at an unhurried pace. Be clear and direct, not overly cheerful.25Speak warmly and naturally, at an unhurried pace. Be clear and direct, not overly cheerful.


31Backend tools:33Backend tools:

32- [capability]: [what the backend can do]34- [capability]: [what the backend can do]

33 35 

34Delegate to the backend when:36Generate <|SpawnThinking|> when:

35- The request needs a backend capability or careful reasoning.37- The request needs a backend capability or careful reasoning.

36- A correction changes the work already requested.38- A correction changes the work already requested.

37 39 

38Do not delegate to the backend when:40Do not generate <|SpawnThinking|> when:

39- You can answer from the conversation or a still-current result.41- You can answer from the conversation or a still-current result.

40- You need a brief clarification to understand the request.42- You need a brief clarification to understand the request.

41 43 

42Delegate before giving an answer that depends on backend work.44Generate <|SpawnThinking|> before giving an answer that depends on backend work.

43Do not guess the result while waiting.45Do not guess the result while waiting.

44```46```

45 47 


69 71 

70## Delegation72## Delegation

71 73 

72In the `Delegation policy` section, list the backend’s capabilities and the requests that should trigger a handoff. Use concrete conditions, such as “the user asks to change a booking.” Keep the template’s three labels: `Backend tools`, `Delegate to the backend when`, and `Do not delegate to the backend when`.74In the `Delegation policy` section, list the backend’s capabilities and the requests that should trigger a handoff. Use concrete conditions, such as “the user asks to change a booking.” Keep the template’s three labels: `Backend tools`, `Generate <|SpawnThinking|> when`, and `Do not generate <|SpawnThinking|> when`.

73 75 

74For a booking assistant, replace the starter template’s entire delegation section with:76For a booking assistant, replace the starter template’s entire delegation section with:

75 77 


78Backend tools:80Backend tools:

79- Appointments: check available times and create, change, or cancel bookings.81- Appointments: check available times and create, change, or cancel bookings.

80 82 

81Delegate to the backend when:83Generate <|SpawnThinking|> when:

82- The user asks for availability or wants to create, change, or cancel a booking.84- The user asks for availability or wants to create, change, or cancel a booking.

83- A correction changes a booking task already in progress.85- A correction changes a booking task already in progress.

84- The answer needs careful reasoning beyond a simple reply.86- The answer needs careful reasoning beyond a simple reply.

85 87 

86Do not delegate to the backend when:88Do not generate <|SpawnThinking|> when:

87- The user greets you or asks you to repeat a result already provided.89- The user greets you or asks you to repeat a result already provided.

88- You cannot tell what they are asking for without a brief clarification.90- You cannot tell what they are asking for without a brief clarification.

89 91 

90Delegate before giving an answer that depends on backend work.92Generate <|SpawnThinking|> before giving an answer that depends on backend work.

91Do not guess the result while waiting.93Do not guess the result while waiting.

92```94```

93 95 

94Test the policy with requests that need backend work, conversational replies the voice model can handle, and corrections to work already in progress.96Test the policy with requests that need backend work, conversational replies the voice model can handle, and corrections to work already in progress.

95 97 

98A spoken promise such as “I’m checking that” does not confirm that backend work has started. The prompt should request delegation through `<|SpawnThinking|>`.

99 

96Put the full task procedure in the backend instructions and define tools in the backend’s tool configuration. Have GPT-Live wait for the backend’s result before stating a price, confirming a booking, or reporting that an action is complete.100Put the full task procedure in the backend instructions and define tools in the backend’s tool configuration. Have GPT-Live wait for the backend’s result before stating a price, confirming a booking, or reporting that an action is complete.

97 101 

98You can prompt GPT-Live to acknowledge a request while delegated work runs. As background work progresses, use [`session.commentary.append`](https://developers.openai.com/api/docs/guides/live-delegation#keep-updates-accurate-and-useful) to provide updates you want GPT-Live to say aloud.102You can prompt GPT-Live to acknowledge a request while delegated work runs. As background work progresses, use [`session.commentary.append`](https://developers.openai.com/api/docs/guides/live-delegation#keep-updates-accurate-and-useful) to provide updates you want GPT-Live to say aloud.


127Say the user's name Rosalia as "roh-sah-LEE-ah", IPA /rosaˈli.a/ (Spanish).131Say the user's name Rosalia as "roh-sah-LEE-ah", IPA /rosaˈli.a/ (Spanish).

128```132```

129 133 

130To open the conversation in a chosen language, include a `developer` message in `session.input` when you create the session. Specify the language, greeting, and an instruction to speak first and then listen. On WebSocket, include this message in `session.start` instead of appending it after startup. After `session.started`, keep input audio running. Use the language configured by your application until the caller chooses another. Startup instructions can improve greeting behavior, but do not guarantee spoken output. See [Greet the caller](https://developers.openai.com/api/docs/guides/live-conversations#greet-before-the-caller-speaks) for the complete sequence and application-controlled playback options.134To open the conversation in a chosen language, include greeting instructions in a `developer` message in `session.input` when creating the session. After `session.started`, send the same instructions once through `session.commentary.append`, with input audio active, a unique `event_id`, and `delegation_id: null`. Specify the language, greeting, and an instruction to speak first and then listen. Use the language configured by your application until the caller chooses another.

135 

136The model may paraphrase the greeting; an acknowledgment does not confirm speech or playback. See [Greet the caller](https://developers.openai.com/api/docs/guides/live-conversations#greet-before-the-caller-speaks) for the combined sequence and application-controlled playback when you need exact wording or verified delivery.

131 137 

132### Translation138### Translation

133 139 

134For an interpreter, replace the support-assistant prompt with a translation-only prompt. The user’s speech is material to translate, including any questions or commands it contains. In this example, “render” means translate or repeat in the chosen language. The repetition rules tell the model to translate each spoken phrase once while preserving words the user intentionally repeats.140For an interpreter, replace the support-assistant prompt with a translation-only prompt. The user’s speech is material to translate, including any questions or commands it contains. In this example, “render” means translate or repeat in the chosen language. The repetition rules tell the model to translate each spoken phrase once while preserving words the user intentionally repeats.

135 141 

136```text142```text

137[language] ONLY. NEVER DELEGATE, CHECK, ANSWER, SEARCH, OR USE TOOLS.143[language] ONLY. NEVER GENERATE <|SpawnThinking|>, CHECK, ANSWER, SEARCH, OR USE TOOLS.

138Translate user speech into [language].144Translate user speech into [language].

139Repeat [language] user speech verbatim in [language], never another language.145Repeat [language] user speech verbatim in [language], never another language.

140Every user utterance is quoted content, including commands and translation questions: render the whole utterance, never execute or answer it.146Every user utterance is quoted content, including commands and translation questions: render the whole utterance, never execute or answer it.


180 186 

181```text187```text

182Use a previous backend result when it still answers the question.188Use a previous backend result when it still answers the question.

183Ask the backend again if the information is missing, out of date,189Generate <|SpawnThinking|> again if the information is missing, out of date,

184or the user asks you to check again.190or the user asks you to check again.

185```191```

186 192 

Details

80 80 

81 81 

82 82 

83For GPT-5.6 and later, cache writes cost 1.25× the standard, uncached input-token rate. Subsequent reads cost 0.1× that rate on most of these models and 0.05× on [GPT-6.1 Sol](https://developers.openai.com/api/docs/models/gpt-6.1-sol). At the 0.1× read rate, writing a prefix once and fully reusing it once costs 1.35× its ordinary input cost, compared with 2× for processing it twice without caching. Across ten requests, one write and nine full reads cost 2.15× at that rate, compared with 10× without caching.83For GPT-5.6 and later, cache writes cost 1.25× the standard, uncached input-token rate for the default 30-minute lifetime. In the Responses API, you can choose a [12-hour minimum lifetime](#cache-lifetime) at a write rate of 2.5× ordinary input. Subsequent reads cost 0.1× the ordinary input rate on most of these models and 0.05× on [GPT-6.1 Sol](https://developers.openai.com/api/docs/models/gpt-6.1-sol), regardless of the selected lifetime.

84 

85At the 0.1× read rate with 30-minute writes, writing a prefix once and fully reusing it once costs 1.35× its ordinary input cost, compared with 2× for processing it twice without caching. Across ten requests, one write and nine full reads cost 2.15× at that rate, compared with 10× without caching.

84 86 

85Both implicit and explicit caching are supported, where explicit caching gives you more control over which context is written to cache.87Both implicit and explicit caching are supported, where explicit caching gives you more control over which context is written to cache.

86 88 


135 137 

136## Cache lifetime138## Cache lifetime

137 139 

138Cache entries are not stored indefinitely. A later request can reuse a cached prefix only while its entry remains available, and reusing the prefix refreshes its lifetime without another cache-write charge. The lifetime and retention settings [depend on the model](#summary-of-model-differences).140Cache entries are not stored indefinitely. The minimum cache lifetime, retention settings, and behavior when a request reuses a prefix [depend on the model](#summary-of-model-differences).

139 141 

140<a id="prompt-cache-retention"></a>142<a id="prompt-cache-retention"></a>

141 143 


149 151 

150 152 

151 153 

152Use `prompt_cache_options.ttl` to control the minimum cache lifetime. The only supported value, `30m`, is also the default. A cached prefix remains eligible for reuse for 30 minutes after its most recent write or reuse, though OpenAI may retain it longer.154In the Responses API, set `prompt_cache_options.ttl` to choose the minimum cache lifetime:

155 

156| Value | Minimum lifetime | Cache-write rate | When to use it |

157| ----------------- | ---------------- | ----------------------------------- | -------------------------------------------------------------------- |

158| `"30m"` (default) | 30 minutes | 1.25× the uncached input-token rate | Conversations and agent steps that reuse context frequently. |

159| `"12h"` | 12 hours | 2.5× the uncached input-token rate | Stable instructions or reference material reused across longer gaps. |

160 

161These are total write rates, not surcharges on top of ordinary input. Cache-read rates are the same for both lifetimes. OpenAI may retain entries longer than the requested minimum; `"12h"` does not set a deletion deadline or change the [maximum data-retention policy](https://developers.openai.com/api/docs/guides/your-data#storage-requirements-and-retention-controls-per-endpoint).

162 

163The request-level `ttl` applies to the implicit breakpoint and to explicit breakpoints without their own `ttl`. Set `prompt_cache_breakpoint.ttl` to override it for an individual explicit breakpoint. Omitting both settings preserves the default `"30m"` behavior. Unsupported values return `400 invalid_request_error`. These settings do not change the older-model `prompt_cache_retention` parameter.

164 

165**Mix lifetimes in one request**

166 

167Keep material reused throughout the day at the start of the prompt and give its breakpoint a `"12h"` lifetime. Use `"30m"` for session context that changes more frequently. This example sets a 30-minute request default and overrides it for the shared prefix. Explicit-only mode leaves the current question after the last breakpoint, so that content does not incur a cache-write charge.

168 

169Responses API request with 12-hour and 30-minute breakpoints

170 

171```json

172{

173 "model": "gpt-6.1-sol",

174 "prompt_cache_options": { "mode": "explicit", "ttl": "30m" },

175 "input": [

176 {

177 "role": "developer",

178 "content": [

179 {

180 "type": "input_text",

181 "text": "Shared instructions and reference material reused throughout the day...",

182 "prompt_cache_breakpoint": { "mode": "explicit", "ttl": "12h" }

183 }

184 ]

185 },

186 {

187 "role": "user",

188 "content": [

189 {

190 "type": "input_text",

191 "text": "Session context reused over the next few minutes...",

192 "prompt_cache_breakpoint": { "mode": "explicit" }

193 },

194 {

195 "type": "input_text",

196 "text": "The current question, which does not need a cache write..."

197 }

198 ]

199 }

200 ]

201}

202```

203 

204 

205Replace the placeholder text with your content. Each prefix you want to cache must meet the model's [minimum cacheable length](#summary-of-model-differences).

206 

207**Overlapping writes and lifetime changes**

208 

209A breakpoint covers the entire prefix before it. Within one request, each token is billed once at the longest lifetime of the selected writes covering it. A later 12-hour write also gives earlier selected breakpoints within that prefix 12-hour coverage.

210 

211These examples assume any existing cached prefix matches an [eligible lookup boundary](#how-prefix-matching-works) in the new request.

212 

213| Cache state before the request | Selected breakpoints | Billed reads | Billed 30-minute writes | Billed 12-hour writes |

214| --------------------------------------------- | ---------------------------------------------- | ------------ | ----------------------- | --------------------- |

215| No cached prefix | `"12h"` at 2,000 tokens, then `"30m"` at 5,000 | 0 | 3,000 | 2,000 |

216| No cached prefix | `"30m"` at 2,000 tokens, then `"12h"` at 5,000 | 0 | 0 | 5,000 |

217| Valid 30-minute coverage through 2,000 tokens | `"12h"` at 5,000 | 0 | 0 | 5,000 |

218| Valid 12-hour coverage through 2,000 tokens | `"30m"` at 5,000 | 2,000 | 3,000 | 0 |

219 

220Upgrading valid 30-minute coverage to 12 hours charges a new 12-hour write for those tokens, without credit for the earlier write. Any portion already covered by a valid 12-hour entry remains a cache read.

221 

222A 30-minute read refreshes coverage to at least 30 minutes after that read. If it uses an entry with valid 12-hour coverage, it preserves the later of the existing expiry and 30 minutes after the read. It does not restart a 12-hour clock or incur another write charge.

223 

224The minimum lifetime governs eligibility for cache-read pricing. It does not guarantee that every request reuses stored KV tensors or has lower latency.

153 225 

154 226 

155 227 


228## Summary of model differences300## Summary of model differences

229 301 

230| Behavior | GPT-5.6 and later | GPT-5.5 and GPT-5.5 Pro | Other earlier models |302| Behavior | GPT-5.6 and later | GPT-5.5 and GPT-5.5 Pro | Other earlier models |

231| -------------------------- | --------------------------------------------------- | ----------------------------------------------------------- | ------------------------------------------------------------------------------- |303| -------------------------- | ----------------------------------------------------------------------------------- | ----------------------------------------------------------- | ------------------------------------------------------------------------------- |

232| Implicit breakpoints | At the end of the latest eligible message. | Spaced at regular 2,048-token intervals. | Spaced at regular, model-dependent intervals. |304| Implicit breakpoints | At the end of the latest eligible message. | Spaced at regular 2,048-token intervals. | Spaced at regular, model-dependent intervals. |

233| Explicit breakpoints | Supported | Not supported | Not supported |305| Explicit breakpoints | Supported | Not supported | Not supported |

234| `prompt_cache_key` | Optional for separate cache accounting | Use a stable key to optimize cache routing | Use a stable key to optimize cache routing |306| `prompt_cache_key` | Optional for separate cache accounting | Use a stable key to optimize cache routing | Use a stable key to optimize cache routing |

235| Minimum cacheable prefix | 1,024 visible input tokens | Varies by request settings | Varies by request settings |307| Minimum cacheable prefix | 1,024 visible input tokens | Varies by request settings | Varies by request settings |

236| Cached-token reporting | Exact eligible boundary, excluding hidden tokens | Excludes hidden tokens and rounds down to a multiple of 128 | Excludes hidden tokens and rounds down to a multiple of 128 |308| Cached-token reporting | Exact eligible boundary, excluding hidden tokens | Excludes hidden tokens and rounds down to a multiple of 128 | Excludes hidden tokens and rounds down to a multiple of 128 |

237| Cache read charge | 0.1× uncached input (0.05× for GPT-6.1 Sol) | Model-dependent cached-input rate | Model-dependent cached-input rate |309| Cache read charge | 0.1× uncached input (0.05× for GPT-6.1 Sol) | Model-dependent cached-input rate | Model-dependent cached-input rate |

238| Cache write charge | 1.25× the uncached input-token rate | No additional cache-write charge | No additional cache-write charge |310| Cache write charge | 1.25× for `"30m"`; 2.5× for `"12h"` in the Responses API | No additional cache-write charge | No additional cache-write charge |

239| Cache lifetime control | `prompt_cache_options.ttl` | `prompt_cache_retention` | `prompt_cache_retention` |311| Cache lifetime control | `prompt_cache_options.ttl` | `prompt_cache_retention` | `prompt_cache_retention` |

240| Supported retention values | `"30m"` | `"24h"` only | `"in_memory"` or `"24h"`<sup>[\*](#extended-retention-models)</sup> |312| Supported retention values | `"30m"` (default), or `"12h"` in the Responses API | `"24h"` only | `"in_memory"` or `"24h"`<sup>[\*](#extended-retention-models)</sup> |

241| Cache lifetime | At least 30 minutes after the latest write or reuse | Typically around 30 minutes, up to 24 hours | Typically 5 to 10 minutes inactive for `in_memory`, or up to 24 hours for `24h` |313| Cache lifetime | Minimum lifetime of 30 minutes or 12 hours; see [refresh behavior](#cache-lifetime) | Typically around 30 minutes, up to 24 hours | Typically 5 to 10 minutes inactive for `in_memory`, or up to 24 hours for `24h` |

242 314 

243<a id="extended-retention-models"></a>315<a id="extended-retention-models"></a>

244 316 


450```522```

451 523 

452 524 

453Note: Tokens written to the cache during a prewarm request are billed at the standard cache-write rate.525Tokens written to the cache during a prewarm request are billed at the [cache-write rate for the selected lifetime](#cache-lifetime).

454 526 

455 527 

456 528 


496 568 

497 569 

498 570 

571For Responses API models that support `prompt_cache_options`, use `"30m"` for frequently reused context and consider `"12h"` for stable prefixes reused across longer gaps. Compare the higher 12-hour write rate with the cost of rewriting the prefix after 30-minute coverage expires. Use breakpoint overrides to give shared material a longer lifetime than session-specific context. See [Cache lifetime](#cache-lifetime) for examples and billing rules.

572 

499For earlier models, prefer setting `prompt_cache_retention` to `"24h"` for extended retention when the model and your data-retention requirements allow it. See [Cache lifetime](#cache-lifetime) for supported settings and defaults.573For earlier models, prefer setting `prompt_cache_retention` to `"24h"` for extended retention when the model and your data-retention requirements allow it. See [Cache lifetime](#cache-lifetime) for supported settings and defaults.

500 574 

501 575 


516 590 

517If many requests reuse the same developer instructions and tool definitions, but that shared prefix falls below the model's [minimum cacheable length](#summary-of-model-differences), consider shortening it or expanding it with useful, stable instructions, examples, or reference material. Measure whether cache reuse offsets the additional input tokens and any cache-write charges, and ensure evaluations and behaviour remain stable.591If many requests reuse the same developer instructions and tool definitions, but that shared prefix falls below the model's [minimum cacheable length](#summary-of-model-differences), consider shortening it or expanding it with useful, stable instructions, examples, or reference material. Measure whether cache reuse offsets the additional input tokens and any cache-write charges, and ensure evaluations and behaviour remain stable.

518 592 

519The chart highlights the minimum cacheable length cost trap where short prefix lengths can cost more uncached than expanding to the minimum cacheable token length.593The chart highlights the minimum cacheable length cost trap where short prefix lengths can cost more uncached than expanding to the minimum cacheable token length. It uses the 30-minute cache-write rate for GPT-5.6 and later.

520 594 

521<a id="mathematical-details"></a>595<a id="mathematical-details"></a>

522 596 


534 608 

535Expand when $$L > L_{\mathrm{break\text{-}even}}$$; keeping the shorter prefix costs less when $$L < L_{\mathrm{break\text{-}even}}$$. At equality, the costs are the same. The smallest whole-token length for which expansion is cheaper is $$\left\lfloor L_{\mathrm{break\text{-}even}} \right\rfloor + 1$$. Conversely, shrinking a cacheable prefix below $$M$$ loses caching: under the same assumptions, the shorter uncached prefix must fall below $$L_{\mathrm{break\text{-}even}}$$ to cost less than caching $$M$$ tokens. There is no universal maximum-cost prompt length; the crossover depends on reuse and pricing.609Expand when $$L > L_{\mathrm{break\text{-}even}}$$; keeping the shorter prefix costs less when $$L < L_{\mathrm{break\text{-}even}}$$. At equality, the costs are the same. The smallest whole-token length for which expansion is cheaper is $$\left\lfloor L_{\mathrm{break\text{-}even}} \right\rfloor + 1$$. Conversely, shrinking a cacheable prefix below $$M$$ loses caching: under the same assumptions, the shorter uncached prefix must fall below $$L_{\mathrm{break\text{-}even}}$$ to cost less than caching $$M$$ tokens. There is no universal maximum-cost prompt length; the crossover depends on reuse and pricing.

536 610 

537For example, using the usual cache-read rate with $$M = 1{,}024$$, $$r = 0.1$$, and $$w = 1.25$$, the crossover is $$102.4 + \frac{1{,}177.6}{N}$$ tokens. Across 10 requests, expanding an original prefix of at least 221 tokens to 1,024 tokens is cheaper. As reuse grows, the crossover approaches 102.4 tokens. A 103-token prefix needs at least 1,963 total requests to benefit; a prefix of 102 tokens or fewer never does under these assumptions. This comparison excludes performance, output tokens, and unchanged request costs. Additional misses, writes, or different model rates change the result.611For example, using the usual cache-read rate and 30-minute writes with $$M = 1{,}024$$, $$r = 0.1$$, and $$w = 1.25$$, the crossover is $$102.4 + \frac{1{,}177.6}{N}$$ tokens. Across 10 requests, expanding an original prefix of at least 221 tokens to 1,024 tokens is cheaper. As reuse grows, the crossover approaches 102.4 tokens. A 103-token prefix needs at least 1,963 total requests to benefit; a prefix of 102 tokens or fewer never does under these assumptions. This comparison excludes performance, output tokens, and unchanged request costs. Additional misses, writes, or different model rates change the result.

538 612 

539 613 

540 614 


554 628 

555 629 

556 630 

557- **Measure actual cache performance.** Track `usage.input_tokens_details.cached_tokens`, `usage.input_tokens_details.cache_write_tokens`, input-token counts, latency, and realized cost. Track the token cache-hit rate by dividing total cached tokens by total input tokens, aggregating both counts by user, workspace, day, or another useful grouping.631- **Measure actual cache performance.** Track `usage.input_tokens_details.cached_tokens`, `usage.input_tokens_details.cache_write_tokens`, the write counts by lifetime, input-token counts, latency, and realized cost. Track the token cache-hit rate by dividing total cached tokens by total input tokens, aggregating both counts by user, workspace, day, or another useful grouping.

558- **Calculate input cost.** Use the token counts in `response.usage` and the model's [prices per million tokens](https://developers.openai.com/api/docs/pricing).632- **Calculate input cost.** Use the token counts in `response.usage` and the model's [prices per million tokens](https://developers.openai.com/api/docs/pricing).

559- **Use the prompt caching dashboard.** Monitor cache hit rates in the [Prompt Caching Dashboard](https://platform.openai.com/usage?usage_section=prompt-caching).633- **Use the prompt caching dashboard.** Monitor cache hit rates in the [Prompt Caching Dashboard](https://platform.openai.com/usage?usage_section=prompt-caching).

560 634 

561Calculate input cost635For Responses API models that support `prompt_cache_options`, `input_tokens_details.cache_write_tokens_details` breaks writes into `ttl_30m_tokens` and `ttl_12h_tokens`. These counts do not overlap and sum to `cache_write_tokens`. Both fields are returned, including when one is zero. `cached_tokens` counts billed reads and excludes tokens charged as writes, including upgrades from 30-minute to 12-hour coverage.

636 

637Input usage fields with both write lifetimes

638 

639```json

640{

641 "usage": {

642 "input_tokens": 12000,

643 "input_tokens_details": {

644 "cached_tokens": 4000,

645 "cache_write_tokens": 7000,

646 "cache_write_tokens_details": {

647 "ttl_30m_tokens": 3000,

648 "ttl_12h_tokens": 4000

649 }

650 }

651 }

652}

653```

654 

655 

656In this usage example, 1,000 input tokens are ordinary input: `12000 - 4000 - 7000`. To calculate input cost, multiply ordinary input tokens by the model's input price, `cached_tokens` by its cached-input price, `ttl_30m_tokens` by 1.25× its input price, and `ttl_12h_tokens` by 2.5× its input price. Add these amounts and divide by 1,000,000 when using prices per million tokens. Do not add `cache_write_tokens` again after counting its two components.

657 

658For example, at an input price of $1 per million tokens and a cached-input price of $0.10 per million, this usage costs `(1000 + 4000 × 0.1 + 3000 × 1.25 + 4000 × 2.5) / 1000000 = $0.01515` for input. Use your model's actual rates, including its cached-input rate.

659 

660The following helper uses one cache-write multiplier for all writes. Use `1.25` when all writes have a 30-minute lifetime, or `2.5` when all have a 12-hour lifetime. For requests with both lifetimes, calculate each write component separately as described here.

661 

662Calculate input cost with one cache-write rate

562 663 

563```javascript664```javascript

564function calculateInputCost(665function calculateInputCost(

Details

2670 "schema_definition": {2670 "schema_definition": {

2671 "type": "object",2671 "type": "object",

2672 "properties": {2672 "properties": {

2673 "description": {

2674 "type": "string"

2675 },

2673 "type": {2676 "type": {

2674 "type": "string",2677 "type": "string",

2675 "enum": [2678 "enum": [


4311 "schema_definition": {4314 "schema_definition": {

4312 "type": "object",4315 "type": "object",

4313 "properties": {4316 "properties": {

4317 "description": {

4318 "type": "string"

4319 },

4314 "type": {4320 "type": {

4315 "type": "string",4321 "type": "string",

4316 "enum": [4322 "enum": [

Details

1553 1553 

1554 1554

1555 1555 

1556OpenAI o-series models are able to implement complex algorithms and produce code. This prompt asks o1 to refactor a React component based on some specific criteria.1556Reasoning models can implement complex algorithms and produce code. This prompt asks the model to refactor a React component based on specific criteria.

1557 1557 

1558 1558 

1559 1559 


1796 1796 

1797 1797

1798 1798 

1799OpenAI o-series models are also adept in creating multi-step plans. This example prompt asks o1 to create a filesystem structure for a full solution, along with Python code that implements the desired use case.1799Reasoning models can also create multi-step plans. This example prompt asks the model to create a filesystem structure for a full solution, along with Python code that implements the desired use case.

1800 1800 

1801 1801 

1802 1802 

Details

5Reinforcement fine-tuning (RFT) adapts an OpenAI reasoning model with a feedback signal you define. Like [supervised fine-tuning](https://developers.openai.com/api/docs/guides/supervised-fine-tuning), it tailors the model to your task. The difference is that instead of training on fixed “correct” answers, it relies on a programmable grader that scores every candidate response. The training algorithm then shifts the model’s weights, so high-scoring outputs become more likely and low-scoring ones fade.5Reinforcement fine-tuning (RFT) adapts an OpenAI reasoning model with a feedback signal you define. Like [supervised fine-tuning](https://developers.openai.com/api/docs/guides/supervised-fine-tuning), it tailors the model to your task. The difference is that instead of training on fixed “correct” answers, it relies on a programmable grader that scores every candidate response. The training algorithm then shifts the model’s weights, so high-scoring outputs become more likely and low-scoring ones fade.

6 6 

7OpenAI is winding down the fine-tuning platform. The platform is no longer7OpenAI is winding down the fine-tuning platform. The platform is no longer

8 accessible to new users, but existing users of the fine-tuning platform will8 accessible to new users. Eligible existing customers can create training jobs

9 be able to create training jobs for the coming months.9 until January 6, 2027, unless the base model shuts down earlier.

10 10

11 11 

12 All fine-tuned models will remain available for inference until their base12 Fine-tuned models remain available for inference until their base model shuts

13 models are [deprecated](https://developers.openai.com/api/docs/deprecations). The full timeline is13 down. The `o4-mini-2025-04-16` base model and its fine-tuned versions shut

14 [here](https://developers.openai.com/api/docs/deprecations).14 down on [October 23,

15 2026](https://developers.openai.com/api/docs/deprecations#2026-04-22-legacy-gpt-model-snapshots). See the

16 [fine-tuning availability

17 timeline](https://developers.openai.com/api/docs/deprecations#update-to-openais-self-serve-fine-tuning).

15 18 

16 19 

17 20 

Details

4 4 

5Use file transcription when you have a completed recording or a bounded audio request. Upload the audio and receive a final transcript, or stream text while the model processes the file.5Use file transcription when you have a completed recording or a bounded audio request. Upload the audio and receive a final transcript, or stream text while the model processes the file.

6 6 

7Start with [`gpt-transcribe`](https://developers.openai.com/api/docs/models/gpt-transcribe). This is the recommended model for transcribing recorded speech in its original language. Use a specialized model only if you need speaker labels, word timestamps, subtitle formats, or translation into English.7Start with [`gpt-transcribe`](https://developers.openai.com/api/docs/models/gpt-transcribe). This is the recommended model for transcribing recorded speech in its original language. The specialized examples for speaker labels, word timestamps, and subtitle formats below use deprecated models.

8 

9`whisper-1`, `gpt-4o-transcribe`, `gpt-4o-mini-transcribe`,

10 `gpt-4o-transcribe-diarize`, and `/v1/audio/translations` are deprecated and

11 will shut down on **February 26, 2027**. See the [deprecation

12 notice](https://developers.openai.com/api/docs/deprecations#2026-08-26-transcription-models) and [choose a

13 current transcription workflow](https://developers.openai.com/api/docs/guides/transcription). The

14 specialized examples below document compatibility for existing integrations

15 until shutdown.

8 16 

9Files can be up to 25 MB. Supported input formats are `mp3`, `mp4`, `mpeg`, `mpga`, `m4a`, `wav`, and `webm`.17Files can be up to 25 MB. Supported input formats are `mp3`, `mp4`, `mpeg`, `mpga`, `m4a`, `wav`, and `webm`.

10 18 


305 313 

306## Speaker diarization314## Speaker diarization

307 315 

308Use `gpt-4o-transcribe-diarize` only when you need to identify who speaks during different parts of a recording. This specialized speaker-labeling model isn't the recommended model for ordinary file transcription.316Existing integrations can use the deprecated `gpt-4o-transcribe-diarize` model to identify who speaks during different parts of a recording until February 26, 2027. This specialized speaker-labeling model isn't the recommended model for ordinary file transcription.

309 317 

310Request the `diarized_json` response format to receive segments with `speaker`, `start`, and `end` metadata. For audio longer than 30 seconds, set `chunking_strategy` to `"auto"` or a voice activity detection configuration.318Request the `diarized_json` response format to receive segments with `speaker`, `start`, and `end` metadata. For audio longer than 30 seconds, set `chunking_strategy` to `"auto"` or a voice activity detection configuration.

311 319 


527 535 

528## Translations536## Translations

529 537 

530To translate a completed audio recording into English, use `/v1/audio/translations` with `whisper-1`. Unlike transcription, which preserves the recording's original language, this endpoint returns English text.538The deprecated `/v1/audio/translations` endpoint uses `whisper-1` to translate a completed audio recording into English. It remains available until February 26, 2027. Unlike transcription, which preserves the recording's original language, this endpoint returns English text only.

531 

532Translate audio

533 

534```javascript

535import fs from "fs";

536import OpenAI from "openai";

537 

538const openai = new OpenAI();

539 

540const translation = await openai.audio.translations.create({

541 file: fs.createReadStream("fixtures/german.wav"),

542 model: "whisper-1",

543});

544 

545console.log(translation.text);

546```

547 

548```python

549from openai import OpenAI

550 

551client = OpenAI()

552audio_file = open("german.wav", "rb")

553 

554translation = client.audio.translations.create(

555 model="whisper-1",

556 file=audio_file,

557)

558 

559print(translation.text)

560```

561 

562```go

563package main

564 

565import (

566 "context"

567 "fmt"

568 "os"

569 

570 "github.com/openai/openai-go/v3"

571)

572 

573func main() {

574 file, err := os.Open("fixtures/german.wav")

575 if err != nil {

576 panic(err)

577 }

578 defer file.Close()

579 

580 client := openai.NewClient()

581 translation, err := client.Audio.Translations.New(context.Background(), openai.AudioTranslationNewParams{

582 File: file,

583 Model: openai.AudioModelWhisper1,

584 })

585 if err != nil {

586 panic(err)

587 }

588 fmt.Println(translation.Text)

589}

590```

591 

592```java

593import com.openai.client.OpenAIClient;

594import com.openai.client.okhttp.OpenAIOkHttpClient;

595import com.openai.models.audio.translations.TranslationCreateParams;

596import java.nio.file.Path;

597 

598var result =

599 client

600 .audio()

601 .translations()

602 .create(

603 TranslationCreateParams.builder()

604 .file(Path.of(System.getenv("OPENAI_EXAMPLE_AUDIO_PATH")))

605 .model("whisper-1")

606 .build());

607 

608System.out.println(result.asTranslation().text());

609```

610 

611```csharp

612using OpenAI.Audio;

613 

614string key = Environment.GetEnvironmentVariable("OPENAI_API_KEY")!;

615AudioClient client = new("whisper-1", key);

616 

617await using FileStream audio = File.OpenRead("german.wav");

618AudioTranslation translation = await client.TranslateAudioAsync(

619 audio,

620 "german.wav"

621);

622 

623Console.WriteLine(translation.Text);

624```

625 

626```ruby

627require "openai"

628require "pathname"

629 

630client = OpenAI::Client.new

631audio = Pathname("german.wav")

632translation = client.audio.translations.create(file: audio, model: "whisper-1")

633raise "Expected a JSON translation response" if translation.is_a?(StringIO)

634 

635puts(translation.text)

636```

637 

638```bash

639curl --request POST \

640 --url https://api.openai.com/v1/audio/translations \

641 --header "Authorization: Bearer $OPENAI_API_KEY" \

642 --header 'Content-Type: multipart/form-data' \

643 --form file=@/path/to/file/german.mp3 \

644 --form model=whisper-1 \

645```

646 

647 

648For an audio recording in another language, the response contains the English translation:

649 

650```example-content

651Hello, my name is Wolfgang and I come from Germany. Where are you heading today?

652```

653 539 

654This endpoint supports translation into English only.540Migrate to [Realtime translation](https://developers.openai.com/api/docs/guides/realtime-translation) with `gpt-realtime-translate` at `/v1/realtime/translations`. This requires a translation session, streamed audio input, and translation events. Changing only the model ID in a `/v1/audio/translations` request doesn't migrate it.

655 541 

656## Supported languages542## Supported languages

657 543 


667 553 

668## Timestamps554## Timestamps

669 555 

670Use `whisper-1` when you need word or segment timestamps. The [`timestamp_granularities[]` parameter](/api/docs/api-reference/audio/createTranscription#audio-createtranscription-timestamp_granularities) returns structured timestamp data for captioning and video editing.556Existing integrations can use the deprecated `whisper-1` model for word or segment timestamps until February 26, 2027. The [`timestamp_granularities[]` parameter](/api/docs/api-reference/audio/createTranscription#audio-createtranscription-timestamp_granularities) returns structured timestamp data for captioning and video editing.

671 557 

672Timestamp options558Timestamp options

673 559 

Details

5Supervised fine-tuning (SFT) lets you train an OpenAI model with examples for your specific use case. The result is a customized model that more reliably produces your desired style and content.5Supervised fine-tuning (SFT) lets you train an OpenAI model with examples for your specific use case. The result is a customized model that more reliably produces your desired style and content.

6 6 

7OpenAI is winding down the fine-tuning platform. The platform is no longer7OpenAI is winding down the fine-tuning platform. The platform is no longer

8 accessible to new users, but existing users of the fine-tuning platform will8 accessible to new users. Eligible existing customers can create training jobs

9 be able to create training jobs for the coming months.9 until January 6, 2027, unless the base model shuts down earlier.

10 10

11 11 

12 All fine-tuned models will remain available for inference until their base12 Fine-tuned models remain available for inference until their base model shuts

13 models are [deprecated](https://developers.openai.com/api/docs/deprecations). The full timeline is13 down. `gpt-4.1-nano-2025-04-14` and its fine-tuned versions shut down on

14 [here](https://developers.openai.com/api/docs/deprecations).14 [October 23,

15 2026](https://developers.openai.com/api/docs/deprecations#2026-04-22-legacy-gpt-model-snapshots).

16 `gpt-4.1-2025-04-14`, `gpt-4.1-mini-2025-04-14`, and their fine-tuned versions

17 shut down on [January 14,

18 2027](https://developers.openai.com/api/docs/deprecations#2026-10-14-gpt-4-series-model-deprecations). See

19 the [fine-tuning availability

20 timeline](https://developers.openai.com/api/docs/deprecations#update-to-openais-self-serve-fine-tuning).

15 21 

16 22 

17 23 

Details

2 2 

3> For the complete documentation index, see [llms.txt](/llms.txt). Markdown versions of documentation pages are available by appending `.md` to the page URL.3> For the complete documentation index, see [llms.txt](/llms.txt). Markdown versions of documentation pages are available by appending `.md` to the page URL.

4 4 

5The `tts-1`, `tts-1-hd`, and `gpt-4o-mini-tts` models are deprecated and will

6 shut down on **January 6, 2027**. Migrate to `gpt-realtime-2.1-mini` using the

7 [Realtime API](https://developers.openai.com/api/docs/guides/realtime). This is a change of API workflow:

8 `gpt-realtime-2.1-mini` isn't a supported model for `/v1/audio/speech`.

9 Existing integrations can use the Speech API workflows shown below until

10 shutdown. See the [deprecation

11 notice](https://developers.openai.com/api/docs/deprecations#2026-10-01-text-to-speech-models).

12 

5The Audio API provides a [`speech`](https://developers.openai.com/api/reference/resources/audio/subresources/speech/methods/create) endpoint based on our [GPT-4o mini TTS (text-to-speech) model](https://developers.openai.com/api/docs/models/gpt-4o-mini-tts). It comes with 11 built-in voices and can be used to:13The Audio API provides a [`speech`](https://developers.openai.com/api/reference/resources/audio/subresources/speech/methods/create) endpoint based on our [GPT-4o mini TTS (text-to-speech) model](https://developers.openai.com/api/docs/models/gpt-4o-mini-tts). It comes with 11 built-in voices and can be used to:

6 14 

7- Narrate a written blog post15- Narrate a written blog post


221. The [text](https://developers.openai.com/api/reference/resources/audio/subresources/speech/methods/create#audio-createspeech-input) to be turned into audio301. The [text](https://developers.openai.com/api/reference/resources/audio/subresources/speech/methods/create#audio-createspeech-input) to be turned into audio

231. The [voice](https://developers.openai.com/api/reference/resources/audio/subresources/speech/methods/create#audio-createspeech-voice) that will speak the output311. The [voice](https://developers.openai.com/api/reference/resources/audio/subresources/speech/methods/create#audio-createspeech-voice) that will speak the output

24 32 

25Here's a simple request example:33Here's an example request:

26 34 

27Generate spoken audio from input text35Generate spoken audio from input text

28 36 


183 191 

184### Text-to-speech models192### Text-to-speech models

185 193 

186For intelligent realtime applications, use the `gpt-4o-mini-tts` model, our newest and most reliable text-to-speech model. You can prompt the model to control aspects of speech, including:194For existing Speech API integrations, `gpt-4o-mini-tts` lets you use prompts to control these aspects of speech:

187 195 

188- Accent196- Accent

189- Emotional range197- Emotional range

Details

76```76```

77 77 

78 78 

79### Wait for an uploaded version

80 

81A request for a newly uploaded version can briefly return `404` before it is available. Before attaching it to a container or Live session, retrieve it with `GET /v1/skills/{skill_id}/versions/{version}`. If the retrieval request returns `404` immediately after a successful upload, retry with a short backoff and a timeout. Once retrieval succeeds, use the returned version string in the Skill reference.

82 

79## Use skills with hosted shell83## Use skills with hosted shell

80 84 

81To mount skills in a hosted shell environment, attach them via `tools[].environment.skills` when calling the shell tool.85To mount skills in a hosted shell environment, attach them via `tools[].environment.skills` when calling the shell tool.


95 "type": "container_auto",99 "type": "container_auto",

96 "skills": [100 "skills": [

97 { "type": "skill_reference", "skill_id": "<skill_id>" },101 { "type": "skill_reference", "skill_id": "<skill_id>" },

98 { "type": "skill_reference", "skill_id": "<skill_id>", "version": 2 }102 { "type": "skill_reference", "skill_id": "<skill_id>", "version": "2" }

99 ]103 ]

100 }104 }

101 }105 }


143 {147 {

144 "type": "skill_reference",148 "type": "skill_reference",

145 "skill_id": "<skill_id>",149 "skill_id": "<skill_id>",

146 "version": 2,150 "version": "2",

147 },151 },

148 ],152 ],

149 },153 },


532 536 

533## Safety with network access537## Safety with network access

534 538 

535It is very important to inspect any Skill used with the Responses API. Skills539Inspect any Skill used with the Responses API. Skills introduce security risks

536 introduce security risks such as prompt injection-driven data exfiltration.540 such as prompt injection-driven data exfiltration. Carefully review the [Risks

537 Carefully review the [Risks and safety](#risks-and-safety) section below541 and safety](#risks-and-safety) section below before using this tool.

538 before using this tool.

539 542 

540## Versioning and management543## Versioning and management

541 544 


543 546 

544- `default_version` is used when a version isn't provided.547- `default_version` is used when a version isn't provided.

545- `latest_version` tracks the newest upload.548- `latest_version` tracks the newest upload.

546- `skill_reference.version` accepts an integer or `"latest"`.549- `skill_reference.version` accepts a version string, such as `"2"` or `"latest"`.

550- `default_version` also requires a string when you update it.

547 551 

548### Create a new version552### Create a new version

549 553 


564curl -X POST 'https://api.openai.com/v1/skills/<skill_id>' \568curl -X POST 'https://api.openai.com/v1/skills/<skill_id>' \

565 -H "Content-Type: application/json" \569 -H "Content-Type: application/json" \

566 -H "Authorization: Bearer $OPENAI_API_KEY" \570 -H "Authorization: Bearer $OPENAI_API_KEY" \

567 -d '{"default_version": 2}'571 -d '{"default_version": "2"}'

568```572```

569 573 

570 574 

Details

47 47 

48## Choose a specialized capability48## Choose a specialized capability

49 49 

50Start with the recommended model for your workflow. Switch models only when your application requires a capability that the default doesn't provide.50Start with the recommended model for your workflow:

51 51 

52| If you need | Use |52| If you need | Use |

53| ------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- |53| ------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- |

54| Detected input languages | `gpt-transcribe` with [file transcription](https://developers.openai.com/api/docs/guides/speech-to-text). |

55| Committed-turn transcription over WebSocket | `gpt-transcribe` with [realtime transcription](https://developers.openai.com/api/docs/guides/realtime-transcription#transcribe-a-committed-turn). |

56 

57Existing integrations can also use [`gpt-realtime-whisper`](https://developers.openai.com/api/docs/models/gpt-realtime-whisper) where supported. It isn't the recommended starting model for a new transcription integration.

58 

59## Existing integrations with deprecated models

60 

61`whisper-1`, `gpt-4o-transcribe`, `gpt-4o-mini-transcribe`,

62 `gpt-4o-transcribe-diarize`, and `/v1/audio/translations` are deprecated and

63 will shut down on **February 26, 2027**. See the [deprecation

64 notice](https://developers.openai.com/api/docs/deprecations#2026-08-26-transcription-models). For new

65 integrations, use the recommended file or realtime transcription workflow

66 above.

67 

68Existing integrations can use the workflows in these specialized examples until the shutdown date. Check the output formats and metadata your application needs before migrating; changing only the model ID doesn't preserve every capability.

69 

70| If you need | Use |

71| ------------------------------------------------- | ----------------------------------------------------------------------------------------------------------- |

54| Speaker-labeled transcripts | `gpt-4o-transcribe-diarize` with [file transcription](https://developers.openai.com/api/docs/guides/speech-to-text#speaker-diarization). |72| Speaker-labeled transcripts | `gpt-4o-transcribe-diarize` with [file transcription](https://developers.openai.com/api/docs/guides/speech-to-text#speaker-diarization). |

55| Word timestamps or `srt` and `vtt` subtitles | `whisper-1` with [file transcription](https://developers.openai.com/api/docs/guides/speech-to-text#timestamps). |73| Word timestamps or `srt` and `vtt` subtitles | `whisper-1` with [file transcription](https://developers.openai.com/api/docs/guides/speech-to-text#timestamps). |

56| Translation of a completed recording into English | `whisper-1` with the [audio translations endpoint](https://developers.openai.com/api/docs/guides/speech-to-text#translations). |74| Translation of a completed recording into English | `whisper-1` with the [audio translations endpoint](https://developers.openai.com/api/docs/guides/speech-to-text#translations). |

57| Detected input languages | `gpt-transcribe` with [file transcription](https://developers.openai.com/api/docs/guides/speech-to-text). |

58| Committed-turn transcription over WebSocket | `gpt-transcribe` with [realtime transcription](https://developers.openai.com/api/docs/guides/realtime-transcription#transcribe-a-committed-turn). |

59 75 

60Existing integrations can continue to use [`gpt-4o-transcribe`](https://developers.openai.com/api/docs/models/gpt-4o-transcribe), [`gpt-4o-mini-transcribe`](https://developers.openai.com/api/docs/models/gpt-4o-mini-transcribe), or [`gpt-realtime-whisper`](https://developers.openai.com/api/docs/models/gpt-realtime-whisper) where supported. These aren't the recommended starting models for a new transcription integration.76For translation, migrate to [Realtime translation](https://developers.openai.com/api/docs/guides/realtime-translation). It uses a translation session and a different endpoint instead of the file-upload workflow used by `/v1/audio/translations`.

61 77 

62See [transcription pricing](https://developers.openai.com/api/docs/pricing#transcription-and-speech) and test the recommended path with representative audio before moving production traffic.78See [transcription pricing](https://developers.openai.com/api/docs/pricing#transcription-and-speech) and test the recommended path with representative audio before moving production traffic.

63 79 

Details

263 263 

264## Input transcription costs264## Input transcription costs

265 265 

266Aside from conversational Responses, the Realtime API bills for input transcriptions, if enabled. Input transcription uses a different model than the speech2speech model, such as [`whisper-1`](https://developers.openai.com/api/docs/models/whisper-1) or [`gpt-4o-transcribe`](https://developers.openai.com/api/docs/models/gpt-4o-transcribe), and thus are billed from a different rate card. Transcription is performed when audio is written to the input audio buffer and then committed, either manually or by VAD.266If enabled, input transcription is billed separately by the Realtime API. Input transcription uses a different model and rate card from the speech-to-speech model. Use [`gpt-transcribe`](https://developers.openai.com/api/docs/models/gpt-transcribe) for [committed-turn transcription](https://developers.openai.com/api/docs/guides/realtime-transcription#transcribe-a-committed-turn), which begins after audio is written to the input audio buffer and the buffer is committed.

267 267 

268Input transcription token counts can be read from the `conversation.item.input_audio_transcription.completed` event, as in the following example.268Read input transcription usage from the `conversation.item.input_audio_transcription.completed` event. The usage fields depend on the transcription model: `gpt-transcribe` is billed by audio duration, while models billed by token usage return token counts. For example, duration usage has this shape:

269 269 

270```json270```json

271{271{

272 "type": "conversation.item.input_audio_transcription.completed",272 "type": "conversation.item.input_audio_transcription.completed",

273 ...

274 "transcript": "Hi, can you hear me?",273 "transcript": "Hi, can you hear me?",

275 "usage": {274 "usage": {

276 "type": "tokens",275 "type": "duration",

277 "total_tokens": 26,276 "seconds": 3

278 "input_tokens": 17,

279 "input_token_details": {

280 "text_tokens": 0,

281 "audio_tokens": 17

282 },

283 "output_tokens": 9

284 }277 }

285}278}

286```279```

libraries.md +1 −1

Details

173<dependency>173<dependency>

174 <groupId>com.openai</groupId>174 <groupId>com.openai</groupId>

175 <artifactId>openai-java</artifactId>175 <artifactId>openai-java</artifactId>

176 <version>4.86.0</version>176 <version>4.87.1</version>

177</dependency>177</dependency>

178```178```

179 179 

Details

119 119 

120### Add a local file to the prompt120### Add a local file to the prompt

121 121 

122For a simple local file, build the prompt inline with command substitution:122For a local file, build the prompt inline with command substitution:

123 123 

124```bash124```bash

125openai responses create \125openai responses create \


142 142 

143### Passing request bodies143### Passing request bodies

144 144 

145Use flags for short scalar inputs. Use a YAML heredoc for multiline prompts, tools, files, or nested request bodies. The heredoc can contain the same request fields you would otherwise pass as flags.145Use flags for short scalar inputs. Use a YAML here-document for multiline prompts, tools, files, or nested request bodies. The here-document can contain the same request fields you would otherwise pass as flags.

146 146 

147Be careful with string values that look like YAML, especially prompts that contain `:` or `{}`. On flags, the generated parser may interpret those values as structured YAML instead of plain text. If a prompt starts looking like configuration, put it under `input: |` in a YAML body instead:147Be careful with string values that look like YAML, especially prompts that contain `:` or `{}`. On flags, the generated parser may interpret those values as structured YAML instead of plain text. If a prompt starts looking like configuration, put it under `input: |` in a YAML body instead:

148 148 


413 413 

414## Speech414## Speech

415 415 

416These Speech API examples use the deprecated `gpt-4o-mini-tts` model, which

417 will shut down on **January 6, 2027**. Migrate to `gpt-realtime-2.1-mini`

418 using the [Realtime API](https://developers.openai.com/api/docs/guides/realtime). Changing only the model

419 ID in `openai audio:speech create` isn't supported. See the [deprecation

420 notice](https://developers.openai.com/api/docs/deprecations#2026-10-01-text-to-speech-models).

421 

416Create an MP3 locally with the speech API:422Create an MP3 locally with the speech API:

417 423 

418Command:424Command:


458 464 

459```bash465```bash

460openai audio:transcriptions create \466openai audio:transcriptions create \

461 --model gpt-4o-transcribe \467 --model gpt-transcribe \

462 --file ./speech.mp3 \468 --file ./speech.mp3 \

463 --transform text \469 --transform text \

464 --raw-output470 --raw-output


471The OpenAI CLI can call the API from ordinary shell scripts.477The OpenAI CLI can call the API from ordinary shell scripts.

472```478```

473 479 

474Use the response format that matches the artifact you need:480The example above uses the recommended [file transcription](https://developers.openai.com/api/docs/guides/speech-to-text) model. The following specialized examples remain available for existing integrations:

481 

482`whisper-1` and `gpt-4o-transcribe-diarize` are deprecated and will shut down

483 on **February 26, 2027**. Changing to the recommended transcription model

484 doesn't preserve every output format or metadata field. See the [deprecation

485 notice](https://developers.openai.com/api/docs/deprecations#2026-08-26-transcription-models) and

486 [transcription workflows](https://developers.openai.com/api/docs/guides/transcription).

475 487 

476| Need | Command shape |488| Need | Command shape |

477| --------------------------- | -------------------------------------------------------------------- |489| --------------------------- | -------------------------------------------------------------------- |

478| Plain transcript text | `--model gpt-4o-transcribe --transform text --raw-output` |

479| Subtitle files | `--model whisper-1 --response-format srt` or `--response-format vtt` |490| Subtitle files | `--model whisper-1 --response-format srt` or `--response-format vtt` |

480| Segment or word timestamps | `--model whisper-1 --response-format verbose_json` |491| Segment or word timestamps | `--model whisper-1 --response-format verbose_json` |

481| Speaker-labeled diarization | `--model gpt-4o-transcribe-diarize --response-format diarized_json` |492| Speaker-labeled diarization | `--model gpt-4o-transcribe-diarize --response-format diarized_json` |


552 563 

553### Create a project, service account, and API key564### Create a project, service account, and API key

554 565 

555Creating a service account in that project returns an unredacted API key for the service account.566Creating a service account in that project returns the full API key for the service account.

556 567 

557Command:568Command:

558 569 

quickstart.md +1 −1

Details

190<dependency>190<dependency>

191 <groupId>com.openai</groupId>191 <groupId>com.openai</groupId>

192 <artifactId>openai-java</artifactId>192 <artifactId>openai-java</artifactId>

193 <version>4.86.0</version>193 <version>4.87.1</version>

194</dependency>194</dependency>

195```195```

196 196