diff --git a/openapi.yaml b/openapi.yaml index 4794d451..01ec62ad 100644 --- a/openapi.yaml +++ b/openapi.yaml @@ -19,7 +19,8 @@ tags: - name: Audio description: Turn audio into text or text into audio. - name: Chat - description: Given a list of messages comprising a conversation, the model will + description: + Given a list of messages comprising a conversation, the model will return a response. - name: Completions description: Given a prompt, the model will return one or more predicted @@ -33,7 +34,8 @@ tags: - name: Batch description: Create large batches of API requests to run asynchronously. - name: Files - description: Files are used to upload documents that can be used with features + description: + Files are used to upload documents that can be used with features like Assistants and Fine-tuning. - name: Uploads description: Use Uploads to upload large files in multiple parts. @@ -383,7 +385,8 @@ paths: name: Retrieve assistant group: assistants beta: true - returns: The [assistant](/docs/api-reference/assistants/object) object matching + returns: + The [assistant](/docs/api-reference/assistants/object) object matching the specified ID. examples: request: @@ -631,7 +634,7 @@ paths: -H "Authorization: Bearer $OPENAI_API_KEY" \ -H "Content-Type: application/json" \ -d '{ - "model": "tts-1", + "model": "gpt-4o-mini-tts", "input": "The quick brown fox jumped over the lazy dog.", "voice": "alloy" }' \ @@ -642,12 +645,12 @@ paths: speech_file_path = Path(__file__).parent / "speech.mp3" response = openai.audio.speech.create( - model="tts-1", + model="gpt-4o-mini-tts", voice="alloy", input="The quick brown fox jumped over the lazy dog." ) response.stream_to_file(speech_file_path) - node: > + javascript: > import fs from "fs"; import path from "path"; @@ -663,7 +666,7 @@ paths: async function main() { const mp3 = await openai.audio.speech.create({ - model: "tts-1", + model: "gpt-4o-mini-tts", voice: "alloy", input: "Today is a wonderful day to build something people love!", }); @@ -680,7 +683,7 @@ paths: using OpenAI.Audio; AudioClient client = new( - model: "tts-1", + model: "gpt-4o-mini-tts", apiKey: Environment.GetEnvironmentVariable("OPENAI_API_KEY") ); @@ -712,12 +715,18 @@ paths: oneOf: - $ref: "#/components/schemas/CreateTranscriptionResponseJson" - $ref: "#/components/schemas/CreateTranscriptionResponseVerboseJson" + text/event-stream: + schema: + $ref: "#/components/schemas/CreateTranscriptionResponseStreamEvent" x-oaiMeta: name: Create transcription group: audio - returns: The [transcription object](/docs/api-reference/audio/json-object) or a + returns: + The [transcription object](/docs/api-reference/audio/json-object), a [verbose transcription - object](/docs/api-reference/audio/verbose-json-object). + object](/docs/api-reference/audio/verbose-json-object) or a [stream of + transcript + events](/docs/api-reference/audio/transcript-text-delta-event). examples: - title: Default request: @@ -726,17 +735,17 @@ paths: -H "Authorization: Bearer $OPENAI_API_KEY" \ -H "Content-Type: multipart/form-data" \ -F file="@/path/to/file/audio.mp3" \ - -F model="whisper-1" + -F model="gpt-4o-transcribe" python: | from openai import OpenAI client = OpenAI() audio_file = open("speech.mp3", "rb") transcript = client.audio.transcriptions.create( - model="whisper-1", + model="gpt-4o-transcribe", file=audio_file ) - node: > + javascript: > import fs from "fs"; import OpenAI from "openai"; @@ -748,7 +757,7 @@ paths: async function main() { const transcription = await openai.audio.transcriptions.create({ file: fs.createReadStream("audio.mp3"), - model: "whisper-1", + model: "gpt-4o-transcribe", }); console.log(transcription.text); @@ -765,7 +774,7 @@ paths: AudioClient client = new( - model: "whisper-1", + model: "gpt-4o-transcribe", apiKey: Environment.GetEnvironmentVariable("OPENAI_API_KEY") ); @@ -779,6 +788,312 @@ paths: { "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." } + - title: Streaming + request: + curl: | + curl https://api.openai.com/v1/audio/transcriptions \ + -H "Authorization: Bearer $OPENAI_API_KEY" \ + -H "Content-Type: multipart/form-data" \ + -F file="@/path/to/file/audio.mp3" \ + -F model="gpt-4o-mini-transcribe" \ + -F stream=true + python: | + from openai import OpenAI + client = OpenAI() + + audio_file = open("speech.mp3", "rb") + stream = client.audio.transcriptions.create( + file=audio_file, + model="gpt-4o-mini-transcribe", + stream=True + ) + + for event in stream: + print(event) + javascript: | + import fs from "fs"; + import OpenAI from "openai"; + + const openai = new OpenAI(); + + const stream = await openai.audio.transcriptions.create({ + file: fs.createReadStream("audio.mp3"), + model: "gpt-4o-mini-transcribe", + stream: true, + }); + + for await (const event of stream) { + console.log(event); + } + 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]}]} + - title: Logprobs + request: + curl: | + curl https://api.openai.com/v1/audio/transcriptions \ + -H "Authorization: Bearer $OPENAI_API_KEY" \ + -H "Content-Type: multipart/form-data" \ + -F file="@/path/to/file/audio.mp3" \ + -F "include[]=logprobs" \ + -F model="gpt-4o-transcribe" \ + -F response_format="json" + python: | + from openai import OpenAI + client = OpenAI() + + audio_file = open("speech.mp3", "rb") + transcript = client.audio.transcriptions.create( + file=audio_file, + model="gpt-4o-transcribe", + response_format="json", + include=["logprobs"] + ) + + print(transcript) + javascript: > + import fs from "fs"; + + import OpenAI from "openai"; + + + const openai = new OpenAI(); + + + async function main() { + const transcription = await openai.audio.transcriptions.create({ + file: fs.createReadStream("audio.mp3"), + model: "gpt-4o-transcribe", + response_format: "json", + include: ["logprobs"] + }); + + console.log(transcription); + } + + main(); + response: > + { + "text": "Hey, my knee is hurting and I want to see the doctor tomorrow ideally.", + "logprobs": [ + { "token": "Hey", "logprob": -1.0415299, "bytes": [72, 101, 121] }, + { "token": ",", "logprob": -9.805982e-5, "bytes": [44] }, + { "token": " my", "logprob": -0.00229799, "bytes": [32, 109, 121] }, + { + "token": " knee", + "logprob": -4.7159858e-5, + "bytes": [32, 107, 110, 101, 101] + }, + { "token": " is", "logprob": -0.043909557, "bytes": [32, 105, 115] }, + { + "token": " hurting", + "logprob": -1.1041146e-5, + "bytes": [32, 104, 117, 114, 116, 105, 110, 103] + }, + { "token": " and", "logprob": -0.011076359, "bytes": [32, 97, 110, 100] }, + { "token": " I", "logprob": -5.3193703e-6, "bytes": [32, 73] }, + { + "token": " want", + "logprob": -0.0017156356, + "bytes": [32, 119, 97, 110, 116] + }, + { "token": " to", "logprob": -7.89631e-7, "bytes": [32, 116, 111] }, + { "token": " see", "logprob": -5.5122365e-7, "bytes": [32, 115, 101, 101] }, + { "token": " the", "logprob": -0.0040786397, "bytes": [32, 116, 104, 101] }, + { + "token": " doctor", + "logprob": -2.3392786e-6, + "bytes": [32, 100, 111, 99, 116, 111, 114] + }, + { + "token": " tomorrow", + "logprob": -7.89631e-7, + "bytes": [32, 116, 111, 109, 111, 114, 114, 111, 119] + }, + { + "token": " ideally", + "logprob": -0.5800861, + "bytes": [32, 105, 100, 101, 97, 108, 108, 121] + }, + { "token": ".", "logprob": -0.00011093382, "bytes": [46] } + ] + } - title: Word timestamps request: curl: | @@ -802,7 +1117,7 @@ paths: ) print(transcript.words) - node: > + javascript: > import fs from "fs"; import OpenAI from "openai"; @@ -895,7 +1210,7 @@ paths: ) print(transcript.words) - node: > + javascript: > import fs from "fs"; import OpenAI from "openai"; @@ -1011,7 +1326,7 @@ paths: model="whisper-1", file=audio_file ) - node: | + javascript: | import fs from "fs"; import OpenAI from "openai"; @@ -1086,19 +1401,22 @@ paths: endpoint: type: string enum: + - /v1/responses - /v1/chat/completions - /v1/embeddings - /v1/completions - description: The endpoint to be used for all requests in the batch. Currently - `/v1/chat/completions`, `/v1/embeddings`, and - `/v1/completions` are supported. Note that `/v1/embeddings` - batches are also restricted to a maximum of 50,000 embedding - inputs across all requests in the batch. + description: + The endpoint to be used for all requests in the batch. Currently + `/v1/responses`, `/v1/chat/completions`, `/v1/embeddings`, + and `/v1/completions` 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. + description: + The time frame within which the batch should be processed. Currently only `24h` is supported. metadata: $ref: "#/components/schemas/Metadata" @@ -1302,7 +1620,8 @@ paths: x-oaiMeta: name: Retrieve batch group: batch - returns: The [Batch](/docs/api-reference/batch/object) object matching the + returns: + The [Batch](/docs/api-reference/batch/object) object matching the specified ID. examples: request: @@ -1362,7 +1681,8 @@ paths: operationId: cancelBatch tags: - Batch - summary: Cancels an in-progress batch. The batch will be in status `cancelling` + summary: + 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: @@ -1382,7 +1702,8 @@ paths: x-oaiMeta: name: Cancel batch group: batch - returns: The [Batch](/docs/api-reference/batch/object) object matching the + returns: + The [Batch](/docs/api-reference/batch/object) object matching the specified ID. examples: request: @@ -1480,7 +1801,8 @@ paths: default: 20 - name: order in: query - description: Sort order for Chat Completions by timestamp. Use `asc` for + description: + Sort order for Chat Completions by timestamp. Use `asc` for ascending order or `desc` for descending order. Defaults to `asc`. required: false schema: @@ -1499,7 +1821,8 @@ paths: x-oaiMeta: name: List Chat Completions group: chat - returns: A list of [Chat Completions](/docs/api-reference/chat/list-object) + returns: + A list of [Chat Completions](/docs/api-reference/chat/list-object) matching the specified filters. path: list examples: @@ -2521,7 +2844,8 @@ paths: x-oaiMeta: name: Get chat completion group: chat - returns: The [ChatCompletion](/docs/api-reference/chat/object) object matching + returns: + The [ChatCompletion](/docs/api-reference/chat/object) object matching the specified ID. examples: request: @@ -2620,7 +2944,8 @@ paths: x-oaiMeta: name: Update chat completion group: chat - returns: The [ChatCompletion](/docs/api-reference/chat/object) object matching + returns: + The [ChatCompletion](/docs/api-reference/chat/object) object matching the specified ID. examples: request: @@ -2768,7 +3093,8 @@ paths: default: 20 - name: order in: query - description: Sort order for messages by timestamp. Use `asc` for ascending order + description: + Sort order for messages by timestamp. Use `asc` for ascending order or `desc` for descending order. Defaults to `asc`. required: false schema: @@ -2787,7 +3113,8 @@ paths: x-oaiMeta: name: Get chat messages group: chat - returns: A list of [messages](/docs/api-reference/chat/message-list) for the + returns: + A list of [messages](/docs/api-reference/chat/message-list) for the specified chat completion. examples: request: @@ -3336,7 +3663,8 @@ paths: x-oaiMeta: name: Retrieve file group: files - returns: The [File](/docs/api-reference/files/object) object matching the + returns: + The [File](/docs/api-reference/files/object) object matching the specified ID. examples: request: @@ -3415,6 +3743,205 @@ paths: } main(); + /fine_tuning/checkpoints/{permission_id}/permissions: + get: + operationId: listFineTuningCheckpointPermissions + tags: + - Fine-tuning + summary: > + **NOTE:** This endpoint requires an [admin API key](../admin-api-keys). + + + Organization owners can use this endpoint to view all permissions for a + fine-tuned model checkpoint. + parameters: + - in: path + name: permission_id + required: true + schema: + type: string + example: ft-AF1WoRqd3aJAHsqc9NY7iL8F + description: | + The ID of the fine-tuned model checkpoint to get permissions for. + - name: project_id + in: query + description: The ID of the project to get permissions for. + required: false + schema: + type: string + - name: after + in: query + description: + Identifier for the last permission ID from the previous pagination + request. + required: false + schema: + type: string + - name: limit + in: query + description: Number of permissions to retrieve. + required: false + schema: + type: integer + default: 10 + - name: order + in: query + description: The order in which to retrieve permissions. + required: false + schema: + type: string + enum: + - ascending + - descending + default: descending + responses: + "200": + description: OK + content: + application/json: + schema: + $ref: "#/components/schemas/ListFineTuningCheckpointPermissionResponse" + x-oaiMeta: + name: List checkpoint permissions + group: fine-tuning + returns: A list of fine-tuned model checkpoint [permission + objects](/docs/api-reference/fine-tuning/permission-object) for a + fine-tuned model checkpoint. + examples: + request: + curl: > + curl + https://api.openai.com/v1/fine_tuning/checkpoints/ft:gpt-4o-mini-2024-07-18:org:weather:B7R9VjQd/permissions + \ + -H "Authorization: Bearer $OPENAI_API_KEY" + response: | + { + "object": "list", + "data": [ + { + "object": "checkpoint.permission", + "id": "cp_zc4Q7MP6XxulcVzj4MZdwsAB", + "created_at": 1721764867, + "project_id": "proj_abGMw1llN8IrBb6SvvY5A1iH" + }, + { + "object": "checkpoint.permission", + "id": "cp_enQCFmOTGj3syEpYVhBRLTSy", + "created_at": 1721764800, + "project_id": "proj_iqGMw1llN8IrBb6SvvY5A1oF" + }, + ], + "first_id": "cp_zc4Q7MP6XxulcVzj4MZdwsAB", + "last_id": "cp_enQCFmOTGj3syEpYVhBRLTSy", + "has_more": false + } + post: + operationId: createFineTuningCheckpointPermission + tags: + - Fine-tuning + summary: > + **NOTE:** Calling this endpoint requires an [admin API + key](../admin-api-keys). + + + This enables organization owners to share fine-tuned models with other + projects in their organization. + parameters: + - in: path + name: permission_id + required: true + schema: + type: string + example: ft:gpt-4o-mini-2024-07-18:org:weather:B7R9VjQd + description: > + The ID of the fine-tuned model checkpoint to create a permission for. + requestBody: + required: true + content: + application/json: + schema: + $ref: "#/components/schemas/CreateFineTuningCheckpointPermissionRequest" + responses: + "200": + description: OK + content: + application/json: + schema: + $ref: "#/components/schemas/ListFineTuningCheckpointPermissionResponse" + x-oaiMeta: + name: Create checkpoint permissions + group: fine-tuning + returns: A list of fine-tuned model checkpoint [permission + objects](/docs/api-reference/fine-tuning/permission-object) for a + fine-tuned model checkpoint. + examples: + request: + curl: > + curl + https://api.openai.com/v1/fine_tuning/checkpoints/ft:gpt-4o-mini-2024-07-18:org:weather:B7R9VjQd/permissions + \ + -H "Authorization: Bearer $OPENAI_API_KEY" + -d '{"project_ids": ["proj_abGMw1llN8IrBb6SvvY5A1iH"]}' + response: | + { + "object": "list", + "data": [ + { + "object": "checkpoint.permission", + "id": "cp_zc4Q7MP6XxulcVzj4MZdwsAB", + "created_at": 1721764867, + "project_id": "proj_abGMw1llN8IrBb6SvvY5A1iH" + } + ], + "first_id": "cp_zc4Q7MP6XxulcVzj4MZdwsAB", + "last_id": "cp_zc4Q7MP6XxulcVzj4MZdwsAB", + "has_more": false + } + delete: + operationId: deleteFineTuningCheckpointPermission + tags: + - Fine-tuning + summary: > + **NOTE:** This endpoint requires an [admin API key](../admin-api-keys). + + + Organization owners can use this endpoint to delete a permission for a + fine-tuned model checkpoint. + parameters: + - in: path + name: permission_id + required: true + schema: + type: string + example: cp_zc4Q7MP6XxulcVzj4MZdwsAB + description: | + The ID of the fine-tuned model checkpoint permission to delete. + responses: + "200": + description: OK + content: + application/json: + schema: + $ref: "#/components/schemas/DeleteFineTuningCheckpointPermissionResponse" + x-oaiMeta: + name: Delete checkpoint permission + group: fine-tuning + returns: + The deletion status of the fine-tuned model checkpoint [permission + object](/docs/api-reference/fine-tuning/permission-object). + examples: + request: + curl: > + curl + https://api.openai.com/v1/fine_tuning/checkpoints/ft:gpt-4o-mini-2024-07-18:org:weather:B7R9VjQd/permissions/cp_zc4Q7MP6XxulcVzj4MZdwsAB + \ + -H "Authorization: Bearer $OPENAI_API_KEY" + response: | + { + "object": "checkpoint.permission", + "id": "cp_zc4Q7MP6XxulcVzj4MZdwsAB", + "deleted": true + } /fine_tuning/jobs: post: operationId: createFineTuningJob @@ -3868,7 +4395,8 @@ paths: x-oaiMeta: name: Retrieve fine-tuning job group: fine-tuning - returns: The [fine-tuning](/docs/api-reference/fine-tuning/object) object with + returns: + The [fine-tuning](/docs/api-reference/fine-tuning/object) object with the given ID. examples: request: @@ -3958,7 +4486,8 @@ paths: x-oaiMeta: name: Cancel fine-tuning group: fine-tuning - returns: The cancelled [fine-tuning](/docs/api-reference/fine-tuning/object) + returns: + The cancelled [fine-tuning](/docs/api-reference/fine-tuning/object) object. examples: request: @@ -4016,7 +4545,8 @@ paths: The ID of the fine-tuning job to get checkpoints for. - name: after in: query - description: Identifier for the last checkpoint ID from the previous pagination + description: + Identifier for the last checkpoint ID from the previous pagination request. required: false schema: @@ -4444,7 +4974,8 @@ paths: operationId: listModels tags: - Models - summary: Lists the currently available models, and provides basic information + summary: + Lists the currently available models, and provides basic information about each one such as the owner and availability. responses: "200": @@ -4523,7 +5054,8 @@ paths: operationId: retrieveModel tags: - Models - summary: Retrieves a model instance, providing basic information about the model + summary: + Retrieves a model instance, providing basic information about the model such as the owner and permissioning. parameters: - in: path @@ -4543,7 +5075,8 @@ paths: x-oaiMeta: name: Retrieve model group: models - returns: The [model](/docs/api-reference/models/object) object matching the + returns: + The [model](/docs/api-reference/models/object) object matching the specified ID. examples: request: @@ -4938,7 +5471,8 @@ paths: schema: type: string nullable: true - description: Return keys with IDs that come after this ID in the pagination + description: + Return keys with IDs that come after this ID in the pagination order. - in: query name: order @@ -5154,7 +5688,8 @@ paths: parameters: - name: effective_at in: query - description: Return only events whose `effective_at` (Unix seconds) is in this + description: + Return only events whose `effective_at` (Unix seconds) is in this range. required: false schema: @@ -5162,19 +5697,23 @@ paths: properties: gt: type: integer - description: Return only events whose `effective_at` (Unix seconds) is greater + description: + Return only events whose `effective_at` (Unix seconds) is greater than this value. gte: type: integer - description: Return only events whose `effective_at` (Unix seconds) is greater + description: + Return only events whose `effective_at` (Unix seconds) is greater than or equal to this value. lt: type: integer - description: Return only events whose `effective_at` (Unix seconds) is less than + description: + Return only events whose `effective_at` (Unix seconds) is less than this value. lte: type: integer - description: Return only events whose `effective_at` (Unix seconds) is less than + description: + Return only events whose `effective_at` (Unix seconds) is less than or equal to this value. - name: project_ids[] in: query @@ -5186,7 +5725,8 @@ paths: type: string - name: event_types[] in: query - description: Return only events with a `type` in one of these values. For + description: + Return only events with a `type` in one of these values. For example, `project.created`. For all options, see the documentation for the [audit log object](/docs/api-reference/audit-logs/object). required: false @@ -5196,7 +5736,8 @@ paths: $ref: "#/components/schemas/AuditLogEventType" - name: actor_ids[] in: query - description: Return only events performed by these actors. Can be a user ID, a + description: + Return only events performed by these actors. Can be a user ID, a service account ID, or an api key tracking ID. required: false schema: @@ -5213,7 +5754,8 @@ paths: type: string - name: resource_ids[] in: query - description: Return only events performed on these targets. For example, a + description: + Return only events performed on these targets. For example, a project ID updated. required: false schema: @@ -5258,7 +5800,8 @@ paths: x-oaiMeta: name: List audit logs group: audit-logs - returns: A list of paginated [Audit Log](/docs/api-reference/audit-logs/object) + returns: + A list of paginated [Audit Log](/docs/api-reference/audit-logs/object) objects. examples: request: @@ -5347,7 +5890,8 @@ paths: type: integer - name: bucket_width in: query - description: Width of each time bucket in response. Currently only `1d` is + description: + Width of each time bucket in response. Currently only `1d` is supported, default to `1d`. required: false schema: @@ -5365,7 +5909,8 @@ paths: type: string - name: group_by in: query - description: Group the costs by the specified fields. Support fields include + description: + Group the costs by the specified fields. Support fields include `project_id`, `line_item` and any combination of them. required: false schema: @@ -5386,7 +5931,8 @@ paths: default: 7 - name: page in: query - description: A cursor for use in pagination. Corresponding to the `next_page` + description: + A cursor for use in pagination. Corresponding to the `next_page` field from the previous response. schema: type: string @@ -5501,7 +6047,8 @@ paths: "has_more": false } post: - summary: Create an invite for a user to the organization. The invite must be + summary: + Create an invite for a user to the organization. The invite must be accepted by the user before they have access to the organization. operationId: inviteUser tags: @@ -5588,7 +6135,8 @@ paths: x-oaiMeta: name: Retrieve invite group: administration - returns: The [Invite](/docs/api-reference/invite/object) object matching the + returns: + The [Invite](/docs/api-reference/invite/object) object matching the specified ID. examples: request: @@ -5608,7 +6156,8 @@ paths: "accepted_at": 1711471533 } delete: - summary: Delete an invite. If the invite has already been accepted, it cannot be + summary: + Delete an invite. If the invite has already been accepted, it cannot be deleted. operationId: delete-invite tags: @@ -5675,7 +6224,8 @@ paths: schema: type: boolean default: false - description: If `true` returns all projects including those that have been + description: + If `true` returns all projects including those that have been `archived`. Archived projects are not included by default. responses: "200": @@ -5714,7 +6264,8 @@ paths: "has_more": false } post: - summary: Create a new project in the organization. Projects can be created and + summary: + Create a new project in the organization. Projects can be created and archived, but cannot be deleted. operationId: create-project tags: @@ -5779,7 +6330,8 @@ paths: name: Retrieve project group: administration description: Retrieve a project. - returns: The [Project](/docs/api-reference/projects/object) object matching the + returns: + The [Project](/docs/api-reference/projects/object) object matching the specified ID. examples: request: @@ -5884,7 +6436,8 @@ paths: x-oaiMeta: name: List project API keys group: administration - returns: A list of [ProjectApiKey](/docs/api-reference/project-api-keys/object) + returns: + A list of [ProjectApiKey](/docs/api-reference/project-api-keys/object) objects. examples: request: @@ -5950,7 +6503,8 @@ paths: x-oaiMeta: name: Retrieve project API key group: administration - returns: The [ProjectApiKey](/docs/api-reference/project-api-keys/object) object + returns: + The [ProjectApiKey](/docs/api-reference/project-api-keys/object) object matching the specified ID. examples: request: @@ -6013,7 +6567,8 @@ paths: x-oaiMeta: name: Delete project API key group: administration - returns: Confirmation of the key's deletion or an error if the key belonged to a + returns: + Confirmation of the key's deletion or an error if the key belonged to a service account examples: request: @@ -6031,7 +6586,8 @@ paths: } /organization/projects/{project_id}/archive: post: - summary: Archives a project in the organization. Archived projects cannot be + summary: + Archives a project in the organization. Archived projects cannot be used or updated. operationId: archive-project tags: @@ -6301,7 +6857,8 @@ paths: "has_more": false } post: - summary: Creates a new service account in the project. This also returns an + summary: + Creates a new service account in the project. This also returns an unredacted API key for the service account. operationId: create-project-service-account tags: @@ -6441,7 +6998,8 @@ paths: x-oaiMeta: name: Delete project service account group: administration - returns: Confirmation of service account being deleted, or an error in case of + returns: + Confirmation of service account being deleted, or an error in case of an archived project, which has no service accounts examples: request: @@ -6505,7 +7063,8 @@ paths: x-oaiMeta: name: List project users group: administration - returns: A list of [ProjectUser](/docs/api-reference/project-users/object) + returns: + A list of [ProjectUser](/docs/api-reference/project-users/object) objects. examples: request: @@ -6568,7 +7127,8 @@ paths: x-oaiMeta: name: Create project user group: administration - returns: The created [ProjectUser](/docs/api-reference/project-users/object) + returns: + The created [ProjectUser](/docs/api-reference/project-users/object) object. examples: request: @@ -6618,7 +7178,8 @@ paths: x-oaiMeta: name: Retrieve project user group: administration - returns: The [ProjectUser](/docs/api-reference/project-users/object) object + returns: + The [ProjectUser](/docs/api-reference/project-users/object) object matching the specified ID. examples: request: @@ -6678,7 +7239,8 @@ paths: x-oaiMeta: name: Modify project user group: administration - returns: The updated [ProjectUser](/docs/api-reference/project-users/object) + returns: + The updated [ProjectUser](/docs/api-reference/project-users/object) object. examples: request: @@ -6734,7 +7296,8 @@ paths: x-oaiMeta: name: Delete project user group: administration - returns: Confirmation that project has been deleted or an error in case of an + returns: + Confirmation that project has been deleted or an error in case of an archived project, which has no users examples: request: @@ -6771,7 +7334,8 @@ paths: type: integer - name: bucket_width in: query - description: Width of each time bucket in response. Currently `1m`, `1h` and + description: + Width of each time bucket in response. Currently `1m`, `1h` and `1d` are supported, default to `1d`. required: false schema: @@ -6815,7 +7379,8 @@ paths: type: string - name: group_by in: query - description: Group the usage data by the specified fields. Support fields + description: + Group the usage data by the specified fields. Support fields include `project_id`, `user_id`, `api_key_id`, `model` or any combination of them. required: false @@ -6840,7 +7405,8 @@ paths: type: integer - name: page in: query - description: A cursor for use in pagination. Corresponding to the `next_page` + description: + A cursor for use in pagination. Corresponding to the `next_page` field from the previous response. schema: type: string @@ -6911,7 +7477,8 @@ paths: type: integer - name: bucket_width in: query - description: Width of each time bucket in response. Currently `1m`, `1h` and + description: + Width of each time bucket in response. Currently `1m`, `1h` and `1d` are supported, default to `1d`. required: false schema: @@ -6955,7 +7522,8 @@ paths: type: string - name: group_by in: query - description: Group the usage data by the specified fields. Support fields + description: + Group the usage data by the specified fields. Support fields include `project_id`, `user_id`, `api_key_id`, `model` or any combination of them. required: false @@ -6980,7 +7548,8 @@ paths: type: integer - name: page in: query - description: A cursor for use in pagination. Corresponding to the `next_page` + description: + A cursor for use in pagination. Corresponding to the `next_page` field from the previous response. schema: type: string @@ -7051,7 +7620,8 @@ paths: type: integer - name: bucket_width in: query - description: Width of each time bucket in response. Currently `1m`, `1h` and + description: + Width of each time bucket in response. Currently `1m`, `1h` and `1d` are supported, default to `1d`. required: false schema: @@ -7071,7 +7641,8 @@ paths: type: string - name: group_by in: query - description: Group the usage data by the specified fields. Support fields + description: + Group the usage data by the specified fields. Support fields include `project_id`. required: false schema: @@ -7092,7 +7663,8 @@ paths: type: integer - name: page in: query - description: A cursor for use in pagination. Corresponding to the `next_page` + description: + A cursor for use in pagination. Corresponding to the `next_page` field from the previous response. schema: type: string @@ -7160,7 +7732,8 @@ paths: type: integer - name: bucket_width in: query - description: Width of each time bucket in response. Currently `1m`, `1h` and + description: + Width of each time bucket in response. Currently `1m`, `1h` and `1d` are supported, default to `1d`. required: false schema: @@ -7212,7 +7785,8 @@ paths: type: boolean - name: group_by in: query - description: Group the usage data by the specified fields. Support fields + description: + Group the usage data by the specified fields. Support fields include `project_id`, `user_id`, `api_key_id`, `model`, `batch` or any combination of them. required: false @@ -7238,7 +7812,8 @@ paths: type: integer - name: page in: query - description: A cursor for use in pagination. Corresponding to the `next_page` + description: + A cursor for use in pagination. Corresponding to the `next_page` field from the previous response. schema: type: string @@ -7314,7 +7889,8 @@ paths: type: integer - name: bucket_width in: query - description: Width of each time bucket in response. Currently `1m`, `1h` and + description: + Width of each time bucket in response. Currently `1m`, `1h` and `1d` are supported, default to `1d`. required: false schema: @@ -7358,7 +7934,8 @@ paths: type: string - name: group_by in: query - description: Group the usage data by the specified fields. Support fields + description: + Group the usage data by the specified fields. Support fields include `project_id`, `user_id`, `api_key_id`, `model` or any combination of them. required: false @@ -7383,7 +7960,8 @@ paths: type: integer - name: page in: query - description: A cursor for use in pagination. Corresponding to the `next_page` + description: + A cursor for use in pagination. Corresponding to the `next_page` field from the previous response. schema: type: string @@ -7454,7 +8032,8 @@ paths: type: integer - name: bucket_width in: query - description: Width of each time bucket in response. Currently `1m`, `1h` and + description: + Width of each time bucket in response. Currently `1m`, `1h` and `1d` are supported, default to `1d`. required: false schema: @@ -7480,7 +8059,8 @@ paths: - image.variation - name: sizes in: query - description: Return only usages for these image sizes. Possible values are + description: + Return only usages for these image sizes. Possible values are `256x256`, `512x512`, `1024x1024`, `1792x1792`, `1024x1792` or any combination of them. required: false @@ -7528,7 +8108,8 @@ paths: type: string - name: group_by in: query - description: Group the usage data by the specified fields. Support fields + description: + Group the usage data by the specified fields. Support fields include `project_id`, `user_id`, `api_key_id`, `model`, `size`, `source` or any combination of them. required: false @@ -7555,7 +8136,8 @@ paths: type: integer - name: page in: query - description: A cursor for use in pagination. Corresponding to the `next_page` + description: + A cursor for use in pagination. Corresponding to the `next_page` field from the previous response. schema: type: string @@ -7628,7 +8210,8 @@ paths: type: integer - name: bucket_width in: query - description: Width of each time bucket in response. Currently `1m`, `1h` and + description: + Width of each time bucket in response. Currently `1m`, `1h` and `1d` are supported, default to `1d`. required: false schema: @@ -7672,7 +8255,8 @@ paths: type: string - name: group_by in: query - description: Group the usage data by the specified fields. Support fields + description: + Group the usage data by the specified fields. Support fields include `project_id`, `user_id`, `api_key_id`, `model` or any combination of them. required: false @@ -7697,7 +8281,8 @@ paths: type: integer - name: page in: query - description: A cursor for use in pagination. Corresponding to the `next_page` + description: + A cursor for use in pagination. Corresponding to the `next_page` field from the previous response. schema: type: string @@ -7768,7 +8353,8 @@ paths: type: integer - name: bucket_width in: query - description: Width of each time bucket in response. Currently `1m`, `1h` and + description: + Width of each time bucket in response. Currently `1m`, `1h` and `1d` are supported, default to `1d`. required: false schema: @@ -7788,7 +8374,8 @@ paths: type: string - name: group_by in: query - description: Group the usage data by the specified fields. Support fields + description: + Group the usage data by the specified fields. Support fields include `project_id`. required: false schema: @@ -7809,7 +8396,8 @@ paths: type: integer - name: page in: query - description: A cursor for use in pagination. Corresponding to the `next_page` + description: + A cursor for use in pagination. Corresponding to the `next_page` field from the previous response. schema: type: string @@ -7948,7 +8536,8 @@ paths: x-oaiMeta: name: Retrieve user group: administration - returns: The [User](/docs/api-reference/users/object) object matching the + returns: + The [User](/docs/api-reference/users/object) object matching the specified ID. examples: request: @@ -8096,7 +8685,7 @@ paths: -H "Authorization: Bearer $OPENAI_API_KEY" \ -H "Content-Type: application/json" \ -d '{ - "model": "gpt-4o-realtime-preview-2024-12-17", + "model": "gpt-4o-realtime-preview", "modalities": ["audio", "text"], "instructions": "You are a friendly assistant." }' @@ -8104,7 +8693,7 @@ paths: { "id": "sess_001", "object": "realtime.session", - "model": "gpt-4o-realtime-preview-2024-12-17", + "model": "gpt-4o-realtime-preview", "modalities": ["audio", "text"], "instructions": "You are a friendly assistant.", "voice": "alloy", @@ -8123,6 +8712,75 @@ paths: "expires_at": 1234567890 } } + /realtime/transcription_sessions: + post: + summary: > + Create an ephemeral API token for use in client-side applications with + the + + Realtime API specifically for realtime transcriptions. + + Can be configured with the same session parameters as the + `transcription_session.update` client event. + + + It responds with a session object, plus a `client_secret` key which + contains + + a usable ephemeral API token that can be used to authenticate browser + clients + + for the Realtime API. + operationId: create-realtime-transcription-session + tags: + - Realtime + requestBody: + description: Create an ephemeral API key with the given session configuration. + required: true + content: + application/json: + schema: + $ref: "#/components/schemas/RealtimeTranscriptionSessionCreateRequest" + responses: + "200": + description: Session created successfully. + content: + application/json: + schema: + $ref: "#/components/schemas/RealtimeTranscriptionSessionCreateResponse" + x-oaiMeta: + name: Create transcription session + group: realtime + returns: The created [Realtime transcription session + object](/docs/api-reference/realtime-sessions/transcription_session_object), + plus an ephemeral key + examples: + request: + curl: > + curl -X POST + https://api.openai.com/v1/realtime/transcription_sessions \ + -H "Authorization: Bearer $OPENAI_API_KEY" \ + -H "Content-Type: application/json" \ + -d '{}' + response: | + { + "id": "sess_BBwZc7cFV3XizEyKGDCGL", + "object": "realtime.transcription_session", + "modalities": ["audio", "text"], + "turn_detection": { + "type": "server_vad", + "threshold": 0.5, + "prefix_padding_ms": 300, + "silence_duration_ms": 200 + }, + "input_audio_format": "pcm16", + "input_audio_transcription": { + "model": "gpt-4o-transcribe", + "language": null, + "prompt": "" + }, + "client_secret": null + } /responses: post: operationId: createResponse @@ -8235,7 +8893,7 @@ paths: "previous_response_id": null, "reasoning": { "effort": null, - "summary": null + "generate_summary": null }, "store": true, "temperature": 1.0, @@ -8364,7 +9022,7 @@ paths: "previous_response_id": null, "reasoning": { "effort": null, - "summary": null + "generate_summary": null }, "store": true, "temperature": 1.0, @@ -8483,7 +9141,7 @@ paths: "previous_response_id": null, "reasoning": { "effort": null, - "summary": null + "generate_summary": null }, "store": true, "temperature": 1.0, @@ -8661,7 +9319,7 @@ paths: "previous_response_id": null, "reasoning": { "effort": null, - "summary": null + "generate_summary": null }, "store": true, "temperature": 1.0, @@ -8700,7 +9358,7 @@ paths: }, "user": null, "metadata": {} - } + } - title: Streaming request: curl: | @@ -8748,7 +9406,7 @@ paths: 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-4o-2024-08-06","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":{}}} + assistant.","max_output_tokens":null,"model":"gpt-4o-2024-08-06","output":[],"parallel_tool_calls":true,"previous_response_id":null,"reasoning":{"effort":null,"generate_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 @@ -8756,7 +9414,7 @@ paths: 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-4o-2024-08-06","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":{}}} + assistant.","max_output_tokens":null,"model":"gpt-4o-2024-08-06","output":[],"parallel_tool_calls":true,"previous_response_id":null,"reasoning":{"effort":null,"generate_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 @@ -8808,7 +9466,7 @@ paths: are a helpful assistant.","max_output_tokens":null,"model":"gpt-4o-2024-08-06","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":{}}} + today?","annotations":[]}]}],"parallel_tool_calls":true,"previous_response_id":null,"reasoning":{"effort":null,"generate_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: > @@ -8938,7 +9596,7 @@ paths: "previous_response_id": null, "reasoning": { "effort": null, - "summary": null + "generate_summary": null }, "store": true, "temperature": 1.0, @@ -9058,7 +9716,7 @@ paths: "previous_response_id": null, "reasoning": { "effort": "high", - "summary": null + "generate_summary": null }, "store": true, "temperature": 1.0, @@ -9106,9 +9764,18 @@ paths: type: array items: $ref: "#/components/schemas/Includable" - description: | - Additional fields to include in the response. See the `include` - parameter for Response creation above for more information. + description: > + Specify additional output data to include in the response. Currently + + supported values are: + + - `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. + + - `computer_call_output.output.image_url`: Include image urls from + the computer call output. responses: "200": description: OK @@ -9135,7 +9802,7 @@ paths: const client = new OpenAI(); const response = await client.responses.retrieve("resp_123"); - console.log(response); + console.log(response); python: | from openai import OpenAI client = OpenAI() @@ -9172,7 +9839,7 @@ paths: "previous_response_id": null, "reasoning": { "effort": null, - "summary": null + "generate_summary": null }, "store": true, "temperature": 1.0, @@ -9238,7 +9905,7 @@ paths: const client = new OpenAI(); const response = await client.responses.del("resp_123"); - console.log(response); + console.log(response); python: | from openai import OpenAI client = OpenAI() @@ -9324,7 +9991,7 @@ paths: const response = await client.responses.inputItems.list("resp_123"); - console.log(response.data); + console.log(response.data); python: | from openai import OpenAI client = OpenAI() @@ -9988,7 +10655,8 @@ paths: name: Retrieve thread group: threads beta: true - returns: The [thread](/docs/api-reference/threads/object) object matching the + returns: + The [thread](/docs/api-reference/threads/object) object matching the specified ID. examples: request: @@ -10058,7 +10726,8 @@ paths: name: Modify thread group: threads beta: true - returns: The modified [thread](/docs/api-reference/threads/object) object + returns: + The modified [thread](/docs/api-reference/threads/object) object matching the specified ID. examples: request: @@ -10180,7 +10849,8 @@ paths: required: true schema: type: string - description: The ID of the [thread](/docs/api-reference/threads) the messages + description: + The ID of the [thread](/docs/api-reference/threads) the messages belong to. - name: limit in: query @@ -10330,7 +11000,8 @@ paths: required: true schema: type: string - description: The ID of the [thread](/docs/api-reference/threads) to create a + description: + The ID of the [thread](/docs/api-reference/threads) to create a message for. requestBody: required: true @@ -10422,7 +11093,8 @@ paths: required: true schema: type: string - description: The ID of the [thread](/docs/api-reference/threads) to which this + description: + The ID of the [thread](/docs/api-reference/threads) to which this message belongs. - in: path name: message_id @@ -10441,7 +11113,8 @@ paths: name: Retrieve message group: threads beta: true - returns: The [message](/docs/api-reference/messages/object) object matching the + returns: + The [message](/docs/api-reference/messages/object) object matching the specified ID. examples: request: @@ -11456,7 +12129,8 @@ paths: name: Modify run group: threads beta: true - returns: The modified [run](/docs/api-reference/runs/object) object matching the + returns: + The modified [run](/docs/api-reference/runs/object) object matching the specified ID. examples: request: @@ -11582,7 +12256,8 @@ paths: name: Cancel a run group: threads beta: true - returns: The modified [run](/docs/api-reference/runs/object) object matching the + returns: + The modified [run](/docs/api-reference/runs/object) object matching the specified ID. examples: request: @@ -11862,7 +12537,8 @@ paths: name: Retrieve run step group: threads beta: true - returns: The [run step](/docs/api-reference/run-steps/step-object) object + returns: + The [run step](/docs/api-reference/run-steps/step-object) object matching the specified ID. examples: request: @@ -11941,7 +12617,8 @@ paths: required: true schema: type: string - description: The ID of the [thread](/docs/api-reference/threads) to which this + description: + The ID of the [thread](/docs/api-reference/threads) to which this run belongs. - in: path name: run_id @@ -11966,7 +12643,8 @@ paths: name: Submit tool outputs to run group: threads beta: true - returns: The modified [run](/docs/api-reference/runs/object) object matching the + returns: + The modified [run](/docs/api-reference/runs/object) object matching the specified ID. examples: - title: Default @@ -12316,7 +12994,8 @@ paths: x-oaiMeta: name: Create upload group: uploads - returns: The [Upload](/docs/api-reference/uploads/object) object with status + returns: + The [Upload](/docs/api-reference/uploads/object) object with status `pending`. examples: request: @@ -12366,7 +13045,8 @@ paths: x-oaiMeta: name: Cancel upload group: uploads - returns: The [Upload](/docs/api-reference/uploads/object) object with status + returns: + The [Upload](/docs/api-reference/uploads/object) object with status `cancelled`. examples: request: @@ -12429,7 +13109,8 @@ paths: x-oaiMeta: name: Complete upload group: uploads - returns: The [Upload](/docs/api-reference/uploads/object) object with status + returns: + The [Upload](/docs/api-reference/uploads/object) object with status `completed` with an additional `file` property containing the created usable File object. examples: @@ -12570,7 +13251,8 @@ paths: x-oaiMeta: name: List vector stores group: vector_stores - returns: A list of [vector store](/docs/api-reference/vector-stores/object) + returns: + A list of [vector store](/docs/api-reference/vector-stores/object) objects. examples: request: @@ -12722,7 +13404,8 @@ paths: x-oaiMeta: name: Retrieve vector store group: vector_stores - returns: The [vector store](/docs/api-reference/vector-stores/object) object + returns: + The [vector store](/docs/api-reference/vector-stores/object) object matching the specified ID. examples: request: @@ -12785,7 +13468,8 @@ paths: x-oaiMeta: name: Modify vector store group: vector_stores - returns: The modified [vector store](/docs/api-reference/vector-stores/object) + returns: + The modified [vector store](/docs/api-reference/vector-stores/object) object. examples: request: @@ -13216,7 +13900,8 @@ paths: type: string - name: filter in: query - description: Filter by file status. One of `in_progress`, `completed`, `failed`, + description: + Filter by file status. One of `in_progress`, `completed`, `failed`, `cancelled`. schema: type: string @@ -13346,7 +14031,8 @@ paths: type: string - name: filter in: query - description: Filter by file status. One of `in_progress`, `completed`, `failed`, + description: + Filter by file status. One of `in_progress`, `completed`, `failed`, `cancelled`. schema: type: string @@ -13576,7 +14262,8 @@ paths: operationId: deleteVectorStoreFile tags: - Vector stores - summary: Delete a vector store file. This will remove the file from the vector + summary: + Delete a vector store file. This will remove the file from the vector store but the file itself will not be deleted. To delete the file, use the [delete file](/docs/api-reference/files/delete) endpoint. parameters: @@ -13759,7 +14446,8 @@ paths: operationId: searchVectorStore tags: - Vector stores - summary: Search a vector store for relevant chunks based on a query and file + summary: + Search a vector store for relevant chunks based on a query and file attributes filter. parameters: - in: path @@ -14293,7 +14981,8 @@ components: x-oaiExpandable: true AssistantsNamedToolChoice: type: object - description: Specifies a tool the model should use. Use to force the model to + description: + Specifies a tool the model should use. Use to force the model to call a specific tool. properties: type: @@ -14302,7 +14991,8 @@ components: - function - code_interpreter - file_search - description: The type of the tool. If type is `function`, the function name must + description: + The type of the tool. If type is `function`, the function name must be set function: type: object @@ -14317,7 +15007,8 @@ components: AudioResponseFormat: description: > The format of the output, in one of these options: `json`, `text`, - `srt`, `verbose_json`, or `vtt`. + `srt`, `verbose_json`, or `vtt`. For `gpt-4o-transcribe` and + `gpt-4o-mini-transcribe`, the only supported format is `json`. type: string enum: - json @@ -14340,7 +15031,8 @@ components: description: The Unix timestamp (in seconds) of the event. project: type: object - description: The project that the action was scoped to. Absent for actions not + description: + The project that the action was scoped to. Absent for actions not scoped to projects. properties: id: @@ -14408,7 +15100,8 @@ components: description: The email invited to the organization. role: type: string - description: The role the email was invited to be. Is either `owner` or + description: + The role the email was invited to be. Is either `owner` or `member`. invite.accepted: type: object @@ -14469,12 +15162,14 @@ components: properties: threads_ui_visibility: type: string - description: Visibility of the threads page which shows messages created with + description: + Visibility of the threads page which shows messages created with the Assistants API and Playground. One of `ANY_ROLE`, `OWNERS`, or `NONE`. usage_dashboard_visibility: type: string - description: Visibility of the usage dashboard which shows activity and costs + description: + Visibility of the usage dashboard which shows activity and costs for your organization. One of `ANY_ROLE` or `OWNERS`. project.created: type: object @@ -14536,14 +15231,16 @@ components: description: The maximum images per minute. Only relevant for certain models. max_audio_megabytes_per_1_minute: type: integer - description: The maximum audio megabytes per minute. Only relevant for certain + description: + The maximum audio megabytes per minute. Only relevant for certain models. max_requests_per_1_day: type: integer description: The maximum requests per day. Only relevant for certain models. batch_1_day_max_input_tokens: type: integer - description: The maximum batch input tokens per day. Only relevant for certain + description: + The maximum batch input tokens per day. Only relevant for certain models. rate_limit.deleted: type: object @@ -14788,7 +15485,8 @@ components: nullable: true line: type: integer - description: The line number of the input file where the error occurred, if + description: + The line number of the input file where the error occurred, if applicable. nullable: true input_file_id: @@ -14811,7 +15509,8 @@ components: - cancelled output_file_id: type: string - description: The ID of the file containing the outputs of successfully executed + description: + The ID of the file containing the outputs of successfully executed requests. error_file_id: type: string @@ -14821,14 +15520,16 @@ components: description: The Unix timestamp (in seconds) for when the batch was created. in_progress_at: type: integer - description: The Unix timestamp (in seconds) for when the batch started + description: + The Unix timestamp (in seconds) for when the batch started processing. expires_at: type: integer description: The Unix timestamp (in seconds) for when the batch will expire. finalizing_at: type: integer - description: The Unix timestamp (in seconds) for when the batch started + description: + The Unix timestamp (in seconds) for when the batch started finalizing. completed_at: type: integer @@ -14841,7 +15542,8 @@ components: description: The Unix timestamp (in seconds) for when the batch expired. cancelling_at: type: integer - description: The Unix timestamp (in seconds) for when the batch started + description: + The Unix timestamp (in seconds) for when the batch started cancelling. cancelled_at: type: integer @@ -14911,18 +15613,21 @@ components: properties: custom_id: type: string - description: A developer-provided per-request id that will be used to match + description: + A developer-provided per-request id that will be used to match outputs to inputs. Must be unique for each request in a batch. method: type: string enum: - POST - description: The HTTP method to be used for the request. Currently only `POST` + description: + The HTTP method to be used for the request. Currently only `POST` is supported. x-stainless-const: true url: type: string - description: The OpenAI API relative URL to be used for the request. Currently + description: + The OpenAI API relative URL to be used for the request. Currently `/v1/chat/completions`, `/v1/embeddings`, and `/v1/completions` are supported. x-oaiMeta: @@ -14940,7 +15645,8 @@ components: type: string custom_id: type: string - description: A developer-provided per-request id that will be used to match + description: + A developer-provided per-request id that will be used to match outputs to inputs. response: type: object @@ -14951,7 +15657,8 @@ components: description: The HTTP status code of the response request_id: type: string - description: An unique identifier for the OpenAI API request. Please include + description: + An unique identifier for the OpenAI API request. Please include this request ID when contacting support. body: type: object @@ -14960,7 +15667,8 @@ components: error: type: object nullable: true - description: For requests that failed with a non-HTTP error, this will contain + description: + For requests that failed with a non-HTTP error, this will contain more information on the cause of the failure. properties: code: @@ -15018,11 +15726,13 @@ components: properties: description: type: string - description: A description of what the function does, used by the model to + 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 + 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" @@ -15195,7 +15905,8 @@ components: description: The name of the function to call. arguments: type: string - description: The arguments to call the function with, as generated by the model + 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 @@ -15229,7 +15940,8 @@ components: description: The name of the function to call. arguments: type: string - description: The arguments to call the function with, as generated by the model + 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 @@ -15269,7 +15981,8 @@ components: - audio ChatCompletionNamedToolChoice: type: object - description: Specifies a tool the model should use. Use to force the model to + description: + Specifies a tool the model should use. Use to force the model to call a specific function. properties: type: @@ -15303,7 +16016,8 @@ components: 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 + 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: @@ -15345,13 +16059,15 @@ components: function_call: type: object deprecated: true - description: Deprecated and replaced by `tool_calls`. The name and arguments of + description: + Deprecated and replaced by `tool_calls`. The name and arguments of a function that should be called, as generated by the model. nullable: true properties: arguments: type: string - description: The arguments to call the function with, as generated by the model + 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 @@ -15388,7 +16104,8 @@ components: description: The contents of the developer message. title: Text content - type: array - description: An array of content parts with a defined type. For developer + description: + An array of content parts with a defined type. For developer messages, only type `text` is supported. title: Array of content parts items: @@ -15485,7 +16202,7 @@ components: file: type: object properties: - file_name: + filename: type: string description: > The name of the file, used when passing the file to the model as @@ -15527,7 +16244,8 @@ components: format: uri detail: type: string - description: Specifies the detail level of the image. Learn more in the [Vision + description: + Specifies the detail level of the image. Learn more in the [Vision guide](/docs/guides/vision#low-or-high-fidelity-image-understanding). enum: - auto @@ -15592,7 +16310,8 @@ components: 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, + description: + An array of content parts with a defined type. For system messages, only type `text` is supported. title: Array of content parts items: @@ -15631,7 +16350,8 @@ components: 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, + description: + An array of content parts with a defined type. For tool messages, only type `text` is supported. title: Array of content parts items: @@ -15664,7 +16384,8 @@ components: description: The text contents of the message. title: Text content - type: array - description: An array of content parts with a defined type. Supported options + description: + An array of content parts with a defined type. Supported options differ based on the [model](/docs/models) being used to generate the response. Can contain text, image, or audio inputs. title: Array of content parts @@ -15739,7 +16460,8 @@ components: 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 + description: + The index of the first character of the URL citation in the message. url: type: string @@ -15756,12 +16478,14 @@ components: function_call: type: object deprecated: true - description: Deprecated and replaced by `tool_calls`. The name and arguments of + 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 + 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 @@ -15833,10 +16557,24 @@ components: 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. + [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. ChatCompletionStreamResponseDelta: type: object description: A chat completion delta generated by streamed model responses. @@ -15848,12 +16586,14 @@ components: function_call: deprecated: true type: object - description: Deprecated and replaced by `tool_calls`. The name and arguments of + 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 + 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 @@ -15885,12 +16625,14 @@ components: description: The token. type: string logprob: &a2 - description: The log probability of this token, if it is within the top 20 most + 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: &a3 - description: A list of integers representing the UTF-8 bytes representation of + 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 @@ -15900,7 +16642,8 @@ components: type: integer nullable: true top_logprobs: - description: List of the most likely tokens and their log probability, at this + description: + List of the most likely tokens and their log probability, at this token position. In rare cases, there may be fewer than the number of requested `top_logprobs` returned. type: array @@ -15966,7 +16709,8 @@ components: x-oaiExpandable: true ChunkingStrategyRequestParam: type: object - description: The chunking strategy used to chunk the file(s). If not set, will + description: + The chunking strategy used to chunk the file(s). If not set, will use the `auto` strategy. oneOf: - $ref: "#/components/schemas/AutoChunkingStrategyRequestParam" @@ -16173,7 +16917,8 @@ components: - type: string - type: number - type: boolean - description: The value to compare against the attribute key; supports string, + description: + The value to compare against the attribute key; supports string, number, or boolean types. required: - type @@ -16263,7 +17008,6 @@ components: - completion_tokens - total_tokens CompoundFilter: - $recursiveAnchor: true type: object additionalProperties: false title: Compound Filter @@ -16277,12 +17021,14 @@ components: - or filters: type: array - description: Array of filters to combine. Items can be `ComparisonFilter` or + description: + Array of filters to combine. Items can be `ComparisonFilter` or `CompoundFilter`. items: oneOf: - $ref: "#/components/schemas/ComparisonFilter" - - $recursiveRef: "#" + - type: object + additionalProperties: true required: - type - filters @@ -16333,7 +17079,7 @@ components: type: type: string enum: - - computer-preview + - computer_use_preview description: | The type of the computer use tool. Always `computer_use_preview`. x-stainless-const: true @@ -16535,12 +17281,14 @@ components: line_item: type: string nullable: true - description: When `group_by=line_item`, this field provides the line item of the + description: + When `group_by=line_item`, this field provides the line item of the grouped costs result. project_id: type: string nullable: true - description: When `group_by=project_id`, this field provides the project ID of + description: + When `group_by=project_id`, this field provides the project ID of the grouped costs result. required: - object @@ -16662,12 +17410,14 @@ components: type: string chunking_strategy: type: object - description: The chunking strategy used to chunk the file(s). If not set, will + description: + The chunking strategy used to chunk the file(s). If not set, will use the `auto` strategy. oneOf: - type: object title: Auto Chunking Strategy - description: The default strategy. This strategy currently uses a + description: + The default strategy. This strategy currently uses a `max_chunk_size_tokens` of `800` and `chunk_overlap_tokens` of `400`. additionalProperties: false @@ -16698,7 +17448,8 @@ components: type: integer minimum: 100 maximum: 4096 - description: The maximum number of tokens in each chunk. The default value is + description: + The maximum number of tokens in each chunk. The default value is `800`. The minimum value is `100` and the maximum value is `4096`. chunk_overlap_tokens: @@ -16760,7 +17511,8 @@ components: - model CreateChatCompletionFunctionResponse: type: object - description: Represents a chat completion response returned by model, based on + description: + Represents a chat completion response returned by model, based on the provided input. properties: id: @@ -16768,7 +17520,8 @@ components: 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 + description: + A list of chat completion choices. Can be more than one if `n` is greater than 1. items: type: object @@ -16798,7 +17551,8 @@ components: $ref: "#/components/schemas/ChatCompletionResponseMessage" created: type: integer - description: The Unix timestamp (in seconds) of when the chat completion was + description: + The Unix timestamp (in seconds) of when the chat completion was created. model: type: string @@ -16870,7 +17624,8 @@ components: } CreateChatCompletionImageResponse: type: object - description: Represents a streamed chunk of a chat completion response returned + description: + Represents a streamed chunk of a chat completion response returned by model, based on the provided input. [Learn more](/docs/guides/streaming-responses). x-oaiMeta: @@ -16923,6 +17678,19 @@ components: minItems: 1 items: $ref: "#/components/schemas/ChatCompletionRequestMessage" + model: + description: > + Model ID used to generate the response, like `gpt-4o` or `o1`. + OpenAI + + offers a wide range of models with different capabilities, + performance + + characteristics, and price points. Refer to the [model + guide](/docs/models) + + to browse and compare available models. + $ref: "#/components/schemas/ModelIdsShared" modalities: $ref: "#/components/schemas/ResponseModalities" reasoning_effort: @@ -17065,16 +17833,7 @@ components: x-oaiExpandable: true properties: voice: - type: string - enum: - - alloy - - ash - - ballad - - coral - - echo - - sage - - shimmer - - verse + $ref: "#/components/schemas/VoiceIdsShared" description: > The voice the model uses to respond. Supported voices are @@ -17191,7 +17950,8 @@ components: default: 1 example: 1 nullable: true - description: How many chat completion choices to generate for each input + 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. @@ -17214,8 +17974,7 @@ components: - $ref: "#/components/schemas/PredictionContent" seed: type: integer - minimum: -9223372036854776000 - maximum: 9223372036854776000 + format: int64 nullable: true description: > This feature is in Beta. @@ -17302,7 +18061,8 @@ components: - messages CreateChatCompletionResponse: type: object - description: Represents a chat completion response returned by model, based on + description: + Represents a chat completion response returned by model, based on the provided input. properties: id: @@ -17310,7 +18070,8 @@ components: 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 + description: + A list of chat completion choices. Can be more than one if `n` is greater than 1. items: type: object @@ -17368,7 +18129,8 @@ components: - refusal created: type: integer - description: The Unix timestamp (in seconds) of when the chat completion was + description: + The Unix timestamp (in seconds) of when the chat completion was created. model: type: string @@ -17454,7 +18216,8 @@ components: properties: id: type: string - description: A unique identifier for the chat completion. Each chunk has the + description: + A unique identifier for the chat completion. Each chunk has the same ID. choices: type: array @@ -17519,7 +18282,8 @@ components: description: The index of the choice in the list of choices. created: type: integer - description: The Unix timestamp (in seconds) of when the chat completion was + description: + The Unix timestamp (in seconds) of when the chat completion was created. Each chunk has the same timestamp. model: type: string @@ -17548,28 +18312,26 @@ components: - chat.completion.chunk x-stainless-const: true usage: - type: object + $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. - properties: - completion_tokens: - type: integer - description: Number of tokens in the generated completion. - prompt_tokens: - type: integer - description: Number of tokens in the prompt. - total_tokens: - type: integer - description: Total number of tokens used in the request (prompt + completion). - required: - - prompt_tokens - - completion_tokens - - total_tokens + `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. required: - choices - created @@ -17856,7 +18618,8 @@ components: description: A unique identifier for the completion. choices: type: array - description: The list of completion choices the model generated for the input + description: + The list of completion choices the model generated for the input prompt. items: type: object @@ -18002,7 +18765,8 @@ components: example: "[1212, 318, 257, 1332, 13]" - type: array title: array - description: The array of arrays containing integers that will be turned into an + description: + The array of arrays containing integers that will be turned into an embedding. minItems: 1 maxItems: 2048 @@ -18029,7 +18793,8 @@ components: - text-embedding-3-large x-oaiTypeLabel: string encoding_format: - description: The format to return the embeddings in. Can be either `float` or + description: + The format to return the embeddings in. Can be either `float` or [`base64`](https://pypi.org/project/pybase64/). example: float default: float @@ -18115,6 +18880,17 @@ components: required: - file - purpose + CreateFineTuningCheckpointPermissionRequest: + type: object + additionalProperties: false + properties: + project_ids: + type: array + description: The project identifiers to grant access to. + items: + type: string + required: + - project_ids CreateFineTuningJobRequest: type: object properties: @@ -18339,18 +19115,21 @@ components: type: object properties: image: - description: The image to edit. Must be a valid PNG file, less than 4MB, and + description: + The image to edit. Must be a valid PNG file, less than 4MB, and square. If mask is not provided, image must have transparency, which will be used as the mask. type: string format: binary prompt: - description: A text description of the desired image(s). The maximum length is + description: + A text description of the desired image(s). The maximum length is 1000 characters. type: string example: A cute baby sea otter wearing a beret mask: - description: An additional image whose fully transparent areas (e.g. where alpha + description: + An additional image whose fully transparent areas (e.g. where alpha is zero) indicate where `image` should be edited. Must be a valid PNG file, less than 4MB, and have the same dimensions as `image`. type: string @@ -18366,7 +19145,8 @@ components: default: dall-e-2 example: dall-e-2 nullable: true - description: The model to use for image generation. Only `dall-e-2` is supported + description: + The model to use for image generation. Only `dall-e-2` is supported at this time. n: type: integer @@ -18385,7 +19165,8 @@ components: default: 1024x1024 example: 1024x1024 nullable: true - description: The size of the generated images. Must be one of `256x256`, + description: + The size of the generated images. Must be one of `256x256`, `512x512`, or `1024x1024`. response_format: type: string @@ -18395,7 +19176,8 @@ components: default: url example: url nullable: true - description: The format in which the generated images are returned. Must be one + 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. user: @@ -18412,7 +19194,8 @@ components: type: object properties: prompt: - description: A text description of the desired image(s). The maximum length is + description: + A text description of the desired image(s). The maximum length is 1000 characters for `dall-e-2` and 4000 characters for `dall-e-3`. type: string example: A cute baby sea otter @@ -18435,7 +19218,8 @@ components: default: 1 example: 1 nullable: true - description: The number of images to generate. Must be between 1 and 10. For + 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 @@ -18444,7 +19228,8 @@ components: - hd default: standard example: standard - description: The quality of the image that will be generated. `hd` creates + description: + The quality of the image that will be generated. `hd` creates images with finer details and greater consistency across the image. This param is only supported for `dall-e-3`. response_format: @@ -18455,7 +19240,8 @@ components: default: url example: url nullable: true - description: The format in which the generated images are returned. Must be one + 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. size: @@ -18469,7 +19255,8 @@ components: default: 1024x1024 example: 1024x1024 nullable: true - description: The size of the generated images. Must be one of `256x256`, + description: + The size of the generated images. Must be one of `256x256`, `512x512`, or `1024x1024` for `dall-e-2`. Must be one of `1024x1024`, `1792x1024`, or `1024x1792` for `dall-e-3` models. style: @@ -18480,7 +19267,8 @@ components: default: vivid example: vivid nullable: true - description: The style of the generated images. Must be one of `vivid` or + description: + The style of the generated images. 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. This param is only @@ -18498,7 +19286,8 @@ components: type: object properties: image: - description: The image to use as the basis for the variation(s). Must be a valid + description: + The image to use as the basis for the variation(s). Must be a valid PNG file, less than 4MB, and square. type: string format: binary @@ -18513,7 +19302,8 @@ components: default: dall-e-2 example: dall-e-2 nullable: true - description: The model to use for image generation. Only `dall-e-2` is supported + description: + The model to use for image generation. Only `dall-e-2` is supported at this time. n: type: integer @@ -18522,7 +19312,8 @@ components: default: 1 example: 1 nullable: true - description: The number of images to generate. Must be between 1 and 10. For + description: + The number of images to generate. Must be between 1 and 10. For `dall-e-3`, only `n=1` is supported. response_format: type: string @@ -18532,7 +19323,8 @@ components: default: url example: url nullable: true - description: The format in which the generated images are returned. Must be one + 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. size: @@ -18544,7 +19336,8 @@ components: default: 1024x1024 example: 1024x1024 nullable: true - description: The size of the generated images. Must be one of `256x256`, + description: + The size of the generated images. Must be one of `256x256`, `512x512`, or `1024x1024`. user: type: string @@ -18583,7 +19376,8 @@ components: description: The text contents of the message. title: Text content - type: array - description: An array of content parts with a defined type, each can be of type + description: + An array of content parts with a defined type, each can be of type `text` or images can be passed with `image_url` or `image_file`. Image types are only supported on [Vision-compatible models](/docs/models). @@ -18612,7 +19406,8 @@ components: - $ref: "#/components/schemas/AssistantToolsCode" - $ref: "#/components/schemas/AssistantToolsFileSearchTypeOnly" x-oaiExpandable: true - description: A list of files attached to the message, and the tools they should + description: + A list of files attached to the message, and the tools they should be added to. required: - file_id @@ -18659,7 +19454,8 @@ components: x-stainless-const: true image_url: type: object - description: Contains either an image URL or a data URL for a base64 encoded + description: + Contains either an image URL or a data URL for a base64 encoded image. properties: url: @@ -18733,68 +19529,80 @@ components: properties: hate: type: boolean - description: Content that expresses, incites, or promotes hate based on race, + description: + Content that expresses, incites, or promotes hate based on race, gender, ethnicity, religion, nationality, sexual orientation, disability status, or caste. Hateful content aimed at non-protected groups (e.g., chess players) is harassment. hate/threatening: type: boolean - description: Hateful content that also includes violence or serious harm towards + description: + Hateful content that also includes violence or serious harm towards the targeted group based on race, gender, ethnicity, religion, nationality, sexual orientation, disability status, or caste. harassment: type: boolean - description: Content that expresses, incites, or promotes harassing language + description: + Content that expresses, incites, or promotes harassing language towards any target. harassment/threatening: type: boolean - description: Harassment content that also includes violence or serious harm + description: + Harassment content that also includes violence or serious harm towards any target. illicit: type: boolean nullable: true - description: Content that includes instructions or advice that facilitate the + description: + Content that includes instructions or advice that facilitate the planning or execution of wrongdoing, or that gives advice or instruction on how to commit illicit acts. For example, "how to shoplift" would fit this category. illicit/violent: type: boolean nullable: true - description: Content that includes instructions or advice that facilitate the + description: + Content that includes instructions or advice that facilitate the planning or execution of wrongdoing that also includes violence, or that gives advice or instruction on the procurement of any weapon. self-harm: type: boolean - description: Content that promotes, encourages, or depicts acts of self-harm, + description: + Content that promotes, encourages, or depicts acts of self-harm, such as suicide, cutting, and eating disorders. self-harm/intent: type: boolean - description: Content where the speaker expresses that they are engaging or + description: + Content where the speaker expresses that they are engaging or intend to engage in acts of self-harm, such as suicide, cutting, and eating disorders. self-harm/instructions: type: boolean - description: Content that encourages performing acts of self-harm, such as + description: + Content that encourages performing acts of self-harm, such as suicide, cutting, and eating disorders, or that gives instructions or advice on how to commit such acts. sexual: type: boolean - description: Content meant to arouse sexual excitement, such as the description + description: + Content meant to arouse sexual excitement, such as the description of sexual activity, or that promotes sexual services (excluding sex education and wellness). sexual/minors: type: boolean - description: Sexual content that includes an individual who is under 18 years + description: + Sexual content that includes an individual who is under 18 years old. violence: type: boolean description: Content that depicts death, violence, or physical injury. violence/graphic: type: boolean - description: Content that depicts death, violence, or physical injury in graphic + description: + Content that depicts death, violence, or physical injury in graphic detail. required: - hate @@ -18812,7 +19620,8 @@ components: - violence/graphic category_scores: type: object - description: A list of the categories along with their scores as predicted by + description: + A list of the categories along with their scores as predicted by model. properties: hate: @@ -18870,7 +19679,8 @@ components: - violence/graphic category_applied_input_types: type: object - description: A list of the categories along with the input type(s) that the + description: + A list of the categories along with the input type(s) that the score applies to. properties: hate: @@ -19133,8 +19943,19 @@ components: $ref: "#/components/schemas/InputItem" include: type: array - description: - $ref: "#/components/schemas/Includable/description" + description: > + Specify additional output data to include in the model response. + Currently + + supported values are: + + - `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. + + - `computer_call_output.output.image_url`: Include image urls + from the computer call output. items: x-oaiExpandable: true $ref: "#/components/schemas/Includable" @@ -19177,11 +19998,13 @@ components: additionalProperties: false properties: assistant_id: - description: The ID of the [assistant](/docs/api-reference/assistants) to use to + description: + The ID of the [assistant](/docs/api-reference/assistants) to use to execute this run. type: string model: - description: The ID of the [Model](/docs/api-reference/models) to be used to + description: + The ID of the [Model](/docs/api-reference/models) to be used to execute this run. If a value is provided here, it will override the model associated with the assistant. If not, the model associated with the assistant will be used. @@ -19201,7 +20024,8 @@ components: type: string nullable: true additional_instructions: - description: Appends additional instructions at the end of the instructions for + description: + Appends additional instructions at the end of the instructions for the run. This is useful for modifying the behavior on a per-run basis without overriding other instructions. type: string @@ -19213,7 +20037,8 @@ components: $ref: "#/components/schemas/CreateMessageRequest" nullable: true tools: - description: Override the tools the assistant can use for this run. This is + description: + Override the tools the assistant can use for this run. This is useful for modifying the behavior on a per-run basis. nullable: true type: array @@ -19301,38 +20126,38 @@ components: properties: model: description: > - One of the available [TTS models](/docs/models#tts): `tts-1` or - `tts-1-hd` + One of the available [TTS models](/docs/models#tts): `tts-1`, + `tts-1-hd` or `gpt-4o-mini-tts`. anyOf: - type: string - type: string enum: - tts-1 - tts-1-hd + - gpt-4o-mini-tts x-oaiTypeLabel: string input: type: string - description: The text to generate audio for. The maximum length is 4096 + description: + The text to generate audio for. The maximum length is 4096 characters. maxLength: 4096 - voice: - description: The voice to use when generating the audio. Supported voices are - `alloy`, `ash`, `coral`, `echo`, `fable`, `onyx`, `nova`, `sage` and - `shimmer`. Previews of the voices are available in the [Text to - speech guide](/docs/guides/text-to-speech#voice-options). + instructions: type: string - enum: - - alloy - - ash - - coral - - echo - - fable - - onyx - - nova - - sage - - shimmer + 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 voices are + `alloy`, `ash`, `ballad`, `coral`, `echo`, `fable`, `onyx`, `nova`, + `sage`, `shimmer`, and `verse`. Previews of the voices are available + in the [Text to speech + guide](/docs/guides/text-to-speech#voice-options). + $ref: "#/components/schemas/VoiceIdsShared" response_format: - description: The format to audio in. Supported formats are `mp3`, `opus`, `aac`, + description: + The format to audio in. Supported formats are `mp3`, `opus`, `aac`, `flac`, `wav`, and `pcm`. default: mp3 type: string @@ -19344,7 +20169,8 @@ components: - wav - pcm speed: - description: The speed of the generated audio. Select a value from `0.25` to + 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 @@ -19359,13 +20185,15 @@ components: additionalProperties: false properties: assistant_id: - description: The ID of the [assistant](/docs/api-reference/assistants) to use to + description: + The ID of the [assistant](/docs/api-reference/assistants) to use to execute this run. type: string thread: $ref: "#/components/schemas/CreateThreadRequest" model: - description: The ID of the [Model](/docs/api-reference/models) to be used to + description: + The ID of the [Model](/docs/api-reference/models) to be used to execute this run. If a value is provided here, it will override the model associated with the assistant. If not, the model associated with the assistant will be used. @@ -19403,12 +20231,14 @@ components: x-oaiTypeLabel: string nullable: true instructions: - description: Override the default system message of the assistant. This is + description: + Override the default system message of the assistant. This is useful for modifying the behavior on a per-run basis. type: string nullable: true tools: - description: Override the tools the assistant can use for this run. This is + description: + Override the tools the assistant can use for this run. This is useful for modifying the behavior on a per-run basis. nullable: true type: array @@ -19532,7 +20362,8 @@ components: additionalProperties: false properties: messages: - description: A list of [messages](/docs/api-reference/messages) to start the + description: + A list of [messages](/docs/api-reference/messages) to start the thread with. type: array items: @@ -19592,12 +20423,14 @@ components: type: string chunking_strategy: type: object - description: The chunking strategy used to chunk the file(s). If not set, will + description: + The chunking strategy used to chunk the file(s). If not set, will use the `auto` strategy. oneOf: - type: object title: Auto Chunking Strategy - description: The default strategy. This strategy currently uses a + description: + The default strategy. This strategy currently uses a `max_chunk_size_tokens` of `800` and `chunk_overlap_tokens` of `400`. additionalProperties: false @@ -19628,7 +20461,8 @@ components: type: integer minimum: 100 maximum: 4096 - description: The maximum number of tokens in each chunk. The default value is + description: + The maximum number of tokens in each chunk. The default value is `800`. The minimum value is `100` and the maximum value is `4096`. chunk_overlap_tokens: @@ -19671,14 +20505,17 @@ components: 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 + ID of the model to use. The options are `gpt-4o-transcribe`, + `gpt-4o-mini-transcribe`, and `whisper-1` (which is powered by our + open source Whisper V2 model). + example: gpt-4o-transcribe anyOf: - type: string - type: string enum: - whisper-1 + - gpt-4o-transcribe + - gpt-4o-mini-transcribe x-stainless-const: true x-oaiTypeLabel: string language: @@ -19705,6 +20542,21 @@ components: 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` and `gpt-4o-mini-transcribe`. + type: array + items: + $ref: "#/components/schemas/TranscriptionInclude" timestamp_granularities[]: description: > The timestamp granularities to populate for this transcription. @@ -19721,17 +20573,46 @@ components: - segment default: - segment + 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 of the Speech-to-Text + guide](/docs/guides/speech-to-text?lang=curl#streaming-transcriptions) + + for more information. + + + Note: Streaming is not supported for the `whisper-1` model and will + be ignored. + type: boolean + nullable: true + default: false required: - file - model CreateTranscriptionResponseJson: type: object - description: Represents a transcription response returned by model, based on the + description: + Represents a transcription response returned by model, based on the provided input. properties: text: type: string description: The transcribed text. + logprobs: + type: array + 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: + $ref: "#/components/schemas/LogProbProperties" required: - text x-oaiMeta: @@ -19741,9 +20622,16 @@ components: { "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." } + CreateTranscriptionResponseStreamEvent: + anyOf: + - $ref: "#/components/schemas/TranscriptTextDeltaEvent" + - $ref: "#/components/schemas/TranscriptTextDoneEvent" + discriminator: + propertyName: type CreateTranscriptionResponseVerboseJson: type: object - description: Represents a verbose json transcription response returned by model, + description: + Represents a verbose json transcription response returned by model, based on the provided input. properties: language: @@ -19826,7 +20714,17 @@ components: should be in English. type: string response_format: - $ref: "#/components/schemas/AudioResponseFormat" + 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 @@ -19911,7 +20809,8 @@ components: additionalProperties: false properties: file_ids: - description: A list of [File](/docs/api-reference/files) IDs that the vector + description: + A list of [File](/docs/api-reference/files) IDs that the vector store should use. Useful for tools like `file_search` that can access files. type: array @@ -19930,7 +20829,8 @@ components: additionalProperties: false properties: file_id: - description: A [File](/docs/api-reference/files) ID that the vector store should + description: + A [File](/docs/api-reference/files) ID that the vector store should use. Useful for tools like `file_search` that can access files. type: string chunking_strategy: @@ -19944,7 +20844,8 @@ components: additionalProperties: false properties: file_ids: - description: A list of [File](/docs/api-reference/files) IDs that the vector + description: + A list of [File](/docs/api-reference/files) IDs that the vector store should use. Useful for tools like `file_search` that can access files. type: array @@ -19958,7 +20859,8 @@ components: $ref: "#/components/schemas/VectorStoreExpirationAfter" chunking_strategy: type: object - description: The chunking strategy used to chunk the file(s). If not set, will + description: + The chunking strategy used to chunk the file(s). If not set, will use the `auto` strategy. Only applicable if `file_ids` is non-empty. oneOf: - $ref: "#/components/schemas/AutoChunkingStrategyRequestParam" @@ -20008,6 +20910,29 @@ components: - id - object - deleted + DeleteFineTuningCheckpointPermissionResponse: + type: object + properties: + id: + type: string + description: + The ID of the fine-tuned model checkpoint permission that was + deleted. + object: + type: string + description: The object type, which is always "checkpoint.permission". + enum: + - checkpoint.permission + x-stainless-const: true + deleted: + type: boolean + description: + Whether the fine-tuned model checkpoint permission was successfully + deleted. + required: + - id + - object + - deleted DeleteMessageResponse: type: object properties: @@ -20298,7 +21223,8 @@ components: required: - event - data - description: Occurs when an [error](/docs/guides/error-codes#api-errors) occurs. + description: + Occurs when an [error](/docs/guides/error-codes#api-errors) occurs. This can happen due to an internal server error or a timeout. x-oaiMeta: dataDescription: "`data` is an [error](/docs/guides/error-codes#api-errors)" @@ -20361,7 +21287,8 @@ components: - index FileSearchRanker: type: string - description: The ranker to use for the file search. If not specified will use + description: + The ranker to use for the file search. If not specified will use the `auto` ranker. enum: - auto @@ -20382,7 +21309,8 @@ components: $ref: "#/components/schemas/FileSearchRanker" score_threshold: type: number - description: The score threshold for the file search. All values must be a + description: + The score threshold for the file search. All values must be a floating point number between 0 and 1. minimum: 0 maximum: 1 @@ -20535,7 +21463,8 @@ components: - role FineTuneChatRequestInput: type: object - description: The per-line training example of a fine-tuning input file for chat + description: + The per-line training example of a fine-tuning input file for chat models using the supervised method. properties: messages: @@ -20703,7 +21632,8 @@ components: $ref: "#/components/schemas/FineTuneDPOMethod" FineTunePreferenceRequestInput: type: object - description: The per-line training example of a fine-tuning input file for chat + description: + The per-line training example of a fine-tuning input file for chat models using the dpo method. properties: input: @@ -20813,6 +21743,44 @@ components: minimum: 1 maximum: 50 default: auto + FineTuningCheckpointPermission: + type: object + title: FineTuningCheckpointPermission + description: > + The `checkpoint.permission` object represents a permission for a + fine-tuned model checkpoint. + properties: + id: + type: string + description: + The permission identifier, which can be referenced in the API + endpoints. + created_at: + type: integer + description: The Unix timestamp (in seconds) for when the permission was created. + project_id: + type: string + description: The project identifier that the permission is for. + object: + type: string + description: The object type, which is always "checkpoint.permission". + enum: + - checkpoint.permission + x-stainless-const: true + required: + - created_at + - id + - object + - project_id + x-oaiMeta: + name: The fine-tuned model checkpoint permission object + example: | + { + "object": "checkpoint.permission", + "id": "cp_zc4Q7MP6XxulcVzj4MZdwsAB", + "created_at": 1712211699, + "project_id": "proj_abGMw1llN8IrBb6SvvY5A1iH" + } FineTuningIntegration: type: object title: Fine-Tuning Job Integration @@ -20883,12 +21851,14 @@ components: description: The object identifier, which can be referenced in the API endpoints. created_at: type: integer - description: The Unix timestamp (in seconds) for when the fine-tuning job was + description: + The Unix timestamp (in seconds) for when the fine-tuning job was created. error: type: object nullable: true - description: For fine-tuning jobs that have `failed`, this will contain more + description: + For fine-tuning jobs that have `failed`, this will contain more information on the cause of the failure. properties: code: @@ -20899,7 +21869,8 @@ components: description: A human-readable error message. param: type: string - description: The parameter that was invalid, usually `training_file` or + description: + The parameter that was invalid, usually `training_file` or `validation_file`. This field will be null if the failure was not parameter-specific. nullable: true @@ -20910,17 +21881,20 @@ components: fine_tuned_model: type: string nullable: true - description: The name of the fine-tuned model that is being created. The value + description: + The name of the fine-tuned model that is being created. The value will be null if the fine-tuning job is still running. finished_at: type: integer nullable: true - description: The Unix timestamp (in seconds) for when the fine-tuning job was + description: + The Unix timestamp (in seconds) for when the fine-tuning job was finished. The value will be null if the fine-tuning job is still running. hyperparameters: type: object - description: The hyperparameters used for the fine-tuning job. This value will + description: + The hyperparameters used for the fine-tuning job. This value will only be returned when running `supervised` jobs. properties: batch_size: @@ -20982,7 +21956,8 @@ components: description: The organization that owns the fine-tuning job. result_files: type: array - description: The compiled results file ID(s) for the fine-tuning job. You can + description: + The compiled results file ID(s) for the fine-tuning job. You can retrieve the results with the [Files API](/docs/api-reference/files/retrieve-contents). items: @@ -20990,7 +21965,8 @@ components: example: file-abc123 status: type: string - description: The current status of the fine-tuning job, which can be either + description: + The current status of the fine-tuning job, which can be either `validating_files`, `queued`, `running`, `succeeded`, `failed`, or `cancelled`. enum: @@ -21003,16 +21979,19 @@ components: trained_tokens: type: integer nullable: true - description: The total number of billable tokens processed by this fine-tuning + description: + The total number of billable tokens processed by this fine-tuning job. The value will be null if the fine-tuning job is still running. training_file: type: string - description: The file ID used for training. You can retrieve the training data + description: + The file ID used for training. You can retrieve the training data with the [Files API](/docs/api-reference/files/retrieve-contents). validation_file: type: string nullable: true - description: The file ID used for validation. You can retrieve the validation + description: + The file ID used for validation. You can retrieve the validation results with the [Files API](/docs/api-reference/files/retrieve-contents). integrations: @@ -21030,7 +22009,8 @@ components: estimated_finish: type: integer nullable: true - description: The Unix timestamp (in seconds) for when the fine-tuning job is + description: + The Unix timestamp (in seconds) for when the fine-tuning job is estimated to finish. The value will be null if the fine-tuning job is not running. method: @@ -21102,7 +22082,8 @@ components: properties: id: type: string - description: The checkpoint identifier, which can be referenced in the API + description: + The checkpoint identifier, which can be referenced in the API endpoints. created_at: type: integer @@ -21133,7 +22114,8 @@ components: type: number fine_tuning_job_id: type: string - description: The name of the fine-tuning job that this checkpoint was created + description: + The name of the fine-tuning job that this checkpoint was created from. object: type: string @@ -21184,7 +22166,8 @@ components: description: The object identifier. created_at: type: integer - description: The Unix timestamp (in seconds) for when the fine-tuning job was + description: + The Unix timestamp (in seconds) for when the fine-tuning job was created. level: type: string @@ -21228,11 +22211,13 @@ components: properties: description: type: string - description: A description of what the function does, used by the model to + 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 + 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" @@ -21240,7 +22225,8 @@ components: type: boolean nullable: true default: false - description: Whether to enable strict schema adherence when generating the + 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 @@ -21344,7 +22330,6 @@ components: - completed - incomplete required: - - id - type - call_id - name @@ -21402,9 +22387,21 @@ components: The unique ID of the function call tool output. required: - id + FunctionToolCallResource: + allOf: + - $ref: "#/components/schemas/FunctionToolCall" + - type: object + properties: + id: + type: string + description: | + The unique ID of the function tool call. + required: + - id Image: type: object - description: Represents the url or the content of an image generated by the + description: + Represents the url or the content of an image generated by the OpenAI API. properties: b64_json: @@ -21413,11 +22410,13 @@ components: `response_format` is `b64_json`. url: type: string - description: The URL of the generated image, if `response_format` is `url` + description: + The URL of the generated image, if `response_format` is `url` (default). revised_prompt: type: string - description: The prompt that was used to generate the image, if there was any + description: + The prompt that was used to generate the image, if there was any revision to the prompt. x-oaiMeta: name: The image object @@ -21699,7 +22698,8 @@ components: description: The Unix timestamp (in seconds) of when the invite was accepted. projects: type: array - description: The projects that were granted membership upon acceptance of the + description: + The projects that were granted membership upon acceptance of the invite. items: type: object @@ -21778,7 +22778,8 @@ components: description: The last `invite_id` in the retrieved `list` has_more: type: boolean - description: The `has_more` property is used for pagination to indicate there + description: + The `has_more` property is used for pagination to indicate there are additional results. required: - object @@ -21797,7 +22798,8 @@ components: description: "`owner` or `reader`" projects: type: array - description: An array of projects to which membership is granted at the same + description: + An array of projects to which membership is granted at the same time the org invite is accepted. If omitted, the user will be invited to the default project for compatibility with legacy behavior. @@ -21866,7 +22868,7 @@ components: - $ref: "#/components/schemas/ComputerToolCall" - $ref: "#/components/schemas/ComputerToolCallOutputResource" - $ref: "#/components/schemas/WebSearchToolCall" - - $ref: "#/components/schemas/FunctionToolCall" + - $ref: "#/components/schemas/FunctionToolCallResource" - $ref: "#/components/schemas/FunctionToolCallOutputResource" x-oaiExpandable: true discriminator: @@ -22057,6 +23059,30 @@ components: - first_id - last_id - has_more + ListFineTuningCheckpointPermissionResponse: + type: object + properties: + data: + type: array + items: + $ref: "#/components/schemas/FineTuningCheckpointPermission" + object: + type: string + enum: + - list + x-stainless-const: true + first_id: + type: string + nullable: true + last_id: + type: string + nullable: true + has_more: + type: boolean + required: + - object + - data + - has_more ListFineTuningJobCheckpointsResponse: type: object properties: @@ -22326,13 +23352,15 @@ components: type: object properties: file_id: - description: The [File](/docs/api-reference/files) ID of the image in the + description: + The [File](/docs/api-reference/files) ID of the image in the message content. Set `purpose="vision"` when uploading the File if you need to later display the file content. type: string detail: type: string - description: Specifies the detail level of the image if specified by the user. + description: + Specifies the detail level of the image if specified by the user. `low` uses fewer tokens, you can opt in to high resolution using `high`. enum: @@ -22361,12 +23389,14 @@ components: properties: url: type: string - description: "The external URL of the image, must be a supported image types: + description: + "The external URL of the image, must be a supported image types: jpeg, jpg, png, gif, webp." format: uri detail: type: string - description: Specifies the detail level of the image. `low` uses fewer tokens, + description: + Specifies the detail level of the image. `low` uses fewer tokens, you can opt in to high resolution using `high`. Default value is `auto` enum: @@ -22399,7 +23429,8 @@ components: MessageContentTextAnnotationsFileCitationObject: title: File citation type: object - description: A citation within the message that points to a specific quote from + description: + A citation within the message that points to a specific quote from a specific File associated with the assistant or the message. Generated when the assistant uses the "file_search" tool to search files. properties: @@ -22435,7 +23466,8 @@ components: MessageContentTextAnnotationsFilePathObject: title: File path type: object - description: A URL for the file that's generated when the assistant used the + description: + A URL for the file that's generated when the assistant used the `code_interpreter` tool to generate a file. properties: type: @@ -22516,13 +23548,15 @@ components: type: object properties: file_id: - description: The [File](/docs/api-reference/files) ID of the image in the + description: + The [File](/docs/api-reference/files) ID of the image in the message content. Set `purpose="vision"` when uploading the File if you need to later display the file content. type: string detail: type: string - description: Specifies the detail level of the image if specified by the user. + description: + Specifies the detail level of the image if specified by the user. `low` uses fewer tokens, you can opt in to high resolution using `high`. enum: @@ -22551,12 +23585,14 @@ components: type: object properties: url: - description: "The URL of the image, must be a supported image types: jpeg, jpg, + description: + "The URL of the image, must be a supported image types: jpeg, jpg, png, gif, webp." type: string detail: type: string - description: Specifies the detail level of the image. `low` uses fewer tokens, + description: + Specifies the detail level of the image. `low` uses fewer tokens, you can opt in to high resolution using `high`. enum: - auto @@ -22588,7 +23624,8 @@ components: MessageDeltaContentTextAnnotationsFileCitationObject: title: File citation type: object - description: A citation within the message that points to a specific quote from + description: + A citation within the message that points to a specific quote from a specific File associated with the assistant or the message. Generated when the assistant uses the "file_search" tool to search files. properties: @@ -22625,7 +23662,8 @@ components: MessageDeltaContentTextAnnotationsFilePathObject: title: File path type: object - description: A URL for the file that's generated when the assistant used the + description: + A URL for the file that's generated when the assistant used the `code_interpreter` tool to generate a file. properties: index: @@ -22679,7 +23717,8 @@ components: type: array items: oneOf: - - $ref: "#/components/schemas/MessageDeltaContentTextAnnotationsFileCitationObjec\ + - $ref: + "#/components/schemas/MessageDeltaContentTextAnnotationsFileCitationObjec\ t" - $ref: "#/components/schemas/MessageDeltaContentTextAnnotationsFilePathObject" x-oaiExpandable: true @@ -22694,7 +23733,8 @@ components: streaming. properties: id: - description: The identifier of the message, which can be referenced in API + description: + The identifier of the message, which can be referenced in API endpoints. type: string object: @@ -22762,11 +23802,13 @@ components: description: The Unix timestamp (in seconds) for when the message was created. type: integer thread_id: - description: The [thread](/docs/api-reference/threads) ID that this message + description: + The [thread](/docs/api-reference/threads) ID that this message belongs to. type: string status: - description: The status of the message, which can be either `in_progress`, + description: + The status of the message, which can be either `in_progress`, `incomplete`, or `completed`. type: string enum: @@ -22774,7 +23816,8 @@ components: - incomplete - completed incomplete_details: - description: On an incomplete message, details about why the message is + description: + On an incomplete message, details about why the message is incomplete. type: object properties: @@ -22795,7 +23838,8 @@ components: type: integer nullable: true incomplete_at: - description: The Unix timestamp (in seconds) for when the message was marked as + description: + The Unix timestamp (in seconds) for when the message was marked as incomplete. type: integer nullable: true @@ -22822,7 +23866,8 @@ components: type: string nullable: true run_id: - description: The ID of the [run](/docs/api-reference/runs) associated with the + description: + The ID of the [run](/docs/api-reference/runs) associated with the creation of this message. Value is `null` when messages are created manually using the create message or create thread endpoints. type: string @@ -22843,7 +23888,8 @@ components: - $ref: "#/components/schemas/AssistantToolsCode" - $ref: "#/components/schemas/AssistantToolsFileSearchTypeOnly" x-oaiExpandable: true - description: A list of files attached to the message, and the tools they were + description: + A list of files attached to the message, and the tools they were added to. nullable: true metadata: @@ -22918,7 +23964,8 @@ components: required: - event - data - description: Occurs when a [message](/docs/api-reference/messages/object) is + description: + Occurs when a [message](/docs/api-reference/messages/object) is created. x-oaiMeta: dataDescription: "`data` is a [message](/docs/api-reference/messages/object)" @@ -22934,7 +23981,8 @@ components: required: - event - data - description: Occurs when a [message](/docs/api-reference/messages/object) moves + description: + Occurs when a [message](/docs/api-reference/messages/object) moves to an `in_progress` state. x-oaiMeta: dataDescription: "`data` is a [message](/docs/api-reference/messages/object)" @@ -22968,7 +24016,8 @@ components: required: - event - data - description: Occurs when a [message](/docs/api-reference/messages/object) is + description: + Occurs when a [message](/docs/api-reference/messages/object) is completed. x-oaiMeta: dataDescription: "`data` is a [message](/docs/api-reference/messages/object)" @@ -22984,7 +24033,8 @@ components: required: - event - data - description: Occurs when a [message](/docs/api-reference/messages/object) ends + description: + Occurs when a [message](/docs/api-reference/messages/object) ends before it is completed. x-oaiMeta: dataDescription: "`data` is a [message](/docs/api-reference/messages/object)" @@ -23041,10 +24091,27 @@ components: "owned_by": "openai" } ModelIds: + anyOf: + - $ref: "#/components/schemas/ModelIdsShared" + - $ref: "#/components/schemas/ModelIdsResponses" + ModelIdsResponses: + example: gpt-4o + anyOf: + - $ref: "#/components/schemas/ModelIdsShared" + - type: string + enum: + - o1-pro + - o1-pro-2025-03-19 + - computer-use-preview + - computer-use-preview-2025-03-11 + ModelIdsShared: + example: gpt-4o anyOf: - type: string - type: string enum: + - o3-mini + - o3-mini-2025-01-31 - o1 - o1-2024-12-17 - o1-preview @@ -23064,8 +24131,6 @@ components: - gpt-4o-mini-search-preview - gpt-4o-search-preview-2025-03-11 - gpt-4o-mini-search-preview-2025-03-11 - - computer-use-preview - - computer-use-preview-2025-03-11 - chatgpt-4o-latest - gpt-4o-mini - gpt-4o-mini-2024-07-18 @@ -23091,68 +24156,6 @@ components: ModelResponseProperties: type: object properties: - model: - description: > - Model ID used to generate the response, like `gpt-4o` or `o1`. - OpenAI - - offers a wide range of models with different capabilities, - performance - - characteristics, and price points. Refer to the [model - guide](/docs/models) - - to browse and compare available models. - example: gpt-4o - anyOf: - - type: string - - type: string - enum: - - 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 - - computer-use-preview - - computer-use-preview-2025-02-04 - - computer-use-preview-2025-03-11 - - gpt-4.5-preview - - gpt-4.5-preview-2025-02-27 - - 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-mini-audio-preview - - gpt-4o-mini-audio-preview-2024-12-17 - - chatgpt-4o-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 - x-oaiTypeLabel: string metadata: $ref: "#/components/schemas/Metadata" temperature: @@ -23431,7 +24434,8 @@ components: status: type: string deprecated: true - description: Deprecated. The current status of the file, which can be either + description: + Deprecated. The current status of the file, which can be either `uploaded`, `processed`, or `error`. enum: - uploaded @@ -23440,7 +24444,8 @@ components: status_details: type: string deprecated: true - description: Deprecated. For details on why a fine-tuning training file failed + description: + Deprecated. For details on why a fine-tuning training file failed validation, see the `error` field on `fine_tuning.job`. required: - id @@ -23465,7 +24470,8 @@ components: OtherChunkingStrategyResponseParam: type: object title: Other Chunking Strategy - description: This is returned when the chunking strategy is unknown. Typically, + description: + This is returned when the chunking strategy is unknown. Typically, this is because the file was indexed before the `chunking_strategy` concept was introduced in the API. additionalProperties: false @@ -23637,7 +24643,8 @@ components: 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 + description: + An array of content parts with a defined type. Supported options differ based on the [model](/docs/models) being used to generate the response. Can contain text inputs. title: Array of content parts @@ -23666,7 +24673,8 @@ components: archived_at: type: integer nullable: true - description: The Unix timestamp (in seconds) of when the project was archived or + description: + The Unix timestamp (in seconds) of when the project was archived or `null`. status: type: string @@ -23853,14 +24861,16 @@ components: description: The maximum images per minute. Only present for relevant models. max_audio_megabytes_per_1_minute: type: integer - description: The maximum audio megabytes per minute. Only present for relevant + description: + The maximum audio megabytes per minute. Only present for relevant models. max_requests_per_1_day: type: integer description: The maximum requests per day. Only present for relevant models. batch_1_day_max_input_tokens: type: integer - description: The maximum batch input tokens per day. Only present for relevant + description: + The maximum batch input tokens per day. Only present for relevant models. required: - object @@ -23917,14 +24927,16 @@ components: description: The maximum images per minute. Only relevant for certain models. max_audio_megabytes_per_1_minute: type: integer - description: The maximum audio megabytes per minute. Only relevant for certain + description: + The maximum audio megabytes per minute. Only relevant for certain models. max_requests_per_1_day: type: integer description: The maximum requests per day. Only relevant for certain models. batch_1_day_max_input_tokens: type: integer - description: The maximum batch input tokens per day. Only relevant for certain + description: + The maximum batch input tokens per day. Only relevant for certain models. ProjectServiceAccount: type: object @@ -23951,7 +24963,8 @@ components: description: "`owner` or `member`" created_at: type: integer - description: The Unix timestamp (in seconds) of when the service account was + description: + The Unix timestamp (in seconds) of when the service account was created required: - object @@ -24187,6 +25200,23 @@ components: description: "`owner` or `member`" required: - role + RealtimeClientEvent: + discriminator: + propertyName: type + description: | + A realtime client event. + anyOf: + - $ref: "#/components/schemas/RealtimeClientEventConversationItemCreate" + - $ref: "#/components/schemas/RealtimeClientEventConversationItemDelete" + - $ref: "#/components/schemas/RealtimeClientEventConversationItemRetrieve" + - $ref: "#/components/schemas/RealtimeClientEventConversationItemTruncate" + - $ref: "#/components/schemas/RealtimeClientEventInputAudioBufferAppend" + - $ref: "#/components/schemas/RealtimeClientEventInputAudioBufferClear" + - $ref: "#/components/schemas/RealtimeClientEventInputAudioBufferCommit" + - $ref: "#/components/schemas/RealtimeClientEventResponseCancel" + - $ref: "#/components/schemas/RealtimeClientEventResponseCreate" + - $ref: "#/components/schemas/RealtimeClientEventSessionUpdate" + - $ref: "#/components/schemas/RealtimeClientEventTranscriptionSessionUpdate" RealtimeClientEventConversationItemCreate: type: object description: > @@ -24295,6 +25325,44 @@ components: "type": "conversation.item.delete", "item_id": "msg_003" } + RealtimeClientEventConversationItemRetrieve: + type: object + description: > + Send this event when you want to retrieve the server's representation of + a specific item in the conversation history. This is useful, for + example, to inspect user audio after noise cancellation and VAD. + + The server will respond with a `conversation.item.retrieved` event, + + unless the item does not exist in the conversation history, in which + case the + + server will respond with an error. + properties: + event_id: + type: string + description: Optional client-generated ID used to identify this event. + type: + type: string + enum: + - conversation.item.retrieve + description: The event type, must be `conversation.item.retrieve`. + x-stainless-const: true + item_id: + type: string + description: The ID of the item to retrieve. + required: + - type + - item_id + x-oaiMeta: + name: conversation.item.retrieve + group: realtime + example: | + { + "event_id": "event_901", + "type": "conversation.item.retrieve", + "item_id": "msg_003" + } RealtimeClientEventConversationItemTruncate: type: object description: > @@ -24322,7 +25390,7 @@ components: If successful, the server will respond with a `conversation.item.truncated` - event. + event. properties: event_id: type: string @@ -24693,6 +25761,53 @@ components: "max_response_output_tokens": "inf" } } + RealtimeClientEventTranscriptionSessionUpdate: + type: object + description: | + Send this event to update a transcription session. + properties: + event_id: + type: string + description: Optional client-generated ID used to identify this event. + type: + type: string + enum: + - transcription_session.update + description: The event type, must be `transcription_session.update`. + x-stainless-const: true + session: + $ref: "#/components/schemas/RealtimeTranscriptionSessionCreateRequest" + required: + - type + - session + x-oaiMeta: + name: transcription_session.update + group: realtime + example: | + { + "type": "transcription_session.update", + "session": { + "input_audio_format": "pcm16", + "input_audio_transcription": { + "model": "gpt-4o-transcribe", + "prompt": "", + "language": "" + }, + "turn_detection": { + "type": "server_vad", + "threshold": 0.5, + "prefix_padding_ms": 300, + "silence_duration_ms": 500, + "create_response": true, + }, + "input_audio_noise_reduction": { + "type": "near_field" + }, + "include": [ + "item.input_audio_transcription.logprobs", + ] + } + } RealtimeConversationItem: type: object x-oaiExpandable: true @@ -25125,23 +26240,14 @@ components: the `conversation_id` will be an id like `conv_1234`. type: string voice: - type: string - enum: - - alloy - - ash - - ballad - - coral - - echo - - sage - - shimmer - - verse + $ref: "#/components/schemas/VoiceIdsShared" description: > The voice the model used to respond. - Current voice options are `alloy`, `ash`, `ballad`, `coral`, `echo` - `sage`, + Current voice options are `alloy`, `ash`, `ballad`, `coral`, `echo`, + `fable`, - `shimmer` and `verse`. + `onyx`, `nova`, `sage`, `shimmer`, and `verse`. modalities: type: array description: > @@ -25229,16 +26335,7 @@ components: start of the session. voice: - type: string - enum: - - alloy - - ash - - ballad - - coral - - echo - - sage - - shimmer - - verse + $ref: "#/components/schemas/VoiceIdsShared" description: > The voice the model uses to respond. Voice cannot be changed during the @@ -25246,9 +26343,10 @@ components: session once the model has responded with audio at least once. Current - voice options are `alloy`, `ash`, `ballad`, `coral`, `echo` `sage`, + voice options are `alloy`, `ash`, `ballad`, `coral`, `echo`, + `fable`, - `shimmer` and `verse`. + `onyx`, `nova`, `sage`, `shimmer`, and `verse`. output_audio_format: type: string enum: @@ -25348,6 +26446,53 @@ components: conversation. items: $ref: "#/components/schemas/RealtimeConversationItemWithReference" + RealtimeServerEvent: + discriminator: + propertyName: type + description: | + A realtime server event. + anyOf: + - $ref: "#/components/schemas/RealtimeServerEventConversationCreated" + - $ref: "#/components/schemas/RealtimeServerEventConversationItemCreated" + - $ref: "#/components/schemas/RealtimeServerEventConversationItemDeleted" + - $ref: + "#/components/schemas/RealtimeServerEventConversationItemInputAudioTransc\ + riptionCompleted" + - $ref: + "#/components/schemas/RealtimeServerEventConversationItemInputAudioTransc\ + riptionDelta" + - $ref: + "#/components/schemas/RealtimeServerEventConversationItemInputAudioTransc\ + riptionFailed" + - $ref: "#/components/schemas/RealtimeServerEventConversationItemRetrieved" + - $ref: "#/components/schemas/RealtimeServerEventConversationItemTruncated" + - $ref: "#/components/schemas/RealtimeServerEventError" + - $ref: "#/components/schemas/RealtimeServerEventInputAudioBufferCleared" + - $ref: "#/components/schemas/RealtimeServerEventInputAudioBufferCommitted" + - $ref: "#/components/schemas/RealtimeServerEventInputAudioBufferSpeechStarted" + - $ref: "#/components/schemas/RealtimeServerEventInputAudioBufferSpeechStopped" + - $ref: "#/components/schemas/RealtimeServerEventRateLimitsUpdated" + - $ref: "#/components/schemas/RealtimeServerEventResponseAudioDelta" + - $ref: "#/components/schemas/RealtimeServerEventResponseAudioDone" + - $ref: "#/components/schemas/RealtimeServerEventResponseAudioTranscriptDelta" + - $ref: "#/components/schemas/RealtimeServerEventResponseAudioTranscriptDone" + - $ref: "#/components/schemas/RealtimeServerEventResponseContentPartAdded" + - $ref: "#/components/schemas/RealtimeServerEventResponseContentPartDone" + - $ref: "#/components/schemas/RealtimeServerEventResponseCreated" + - $ref: "#/components/schemas/RealtimeServerEventResponseDone" + - $ref: + "#/components/schemas/RealtimeServerEventResponseFunctionCallArgumentsDel\ + ta" + - $ref: + "#/components/schemas/RealtimeServerEventResponseFunctionCallArgumentsDon\ + e" + - $ref: "#/components/schemas/RealtimeServerEventResponseOutputItemAdded" + - $ref: "#/components/schemas/RealtimeServerEventResponseOutputItemDone" + - $ref: "#/components/schemas/RealtimeServerEventResponseTextDelta" + - $ref: "#/components/schemas/RealtimeServerEventResponseTextDone" + - $ref: "#/components/schemas/RealtimeServerEventSessionCreated" + - $ref: "#/components/schemas/RealtimeServerEventSessionUpdated" + - $ref: "#/components/schemas/RealtimeServerEventTranscriptionSessionUpdated" RealtimeServerEventConversationCreated: type: object description: > @@ -25393,9 +26538,7 @@ components: type: object description: > Returned when a conversation item is created. There are several - scenarios that - - produce this event: + scenarios that produce this event: - The server is generating a Response, which if successful will produce either one or two Items, which will be of type `message` (role `assistant`) or type `function_call`. @@ -25442,13 +26585,7 @@ components: "type": "message", "status": "completed", "role": "user", - "content": [ - { - "type": "input_audio", - "transcript": "hello how are you", - "audio": "base64encodedaudio==" - } - ] + "content": [] } } RealtimeServerEventConversationItemDeleted: @@ -25535,6 +26672,12 @@ components: transcript: type: string description: The transcribed text. + logprobs: + type: array + description: The log probabilities of the transcription. + nullable: true + items: + $ref: "#/components/schemas/LogProbProperties" required: - event_id - type @@ -25552,6 +26695,52 @@ components: "content_index": 0, "transcript": "Hello, how are you?" } + RealtimeServerEventConversationItemInputAudioTranscriptionDelta: + type: object + description: > + Returned when the text value of an input audio transcription content + part is updated. + properties: + event_id: + type: string + description: The unique ID of the server event. + type: + type: string + enum: + - conversation.item.input_audio_transcription.delta + description: The event type, must be + `conversation.item.input_audio_transcription.delta`. + x-stainless-const: true + item_id: + type: string + description: The ID of the item. + content_index: + type: integer + description: The index of the content part in the item's content array. + delta: + type: string + description: The text delta. + logprobs: + type: array + description: The log probabilities of the transcription. + nullable: true + items: + $ref: "#/components/schemas/LogProbProperties" + required: + - event_id + - type + - item_id + x-oaiMeta: + name: conversation.item.input_audio_transcription.delta + group: realtime + example: | + { + "type": "conversation.item.input_audio_transcription.delta", + "event_id": "event_001", + "item_id": "item_001", + "content_index": 0, + "delta": "Hello" + } RealtimeServerEventConversationItemInputAudioTranscriptionFailed: type: object description: > @@ -25617,6 +26806,50 @@ components: "param": null } } + RealtimeServerEventConversationItemRetrieved: + type: object + description: > + Returned when a conversation item is retrieved with + `conversation.item.retrieve`. + properties: + event_id: + type: string + description: The unique ID of the server event. + type: + type: string + enum: + - conversation.item.retrieved + description: The event type, must be `conversation.item.retrieved`. + x-stainless-const: true + item: + $ref: "#/components/schemas/RealtimeConversationItem" + required: + - event_id + - type + - item + x-oaiMeta: + name: conversation.item.retrieved + group: realtime + example: | + { + "event_id": "event_1920", + "type": "conversation.item.created", + "previous_item_id": "msg_002", + "item": { + "id": "msg_003", + "object": "realtime.item", + "type": "message", + "status": "completed", + "role": "user", + "content": [ + { + "type": "input_audio", + "transcript": "hello how are you", + "audio": "base64encodedaudio==" + } + ] + } + } RealtimeServerEventConversationItemTruncated: type: object description: > @@ -26796,7 +28029,7 @@ components: "session": { "id": "sess_001", "object": "realtime.session", - "model": "gpt-4o-realtime-preview-2024-12-17", + "model": "gpt-4o-realtime-preview", "modalities": ["text", "audio"], "instructions": "...model instructions here...", "voice": "sage", @@ -26848,7 +28081,7 @@ components: "session": { "id": "sess_001", "object": "realtime.session", - "model": "gpt-4o-realtime-preview-2024-12-17", + "model": "gpt-4o-realtime-preview", "modalities": ["text"], "instructions": "New instructions", "voice": "sage", @@ -26864,79 +28097,110 @@ components: "max_response_output_tokens": 200 } } + RealtimeServerEventTranscriptionSessionUpdated: + type: object + description: > + Returned when a transcription session is updated with a + `transcription_session.update` event, unless + + there is an error. + properties: + event_id: + type: string + description: The unique ID of the server event. + type: + type: string + enum: + - transcription_session.updated + description: The event type, must be `transcription_session.updated`. + x-stainless-const: true + session: + $ref: "#/components/schemas/RealtimeTranscriptionSessionCreateResponse" + required: + - event_id + - type + - session + x-oaiMeta: + name: transcription_session.updated + group: realtime + example: | + { + "event_id": "event_5678", + "type": "transcription_session.updated", + "session": { + "id": "sess_001", + "object": "realtime.transcription_session", + "input_audio_format": "pcm16", + "input_audio_transcription": { + "model": "gpt-4o-transcribe", + "prompt": "", + "language": "" + }, + "turn_detection": { + "type": "server_vad", + "threshold": 0.5, + "prefix_padding_ms": 300, + "silence_duration_ms": 500, + "create_response": true, + // "interrupt_response": false -- this will NOT be returned + }, + "input_audio_noise_reduction": { + "type": "near_field" + }, + "include": [ + "item.input_audio_transcription.avg_logprob", + ], + } + } RealtimeSession: type: object description: Realtime session object configuration. properties: id: type: string - description: | - Unique identifier for the session object. + description: > + Unique identifier for the session that looks like + `sess_1234567890abcdef`. modalities: description: | The set of modalities the model can respond with. To disable audio, set this to ["text"]. items: type: string + default: + - text + - audio enum: - text - audio model: + type: string description: | The Realtime model used for this session. - anyOf: - - type: string - - type: string - enum: - - gpt-4o-realtime-preview - - gpt-4o-realtime-preview-2024-10-01 - - gpt-4o-realtime-preview-2024-12-17 - - gpt-4o-mini-realtime-preview - - gpt-4o-mini-realtime-preview-2024-12-17 + enum: + - gpt-4o-realtime-preview + - gpt-4o-realtime-preview-2024-10-01 + - gpt-4o-realtime-preview-2024-12-17 + - gpt-4o-mini-realtime-preview + - gpt-4o-mini-realtime-preview-2024-12-17 instructions: type: string description: > The default system instructions (i.e. system message) prepended to - model - - calls. This field allows the client to guide the model on desired - - responses. The model can be instructed on response content and - format, - - (e.g. "be extremely succinct", "act friendly", "here are examples of - good - - responses") and on audio behavior (e.g. "talk quickly", "inject - emotion - - into your voice", "laugh frequently"). The instructions are not - guaranteed - - to be followed by the model, but they provide guidance to the model - on the - - desired behavior. + model calls. This field allows the client to guide the model on + desired responses. The model can be instructed on response content + and format, (e.g. "be extremely succinct", "act friendly", "here + are examples of good responses") and on audio behavior (e.g. "talk + quickly", "inject emotion into your voice", "laugh frequently"). + The instructions are not guaranteed to be followed by the model, + but they provide guidance to the model on the desired behavior. Note that the server sets default instructions which will be used if - this - - field is not set and are visible in the `session.created` event at - the - - start of the session. + this field is not set and are visible in the `session.created` + event at the start of the session. voice: - type: string - enum: - - alloy - - ash - - ballad - - coral - - echo - - sage - - shimmer - - verse + $ref: "#/components/schemas/VoiceIdsShared" description: > The voice the model uses to respond. Voice cannot be changed during the @@ -26949,6 +28213,7 @@ components: `shimmer` and `verse`. input_audio_format: type: string + default: pcm16 enum: - pcm16 - g711_ulaw @@ -26962,6 +28227,7 @@ components: single channel (mono), and little-endian byte order. output_audio_format: type: string + default: pcm16 enum: - pcm16 - g711_ulaw @@ -26975,50 +28241,87 @@ components: type: object description: > Configuration for input audio transcription, defaults to off and can - be - - set to `null` to turn off once on. Input audio transcription is not - native - - to the model, since the model consumes audio directly. Transcription - runs - - asynchronously through Whisper and should be treated as rough - guidance - - rather than the representation understood by the model. + be set to `null` to turn off once on. Input audio transcription is + not native to the model, since the model consumes audio directly. + Transcription runs asynchronously through [the + /audio/transcriptions + endpoint](https://platform.openai.com/docs/api-reference/audio/createTranscription) + and should be treated as guidance of input audio content rather than + precisely what the model heard. The client can optionally set the + language and prompt for transcription, these offer additional + guidance to the transcription service. properties: model: type: string description: > - The model to use for transcription, `whisper-1` is the only - currently + The model to use for transcription, current options are + `gpt-4o-transcribe`, `gpt-4o-mini-transcribe`, and `whisper-1`. + language: + type: string + description: > + The language of the input audio. Supplying the input language in - supported model. + [ISO-639-1](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes) + (e.g. `en`) format + + will improve accuracy and latency. + prompt: + type: string + description: > + An optional text to guide the model's style or continue a + previous audio + + segment. + + For `whisper-1`, the [prompt is a list of + keywords](/docs/guides/speech-to-text#prompting). + + For `gpt-4o-transcribe` models, the prompt is a free text + string, for example "expect words related to technology". turn_detection: type: object - nullable: true description: > - Configuration for turn detection. Can be set to `null` to turn off. - Server + Configuration for turn detection, ether Server VAD or Semantic VAD. + This can be set to `null` to turn off, in which case the client must + manually trigger model response. - VAD means that the model will detect the start and end of speech - based on + Server VAD means that the model will detect the start and end of + speech based on audio volume and respond at the end of user speech. - audio volume and respond at the end of user speech. + Semantic VAD is more advanced and uses a turn detection model (in + conjuction with VAD) to semantically estimate whether the user has + finished speaking, then dynamically sets a timeout based on this + probability. For example, if user audio trails off with "uhhm", the + model will score a low probability of turn end and wait longer for + the user to continue speaking. This can be useful for more natural + conversations, but may have a higher latency. properties: type: type: string + default: server_vad enum: - server_vad + - semantic_vad + description: | + Type of turn detection. + eagerness: + type: string + default: auto + enum: + - low + - medium + - high + - auto description: > - Type of turn detection, only `server_vad` is currently supported. - x-stainless-const: true + Used only for `semantic_vad` mode. The eagerness of the model to + respond. `low` will wait longer for the user to continue + speaking, `high` will respond more quickly. `auto` is the + default and is equivalent to `medium`. threshold: type: number description: > - Activation threshold for VAD (0.0 to 1.0), this defaults to 0.5. - A + Used only for `server_vad` mode. Activation threshold for VAD + (0.0 to 1.0), this defaults to 0.5. A higher threshold will require louder audio to activate the model, and @@ -27026,14 +28329,16 @@ components: thus might perform better in noisy environments. prefix_padding_ms: type: integer - description: | - Amount of audio to include before the VAD detected speech (in + description: > + Used only for `server_vad` mode. Amount of audio to include + before the VAD detected speech (in + milliseconds). Defaults to 300ms. silence_duration_ms: type: integer description: > - Duration of silence to detect speech stop (in milliseconds). - Defaults + Used only for `server_vad` mode. Duration of silence to detect + speech stop (in milliseconds). Defaults to 500ms. With shorter values the model will respond more quickly, @@ -27044,7 +28349,7 @@ components: default: true description: > Whether or not to automatically generate a response when a VAD - stop event occurs. `true` by default. + stop event occurs. interrupt_response: type: boolean default: true @@ -27053,7 +28358,30 @@ components: with output to the default conversation (i.e. `conversation` of `auto`) when a VAD start - event occurs. `true` by default. + event occurs. + input_audio_noise_reduction: + type: object + default: null + description: > + Configuration for input audio noise reduction. This can be set to + `null` to turn off. + + Noise reduction filters audio added to the input audio buffer before + it is sent to VAD and the model. + + Filtering the audio can improve VAD and turn detection accuracy + (reducing false positives) and model performance by improving + perception of the input audio. + properties: + type: + type: string + enum: + - near_field + - far_field + description: > + Type of noise reduction. `near_field` is for close-talking + microphones such as headphones, `far_field` is for far-field + microphones such as laptop or conference room microphones. tools: type: array description: Tools (functions) available to the model. @@ -27084,6 +28412,7 @@ components: description: Parameters of the function in JSON Schema. tool_choice: type: string + default: auto description: > How the model chooses tools. Options are `auto`, `none`, `required`, or @@ -27091,9 +28420,11 @@ components: specify a function. temperature: type: number + default: 0.8 description: > - Sampling temperature for the model, limited to [0.6, 1.2]. Defaults - to 0.8. + Sampling temperature for the model, limited to [0.6, 1.2]. For audio + models a temperature of 0.8 is highly recommended for best + performance. max_response_output_tokens: oneOf: - type: integer @@ -27116,6 +28447,9 @@ components: set this to ["text"]. items: type: string + default: + - text + - audio enum: - text - audio @@ -27133,46 +28467,20 @@ components: type: string description: > The default system instructions (i.e. system message) prepended to - model - - calls. This field allows the client to guide the model on desired - - responses. The model can be instructed on response content and - format, - - (e.g. "be extremely succinct", "act friendly", "here are examples of - good - - responses") and on audio behavior (e.g. "talk quickly", "inject - emotion - - into your voice", "laugh frequently"). The instructions are not - guaranteed - - to be followed by the model, but they provide guidance to the model - on the - - desired behavior. + model calls. This field allows the client to guide the model on + desired responses. The model can be instructed on response content + and format, (e.g. "be extremely succinct", "act friendly", "here + are examples of good responses") and on audio behavior (e.g. "talk + quickly", "inject emotion into your voice", "laugh frequently"). + The instructions are not guaranteed to be followed by the model, + but they provide guidance to the model on the desired behavior. Note that the server sets default instructions which will be used if - this - - field is not set and are visible in the `session.created` event at - the - - start of the session. + this field is not set and are visible in the `session.created` + event at the start of the session. voice: - type: string - enum: - - alloy - - ash - - ballad - - coral - - echo - - sage - - shimmer - - verse + $ref: "#/components/schemas/VoiceIdsShared" description: > The voice the model uses to respond. Voice cannot be changed during the @@ -27180,11 +28488,13 @@ components: session once the model has responded with audio at least once. Current - voice options are `alloy`, `ash`, `ballad`, `coral`, `echo` `sage`, + voice options are `alloy`, `ash`, `ballad`, `coral`, `echo`, + `fable`, - `shimmer` and `verse`. + `onyx`, `nova`, `sage`, `shimmer`, and `verse`. input_audio_format: type: string + default: pcm16 enum: - pcm16 - g711_ulaw @@ -27198,6 +28508,7 @@ components: single channel (mono), and little-endian byte order. output_audio_format: type: string + default: pcm16 enum: - pcm16 - g711_ulaw @@ -27213,20 +28524,19 @@ components: Configuration for input audio transcription, defaults to off and can be set to `null` to turn off once on. Input audio transcription is not native to the model, since the model consumes audio directly. - Transcription runs asynchronously through [OpenAI Whisper - transcription](https://platform.openai.com/docs/api-reference/audio/createTranscription) - and should be treated as rough guidance rather than the - representation understood by the model. The client can optionally - set the language and prompt for transcription, these fields will be - passed to the Whisper API. + Transcription runs asynchronously through [the + /audio/transcriptions + endpoint](https://platform.openai.com/docs/api-reference/audio/createTranscription) + and should be treated as guidance of input audio content rather than + precisely what the model heard. The client can optionally set the + language and prompt for transcription, these offer additional + guidance to the transcription service. properties: model: type: string description: > - The model to use for transcription, `whisper-1` is the only - currently - - supported model. + The model to use for transcription, current options are + `gpt-4o-transcribe`, `gpt-4o-mini-transcribe`, and `whisper-1`. language: type: string description: > @@ -27242,30 +28552,57 @@ components: An optional text to guide the model's style or continue a previous audio - segment. The [prompt](/docs/guides/speech-to-text#prompting) - should match + segment. - the audio language. + For `whisper-1`, the [prompt is a list of + keywords](/docs/guides/speech-to-text#prompting). + + For `gpt-4o-transcribe` models, the prompt is a free text + string, for example "expect words related to technology". turn_detection: type: object description: > - Configuration for turn detection. Can be set to `null` to turn off. - Server + Configuration for turn detection, ether Server VAD or Semantic VAD. + This can be set to `null` to turn off, in which case the client must + manually trigger model response. - VAD means that the model will detect the start and end of speech - based on + Server VAD means that the model will detect the start and end of + speech based on audio volume and respond at the end of user speech. - audio volume and respond at the end of user speech. + Semantic VAD is more advanced and uses a turn detection model (in + conjuction with VAD) to semantically estimate whether the user has + finished speaking, then dynamically sets a timeout based on this + probability. For example, if user audio trails off with "uhhm", the + model will score a low probability of turn end and wait longer for + the user to continue speaking. This can be useful for more natural + conversations, but may have a higher latency. properties: type: type: string + default: server_vad + enum: + - server_vad + - semantic_vad + description: | + Type of turn detection. + eagerness: + type: string + default: auto + enum: + - low + - medium + - high + - auto description: > - Type of turn detection, only `server_vad` is currently supported. + Used only for `semantic_vad` mode. The eagerness of the model to + respond. `low` will wait longer for the user to continue + speaking, `high` will respond more quickly. `auto` is the + default and is equivalent to `medium`. threshold: type: number description: > - Activation threshold for VAD (0.0 to 1.0), this defaults to 0.5. - A + Used only for `server_vad` mode. Activation threshold for VAD + (0.0 to 1.0), this defaults to 0.5. A higher threshold will require louder audio to activate the model, and @@ -27273,14 +28610,16 @@ components: thus might perform better in noisy environments. prefix_padding_ms: type: integer - description: | - Amount of audio to include before the VAD detected speech (in + description: > + Used only for `server_vad` mode. Amount of audio to include + before the VAD detected speech (in + milliseconds). Defaults to 300ms. silence_duration_ms: type: integer description: > - Duration of silence to detect speech stop (in milliseconds). - Defaults + Used only for `server_vad` mode. Duration of silence to detect + speech stop (in milliseconds). Defaults to 500ms. With shorter values the model will respond more quickly, @@ -27291,7 +28630,7 @@ components: default: true description: > Whether or not to automatically generate a response when a VAD - stop event occurs. `true` by default. + stop event occurs. interrupt_response: type: boolean default: true @@ -27300,7 +28639,30 @@ components: with output to the default conversation (i.e. `conversation` of `auto`) when a VAD start - event occurs. `true` by default. + event occurs. + input_audio_noise_reduction: + type: object + default: null + description: > + Configuration for input audio noise reduction. This can be set to + `null` to turn off. + + Noise reduction filters audio added to the input audio buffer before + it is sent to VAD and the model. + + Filtering the audio can improve VAD and turn detection accuracy + (reducing false positives) and model performance by improving + perception of the input audio. + properties: + type: + type: string + enum: + - near_field + - far_field + description: > + Type of noise reduction. `near_field` is for close-talking + microphones such as headphones, `far_field` is for far-field + microphones such as laptop or conference room microphones. tools: type: array description: Tools (functions) available to the model. @@ -27331,6 +28693,7 @@ components: description: Parameters of the function in JSON Schema. tool_choice: type: string + default: auto description: > How the model chooses tools. Options are `auto`, `none`, `required`, or @@ -27338,9 +28701,11 @@ components: specify a function. temperature: type: number + default: 0.8 description: > - Sampling temperature for the model, limited to [0.6, 1.2]. Defaults - to 0.8. + Sampling temperature for the model, limited to [0.6, 1.2]. For audio + models a temperature of 0.8 is highly recommended for best + performance. max_response_output_tokens: oneOf: - type: integer @@ -27394,94 +28759,472 @@ components: enum: - text - audio - instructions: - type: string - description: > - The default system instructions (i.e. system message) prepended to - model - - calls. This field allows the client to guide the model on desired - - responses. The model can be instructed on response content and - format, - - (e.g. "be extremely succinct", "act friendly", "here are examples of - good - - responses") and on audio behavior (e.g. "talk quickly", "inject - emotion - - into your voice", "laugh frequently"). The instructions are not - guaranteed - - to be followed by the model, but they provide guidance to the model - on the - - desired behavior. - - - Note that the server sets default instructions which will be used if - this - - field is not set and are visible in the `session.created` event at - the - - start of the session. - voice: - type: string - enum: - - alloy - - ash - - ballad - - coral - - echo - - sage - - shimmer - - verse - description: > - The voice the model uses to respond. Voice cannot be changed during - the - - session once the model has responded with audio at least once. - Current - - voice options are `alloy`, `ash`, `ballad`, `coral`, `echo` `sage`, - - `shimmer` and `verse`. + instructions: + type: string + description: > + The default system instructions (i.e. system message) prepended to + model + + calls. This field allows the client to guide the model on desired + + responses. The model can be instructed on response content and + format, + + (e.g. "be extremely succinct", "act friendly", "here are examples of + good + + responses") and on audio behavior (e.g. "talk quickly", "inject + emotion + + into your voice", "laugh frequently"). The instructions are not + guaranteed + + to be followed by the model, but they provide guidance to the model + on the + + desired behavior. + + + Note that the server sets default instructions which will be used if + this + + field is not set and are visible in the `session.created` event at + the + + start of the session. + voice: + $ref: "#/components/schemas/VoiceIdsShared" + description: > + The voice the model uses to respond. Voice cannot be changed during + the + + session once the model has responded with audio at least once. + Current + + voice options are `alloy`, `ash`, `ballad`, `coral`, `echo` `sage`, + + `shimmer` and `verse`. + input_audio_format: + type: string + description: > + The format of input audio. Options are `pcm16`, `g711_ulaw`, or + `g711_alaw`. + output_audio_format: + type: string + description: > + The format of output audio. Options are `pcm16`, `g711_ulaw`, or + `g711_alaw`. + input_audio_transcription: + type: object + description: > + Configuration for input audio transcription, defaults to off and can + be + + set to `null` to turn off once on. Input audio transcription is not + native + + to the model, since the model consumes audio directly. Transcription + runs + + asynchronously through Whisper and should be treated as rough + guidance + + rather than the representation understood by the model. + properties: + model: + type: string + description: > + The model to use for transcription, `whisper-1` is the only + currently + + supported model. + turn_detection: + type: object + description: > + Configuration for turn detection. Can be set to `null` to turn off. + Server + + VAD means that the model will detect the start and end of speech + based on + + audio volume and respond at the end of user speech. + properties: + type: + type: string + description: > + Type of turn detection, only `server_vad` is currently supported. + threshold: + type: number + description: > + Activation threshold for VAD (0.0 to 1.0), this defaults to 0.5. + A + + higher threshold will require louder audio to activate the + model, and + + thus might perform better in noisy environments. + prefix_padding_ms: + type: integer + description: | + Amount of audio to include before the VAD detected speech (in + milliseconds). Defaults to 300ms. + silence_duration_ms: + type: integer + description: > + Duration of silence to detect speech stop (in milliseconds). + Defaults + + to 500ms. With shorter values the model will respond more + quickly, + + but may jump in on short pauses from the user. + tools: + type: array + description: Tools (functions) available to the model. + items: + type: object + properties: + type: + type: string + enum: + - function + description: The type of the tool, i.e. `function`. + x-stainless-const: true + name: + type: string + description: The name of the function. + description: + type: string + description: > + The description of the function, including guidance on when + and how + + to call it, and guidance about what to tell the user when + calling + + (if anything). + parameters: + type: object + description: Parameters of the function in JSON Schema. + tool_choice: + type: string + description: > + How the model chooses tools. Options are `auto`, `none`, `required`, + or + + specify a function. + temperature: + type: number + description: > + Sampling temperature for the model, limited to [0.6, 1.2]. Defaults + to 0.8. + max_response_output_tokens: + oneOf: + - type: integer + - type: string + enum: + - inf + x-stainless-const: true + description: | + Maximum number of output tokens for a single assistant response, + inclusive of tool calls. Provide an integer between 1 and 4096 to + limit output tokens, or `inf` for the maximum available tokens for a + given model. Defaults to `inf`. + required: + - client_secret + x-oaiMeta: + name: The session object + group: realtime + example: | + { + "id": "sess_001", + "object": "realtime.session", + "model": "gpt-4o-realtime-preview", + "modalities": ["audio", "text"], + "instructions": "You are a friendly assistant.", + "voice": "alloy", + "input_audio_format": "pcm16", + "output_audio_format": "pcm16", + "input_audio_transcription": { + "model": "whisper-1" + }, + "turn_detection": null, + "tools": [], + "tool_choice": "none", + "temperature": 0.7, + "max_response_output_tokens": 200, + "client_secret": { + "value": "ek_abc123", + "expires_at": 1234567890 + } + } + RealtimeTranscriptionSessionCreateRequest: + type: object + description: Realtime transcription session object configuration. + properties: + modalities: + description: | + The set of modalities the model can respond with. To disable audio, + set this to ["text"]. + items: + type: string + default: + - text + - audio + enum: + - text + - audio + input_audio_format: + type: string + default: pcm16 + enum: + - pcm16 + - g711_ulaw + - g711_alaw + description: > + The format of input audio. Options are `pcm16`, `g711_ulaw`, or + `g711_alaw`. + + For `pcm16`, input audio must be 16-bit PCM at a 24kHz sample rate, + + single channel (mono), and little-endian byte order. + input_audio_transcription: + type: object + description: > + Configuration for input audio transcription. The client can + optionally set the language and prompt for transcription, these + offer additional guidance to the transcription service. + properties: + model: + type: string + description: > + The model to use for transcription, current options are + `gpt-4o-transcribe`, `gpt-4o-mini-transcribe`, and `whisper-1`. + enum: + - gpt-4o-transcribe + - gpt-4o-mini-transcribe + - whisper-1 + language: + type: string + 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. + prompt: + type: string + description: > + An optional text to guide the model's style or continue a + previous audio + + segment. + + For `whisper-1`, the [prompt is a list of + keywords](/docs/guides/speech-to-text#prompting). + + For `gpt-4o-transcribe` models, the prompt is a free text + string, for example "expect words related to technology". + turn_detection: + type: object + description: > + Configuration for turn detection, ether Server VAD or Semantic VAD. + This can be set to `null` to turn off, in which case the client must + manually trigger model response. + + Server VAD means that the model will detect the start and end of + speech based on audio volume and respond at the end of user speech. + + Semantic VAD is more advanced and uses a turn detection model (in + conjuction with VAD) to semantically estimate whether the user has + finished speaking, then dynamically sets a timeout based on this + probability. For example, if user audio trails off with "uhhm", the + model will score a low probability of turn end and wait longer for + the user to continue speaking. This can be useful for more natural + conversations, but may have a higher latency. + properties: + type: + type: string + default: server_vad + enum: + - server_vad + - semantic_vad + description: | + Type of turn detection. + eagerness: + type: string + default: auto + enum: + - low + - medium + - high + - auto + description: > + Used only for `semantic_vad` mode. The eagerness of the model to + respond. `low` will wait longer for the user to continue + speaking, `high` will respond more quickly. `auto` is the + default and is equivalent to `medium`. + threshold: + type: number + description: > + Used only for `server_vad` mode. Activation threshold for VAD + (0.0 to 1.0), this defaults to 0.5. A + + higher threshold will require louder audio to activate the + model, and + + thus might perform better in noisy environments. + prefix_padding_ms: + type: integer + description: > + Used only for `server_vad` mode. Amount of audio to include + before the VAD detected speech (in + + milliseconds). Defaults to 300ms. + silence_duration_ms: + type: integer + description: > + Used only for `server_vad` mode. Duration of silence to detect + speech stop (in milliseconds). Defaults + + to 500ms. With shorter values the model will respond more + quickly, + + but may jump in on short pauses from the user. + create_response: + type: boolean + default: true + description: > + Whether or not to automatically generate a response when a VAD + stop event occurs. Not available for transcription sessions. + interrupt_response: + type: boolean + default: true + description: > + Whether or not to automatically interrupt any ongoing response + with output to the default + + conversation (i.e. `conversation` of `auto`) when a VAD start + event occurs. Not available for transcription sessions. + input_audio_noise_reduction: + type: object + default: null + description: > + Configuration for input audio noise reduction. This can be set to + `null` to turn off. + + Noise reduction filters audio added to the input audio buffer before + it is sent to VAD and the model. + + Filtering the audio can improve VAD and turn detection accuracy + (reducing false positives) and model performance by improving + perception of the input audio. + properties: + type: + type: string + enum: + - near_field + - far_field + description: > + Type of noise reduction. `near_field` is for close-talking + microphones such as headphones, `far_field` is for far-field + microphones such as laptop or conference room microphones. + include: + type: array + items: + type: string + description: > + The set of items to include in the transcription. Current available + items are: + + - `item.input_audio_transcription.logprobs` + RealtimeTranscriptionSessionCreateResponse: + type: object + description: > + A new Realtime transcription session configuration. + + + When a session is created on the server via REST API, the session object + + also contains an ephemeral key. Default TTL for keys is one minute. + This + + property is not present when a session is updated via the WebSocket API. + properties: + client_secret: + type: object + description: | + Ephemeral key returned by the API. Only present when the session is + created on the server via REST API. + properties: + value: + type: string + description: > + Ephemeral key usable in client environments to authenticate + connections + + to the Realtime API. Use this in client-side environments rather + than + + a standard API token, which should only be used server-side. + expires_at: + type: integer + description: > + Timestamp for when the token expires. Currently, all tokens + expire + + after one minute. + required: + - value + - expires_at + modalities: + description: | + The set of modalities the model can respond with. To disable audio, + set this to ["text"]. + items: + type: string + enum: + - text + - audio input_audio_format: type: string description: > The format of input audio. Options are `pcm16`, `g711_ulaw`, or `g711_alaw`. - output_audio_format: - type: string - description: > - The format of output audio. Options are `pcm16`, `g711_ulaw`, or - `g711_alaw`. input_audio_transcription: type: object - description: > - Configuration for input audio transcription, defaults to off and can - be - - set to `null` to turn off once on. Input audio transcription is not - native - - to the model, since the model consumes audio directly. Transcription - runs - - asynchronously through Whisper and should be treated as rough - guidance - - rather than the representation understood by the model. + description: | + Configuration of the transcription model. properties: model: type: string description: > - The model to use for transcription, `whisper-1` is the only - currently + The model to use for transcription. Can be `gpt-4o-transcribe`, + `gpt-4o-mini-transcribe`, or `whisper-1`. + enum: + - gpt-4o-transcribe + - gpt-4o-mini-transcribe + - whisper-1 + language: + type: string + description: > + The language of the input audio. Supplying the input language in - supported model. + [ISO-639-1](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes) + (e.g. `en`) format + + will improve accuracy and latency. + prompt: + type: string + description: > + An optional text to guide the model's style or continue a + previous audio + + segment. The [prompt](/docs/guides/speech-to-text#prompting) + should match + + the audio language. turn_detection: type: object description: > @@ -27522,85 +29265,30 @@ components: quickly, but may jump in on short pauses from the user. - tools: - type: array - description: Tools (functions) available to the model. - items: - type: object - properties: - type: - type: string - enum: - - function - description: The type of the tool, i.e. `function`. - x-stainless-const: true - name: - type: string - description: The name of the function. - description: - type: string - description: > - The description of the function, including guidance on when - and how - - to call it, and guidance about what to tell the user when - calling - - (if anything). - parameters: - type: object - description: Parameters of the function in JSON Schema. - tool_choice: - type: string - description: > - How the model chooses tools. Options are `auto`, `none`, `required`, - or - - specify a function. - temperature: - type: number - description: > - Sampling temperature for the model, limited to [0.6, 1.2]. Defaults - to 0.8. - max_response_output_tokens: - oneOf: - - type: integer - - type: string - enum: - - inf - x-stainless-const: true - description: | - Maximum number of output tokens for a single assistant response, - inclusive of tool calls. Provide an integer between 1 and 4096 to - limit output tokens, or `inf` for the maximum available tokens for a - given model. Defaults to `inf`. required: - client_secret x-oaiMeta: - name: The session object + name: The transcription session object group: realtime example: | { - "id": "sess_001", - "object": "realtime.session", - "model": "gpt-4o-realtime-preview-2024-12-17", + "id": "sess_BBwZc7cFV3XizEyKGDCGL", + "object": "realtime.transcription_session", + "expires_at": 1742188264, "modalities": ["audio", "text"], - "instructions": "You are a friendly assistant.", - "voice": "alloy", + "turn_detection": { + "type": "server_vad", + "threshold": 0.5, + "prefix_padding_ms": 300, + "silence_duration_ms": 200 + }, "input_audio_format": "pcm16", - "output_audio_format": "pcm16", "input_audio_transcription": { - "model": "whisper-1" + "model": "gpt-4o-transcribe", + "language": null, + "prompt": "" }, - "turn_detection": null, - "tools": [], - "tool_choice": "none", - "temperature": 0.7, - "max_response_output_tokens": 200, - "client_secret": { - "value": "ek_abc123", - "expires_at": 1234567890 - } + "client_secret": null } Reasoning: type: object @@ -27617,7 +29305,7 @@ components: generate_summary: type: string description: > - **o-series models only** + **computer_use_preview only** A summary of the reasoning performed by the model. This can be @@ -27630,8 +29318,6 @@ components: - concise - detailed nullable: true - required: - - effort ReasoningEffort: type: string enum: @@ -27669,7 +29355,7 @@ components: type: string description: | The unique identifier of the reasoning content. - content: + summary: type: array description: | Reasoning text contents. @@ -27679,9 +29365,9 @@ components: type: type: string description: | - The type of the object. Always `text`. + The type of the object. Always `summary_text`. enum: - - reasoning_summary + - summary_text x-stainless-const: true text: type: string @@ -27704,7 +29390,7 @@ components: - incomplete required: - id - - content + - summary - type Refusal: type: object @@ -27860,7 +29546,7 @@ components: "previous_response_id": null, "reasoning": { "effort": null, - "summary": null + "generate_summary": null }, "store": true, "temperature": 1.0, @@ -28128,7 +29814,8 @@ components: } ResponseCodeInterpreterCallInterpretingEvent: type: object - description: Emitted when the code interpreter is actively interpreting the code + description: + Emitted when the code interpreter is actively interpreting the code snippet. properties: type: @@ -28373,7 +30060,7 @@ components: "previous_response_id": null, "reasoning": { "effort": null, - "summary": null + "generate_summary": null }, "store": true, "temperature": 1, @@ -28837,7 +30524,7 @@ components: "previous_response_id": null, "reasoning": { "effort": null, - "summary": null + "generate_summary": null }, "store": true, "temperature": 1, @@ -29103,6 +30790,19 @@ components: create multi-turn conversations. Learn more about [conversation state](/docs/guides/conversation-state). nullable: true + model: + description: > + Model ID used to generate the response, like `gpt-4o` or `o1`. + OpenAI + + offers a wide range of models with different capabilities, + performance + + characteristics, and price points. Refer to the [model + guide](/docs/models) + + to browse and compare available models. + $ref: "#/components/schemas/ModelIdsResponses" reasoning: $ref: "#/components/schemas/Reasoning" nullable: true @@ -29472,6 +31172,17 @@ components: 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](/docs/guides/prompt-caching). + required: + - cached_tokens output_tokens: type: integer description: The number of output tokens. @@ -29489,6 +31200,7 @@ components: description: The total number of tokens used. required: - input_tokens + - input_tokens_details - output_tokens - output_tokens_details - total_tokens @@ -29593,7 +31305,8 @@ components: } RunCompletionUsage: type: object - description: Usage statistics related to the run. This value will be `null` if + description: + Usage statistics related to the run. This value will be `null` if the run is not in a terminal state (i.e. `in_progress`, `queued`, etc.). properties: completion_tokens: @@ -29628,15 +31341,18 @@ components: description: The Unix timestamp (in seconds) for when the run was created. type: integer thread_id: - description: The ID of the [thread](/docs/api-reference/threads) that was + description: + The ID of the [thread](/docs/api-reference/threads) that was executed on as a part of this run. type: string assistant_id: - description: The ID of the [assistant](/docs/api-reference/assistants) used for + description: + The ID of the [assistant](/docs/api-reference/assistants) used for execution of this run. type: string status: - description: The status of the run, which can be either `queued`, `in_progress`, + description: + The status of the run, which can be either `queued`, `in_progress`, `requires_action`, `cancelling`, `cancelled`, `failed`, `completed`, `incomplete`, or `expired`. type: string @@ -29652,7 +31368,8 @@ components: - expired required_action: type: object - description: Details on the action required to continue the run. Will be `null` + description: + Details on the action required to continue the run. Will be `null` if no action is required. nullable: true properties: @@ -29678,7 +31395,8 @@ components: - submit_tool_outputs last_error: type: object - description: The last error associated with this run. Will be `null` if there + description: + The last error associated with this run. Will be `null` if there are no errors. nullable: true properties: @@ -29716,20 +31434,23 @@ components: type: integer nullable: true incomplete_details: - description: Details on why the run is incomplete. Will be `null` if the run is + description: + Details on why the run is incomplete. Will be `null` if the run is not incomplete. type: object nullable: true properties: reason: - description: The reason why the run is incomplete. This will point to which + description: + The reason why the run is incomplete. This will point to which specific token limit was reached over the course of the run. type: string enum: - max_completion_tokens - max_prompt_tokens model: - description: The model that the [assistant](/docs/api-reference/assistants) used + description: + The model that the [assistant](/docs/api-reference/assistants) used for this run. type: string instructions: @@ -29753,12 +31474,14 @@ components: usage: $ref: "#/components/schemas/RunCompletionUsage" temperature: - description: The sampling temperature used for this run. If not set, defaults to + description: + The sampling temperature used for this run. If not set, defaults to 1. type: number nullable: true top_p: - description: The nucleus sampling value used for this run. If not set, defaults + description: + The nucleus sampling value used for this run. If not set, defaults to 1. type: number nullable: true @@ -29856,7 +31579,8 @@ components: } RunStepCompletionUsage: type: object - description: Usage statistics related to the run step. This value will be `null` + description: + Usage statistics related to the run step. This value will be `null` while the run step's status is `in_progress`. properties: completion_tokens: @@ -29881,7 +31605,8 @@ components: streaming. properties: id: - description: The identifier of the run step, which can be referenced in API + description: + The identifier of the run step, which can be referenced in API endpoints. type: string object: @@ -29972,16 +31697,19 @@ components: description: The input to the Code Interpreter tool call. outputs: type: array - description: The outputs from the Code Interpreter tool call. Code Interpreter + description: + The outputs from the Code Interpreter tool call. Code Interpreter can output one or more items, including text (`logs`) or images (`image`). Each of these are represented by a different object type. items: type: object oneOf: - - $ref: "#/components/schemas/RunStepDeltaStepDetailsToolCallsCodeOutputLogsObjec\ + - $ref: + "#/components/schemas/RunStepDeltaStepDetailsToolCallsCodeOutputLogsObjec\ t" - - $ref: "#/components/schemas/RunStepDeltaStepDetailsToolCallsCodeOutputImageObje\ + - $ref: + "#/components/schemas/RunStepDeltaStepDetailsToolCallsCodeOutputImageObje\ ct" x-oaiExpandable: true required: @@ -30041,7 +31769,8 @@ components: description: The ID of the tool call object. type: type: string - description: The type of tool call. This is always going to be `file_search` for + description: + The type of tool call. This is always going to be `file_search` for this type of tool call. enum: - file_search @@ -30066,7 +31795,8 @@ components: description: The ID of the tool call object. type: type: string - description: The type of tool call. This is always going to be `function` for + description: + The type of tool call. This is always going to be `function` for this type of tool call. enum: - function @@ -30083,7 +31813,8 @@ components: description: The arguments passed to the function. output: type: string - description: The output of the function. This will be `null` if the outputs have + description: + The output of the function. This will be `null` if the outputs have not been [submitted](/docs/api-reference/runs/submitToolOutputs) yet. nullable: true @@ -30164,7 +31895,8 @@ components: description: The input to the Code Interpreter tool call. outputs: type: array - description: The outputs from the Code Interpreter tool call. Code Interpreter + description: + The outputs from the Code Interpreter tool call. Code Interpreter can output one or more items, including text (`logs`) or images (`image`). Each of these are represented by a different object type. @@ -30225,7 +31957,8 @@ components: description: The ID of the tool call object. type: type: string - description: The type of tool call. This is always going to be `file_search` for + description: + The type of tool call. This is always going to be `file_search` for this type of tool call. enum: - file_search @@ -30236,7 +31969,8 @@ components: x-oaiTypeLabel: map properties: ranking_options: - $ref: "#/components/schemas/RunStepDetailsToolCallsFileSearchRankingOptionsObje\ + $ref: + "#/components/schemas/RunStepDetailsToolCallsFileSearchRankingOptionsObje\ ct" results: type: array @@ -30256,7 +31990,8 @@ components: $ref: "#/components/schemas/FileSearchRanker" score_threshold: type: number - description: The score threshold for the file search. All values must be a + description: + The score threshold for the file search. All values must be a floating point number between 0 and 1. minimum: 0 maximum: 1 @@ -30277,13 +32012,15 @@ components: description: The name of the file that result was found in. score: type: number - description: The score of the result. All values must be a floating point number + description: + The score of the result. All values must be a floating point number between 0 and 1. minimum: 0 maximum: 1 content: type: array - description: The content of the result that was found. The content is only + description: + The content of the result that was found. The content is only included if requested via the include query parameter. items: type: object @@ -30310,7 +32047,8 @@ components: description: The ID of the tool call object. type: type: string - description: The type of tool call. This is always going to be `function` for + description: + The type of tool call. This is always going to be `function` for this type of tool call. enum: - function @@ -30327,7 +32065,8 @@ components: description: The arguments passed to the function. output: type: string - description: The output of the function. This will be `null` if the outputs have + description: + The output of the function. This will be `null` if the outputs have not been [submitted](/docs/api-reference/runs/submitToolOutputs) yet. nullable: true @@ -30372,7 +32111,8 @@ components: Represents a step in execution of a run. properties: id: - description: The identifier of the run step, which can be referenced in API + description: + The identifier of the run step, which can be referenced in API endpoints. type: string object: @@ -30392,18 +32132,21 @@ components: description: The ID of the [thread](/docs/api-reference/threads) that was run. type: string run_id: - description: The ID of the [run](/docs/api-reference/runs) that this run step is + description: + The ID of the [run](/docs/api-reference/runs) that this run step is a part of. type: string type: - description: The type of run step, which can be either `message_creation` or + description: + The type of run step, which can be either `message_creation` or `tool_calls`. type: string enum: - message_creation - tool_calls status: - description: The status of the run step, which can be either `in_progress`, + description: + The status of the run step, which can be either `in_progress`, `cancelled`, `failed`, `completed`, or `expired`. type: string enum: @@ -30421,7 +32164,8 @@ components: x-oaiExpandable: true last_error: type: object - description: The last error associated with this run step. Will be `null` if + description: + The last error associated with this run step. Will be `null` if there are no errors. nullable: true properties: @@ -30438,7 +32182,8 @@ components: - code - message expired_at: - description: The Unix timestamp (in seconds) for when the run step expired. A + description: + The Unix timestamp (in seconds) for when the run step expired. A step is considered expired if the parent run is expired. type: integer nullable: true @@ -30519,7 +32264,8 @@ components: required: - event - data - description: Occurs when a [run step](/docs/api-reference/run-steps/step-object) + description: + Occurs when a [run step](/docs/api-reference/run-steps/step-object) is created. x-oaiMeta: dataDescription: "`data` is a [run step](/docs/api-reference/run-steps/step-object)" @@ -30535,7 +32281,8 @@ components: required: - event - data - description: Occurs when a [run step](/docs/api-reference/run-steps/step-object) + description: + Occurs when a [run step](/docs/api-reference/run-steps/step-object) moves to an `in_progress` state. x-oaiMeta: dataDescription: "`data` is a [run step](/docs/api-reference/run-steps/step-object)" @@ -30569,7 +32316,8 @@ components: required: - event - data - description: Occurs when a [run step](/docs/api-reference/run-steps/step-object) + description: + Occurs when a [run step](/docs/api-reference/run-steps/step-object) is completed. x-oaiMeta: dataDescription: "`data` is a [run step](/docs/api-reference/run-steps/step-object)" @@ -30585,7 +32333,8 @@ components: required: - event - data - description: Occurs when a [run step](/docs/api-reference/run-steps/step-object) + description: + Occurs when a [run step](/docs/api-reference/run-steps/step-object) fails. x-oaiMeta: dataDescription: "`data` is a [run step](/docs/api-reference/run-steps/step-object)" @@ -30601,7 +32350,8 @@ components: required: - event - data - description: Occurs when a [run step](/docs/api-reference/run-steps/step-object) + description: + Occurs when a [run step](/docs/api-reference/run-steps/step-object) is cancelled. x-oaiMeta: dataDescription: "`data` is a [run step](/docs/api-reference/run-steps/step-object)" @@ -30617,7 +32367,8 @@ components: required: - event - data - description: Occurs when a [run step](/docs/api-reference/run-steps/step-object) + description: + Occurs when a [run step](/docs/api-reference/run-steps/step-object) expires. x-oaiMeta: dataDescription: "`data` is a [run step](/docs/api-reference/run-steps/step-object)" @@ -30650,7 +32401,8 @@ components: required: - event - data - description: Occurs when a [run](/docs/api-reference/runs/object) moves to a + description: + Occurs when a [run](/docs/api-reference/runs/object) moves to a `queued` status. x-oaiMeta: dataDescription: "`data` is a [run](/docs/api-reference/runs/object)" @@ -30666,7 +32418,8 @@ components: required: - event - data - description: Occurs when a [run](/docs/api-reference/runs/object) moves to an + description: + Occurs when a [run](/docs/api-reference/runs/object) moves to an `in_progress` status. x-oaiMeta: dataDescription: "`data` is a [run](/docs/api-reference/runs/object)" @@ -30682,7 +32435,8 @@ components: required: - event - data - description: Occurs when a [run](/docs/api-reference/runs/object) moves to a + description: + Occurs when a [run](/docs/api-reference/runs/object) moves to a `requires_action` status. x-oaiMeta: dataDescription: "`data` is a [run](/docs/api-reference/runs/object)" @@ -30713,7 +32467,8 @@ components: required: - event - data - description: Occurs when a [run](/docs/api-reference/runs/object) ends with + description: + Occurs when a [run](/docs/api-reference/runs/object) ends with status `incomplete`. x-oaiMeta: dataDescription: "`data` is a [run](/docs/api-reference/runs/object)" @@ -30744,7 +32499,8 @@ components: required: - event - data - description: Occurs when a [run](/docs/api-reference/runs/object) moves to a + description: + Occurs when a [run](/docs/api-reference/runs/object) moves to a `cancelling` status. x-oaiMeta: dataDescription: "`data` is a [run](/docs/api-reference/runs/object)" @@ -30784,12 +32540,14 @@ components: properties: id: type: string - description: The ID of the tool call. This ID must be referenced when you submit + description: + The ID of the tool call. This ID must be referenced when you submit the tool outputs in using the [Submit tool outputs to run](/docs/api-reference/runs/submitToolOutputs) endpoint. type: type: string - description: The type of tool call the output is required for. For now, this is + description: + The type of tool call the output is required for. For now, this is always `function`. enum: - function @@ -30873,7 +32631,8 @@ components: type: integer minimum: 100 maximum: 4096 - description: The maximum number of tokens in each chunk. The default value is + description: + The maximum number of tokens in each chunk. The default value is `800`. The minimum value is `100` and the maximum value is `4096`. chunk_overlap_tokens: type: integer @@ -30890,7 +32649,8 @@ components: StaticChunkingStrategyRequestParam: type: object title: Static Chunking Strategy - description: Customize your own chunking strategy by setting chunk size and + description: + Customize your own chunking strategy by setting chunk size and chunk overlap. additionalProperties: false properties: @@ -30950,7 +32710,8 @@ components: properties: tool_call_id: type: string - description: The ID of the tool call in the `required_action` object within the + description: + The ID of the tool call in the `required_action` object within the run object the output is being submitted for. output: type: string @@ -31129,7 +32890,8 @@ components: required: - event - data - description: Occurs when a new [thread](/docs/api-reference/threads/object) is + description: + Occurs when a new [thread](/docs/api-reference/threads/object) is created. x-oaiMeta: dataDescription: "`data` is a [thread](/docs/api-reference/threads/object)" @@ -31206,6 +32968,88 @@ components: - web_search_preview_2025_03_11 required: - type + 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](/docs/api-reference/audio/create-transcription) + 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](/docs/api-reference/audio/create-transcription) with + the `include[]` parameter set to `logprobs`. + items: + $ref: "#/components/schemas/LogProbProperties" + required: + - type + - delta + x-oaiMeta: + name: Stream Event (transcript.text.delta) + group: transcript + example: | + { + "type": "transcript.text.delta", + "delta": " wonderful" + } + TranscriptTextDoneEvent: + type: object + description: + Emitted when the transcription is complete. Contains the complete + transcription text. Only emitted when you [create a + transcription](/docs/api-reference/audio/create-transcription) 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. + logprobs: + type: array + description: > + The log probabilities of the individual tokens in the transcription. + Only included if you [create a + transcription](/docs/api-reference/audio/create-transcription) with + the `include[]` parameter set to `logprobs`. + items: + $ref: "#/components/schemas/LogProbProperties" + required: + - type + - text + x-oaiMeta: + name: Stream Event (transcript.text.done) + group: transcript + example: > + { + "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." + } + TranscriptionInclude: + type: string + enum: + - logprobs + default: [] TranscriptionSegment: type: object properties: @@ -31238,17 +33082,20 @@ components: avg_logprob: type: number format: float - description: Average logprob of the segment. If the value is lower than -1, + 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, + 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 + 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: @@ -31283,12 +33130,14 @@ components: TruncationObject: type: object title: Thread Truncation Controls - description: Controls for how a thread will be truncated prior to the run. Use + description: + Controls for how a thread will be truncated prior to the run. Use this to control the intial context window of the run. properties: type: type: string - description: The truncation strategy to use for the thread. The default is + description: + The truncation strategy to use for the thread. The default is `auto`. If set to `last_messages`, the thread will be truncated to the n most recent messages in the thread. When set to `auto`, messages in the middle of the thread will be dropped to fit the @@ -31358,7 +33207,8 @@ components: properties: id: type: string - description: The Upload unique identifier, which can be referenced in API + description: + The Upload unique identifier, which can be referenced in API endpoints. created_at: type: integer @@ -31434,7 +33284,8 @@ components: properties: id: type: string - description: The upload Part unique identifier, which can be referenced in API + description: + The upload Part unique identifier, which can be referenced in API endpoints. created_at: type: integer @@ -31515,22 +33366,26 @@ components: project_id: type: string nullable: true - description: When `group_by=project_id`, this field provides the project ID of + description: + When `group_by=project_id`, this field provides the project ID of the grouped usage result. user_id: type: string nullable: true - description: When `group_by=user_id`, this field provides the user ID of the + description: + When `group_by=user_id`, this field provides the user ID of the grouped usage result. api_key_id: type: string nullable: true - description: When `group_by=api_key_id`, this field provides the API key ID of + description: + When `group_by=api_key_id`, this field provides the API key ID of the grouped usage result. model: type: string nullable: true - description: When `group_by=model`, this field provides the model name of the + description: + When `group_by=model`, this field provides the model name of the grouped usage result. required: - object @@ -31550,7 +33405,8 @@ components: } UsageAudioTranscriptionsResult: type: object - description: The aggregated audio transcriptions usage details of the specific + description: + The aggregated audio transcriptions usage details of the specific time bucket. properties: object: @@ -31567,22 +33423,26 @@ components: project_id: type: string nullable: true - description: When `group_by=project_id`, this field provides the project ID of + description: + When `group_by=project_id`, this field provides the project ID of the grouped usage result. user_id: type: string nullable: true - description: When `group_by=user_id`, this field provides the user ID of the + description: + When `group_by=user_id`, this field provides the user ID of the grouped usage result. api_key_id: type: string nullable: true - description: When `group_by=api_key_id`, this field provides the API key ID of + description: + When `group_by=api_key_id`, this field provides the API key ID of the grouped usage result. model: type: string nullable: true - description: When `group_by=model`, this field provides the model name of the + description: + When `group_by=model`, this field provides the model name of the grouped usage result. required: - object @@ -31616,7 +33476,8 @@ components: project_id: type: string nullable: true - description: When `group_by=project_id`, this field provides the project ID of + description: + When `group_by=project_id`, this field provides the project ID of the grouped usage result. required: - object @@ -31640,21 +33501,25 @@ components: x-stainless-const: true input_tokens: type: integer - description: The aggregated number of text input tokens used, including cached + description: + The aggregated number of text input tokens used, including cached tokens. For customers subscribe to scale tier, this includes scale tier tokens. input_cached_tokens: type: integer - description: The aggregated number of text input tokens that has been cached + description: + The aggregated number of text input tokens that has been cached from previous requests. For customers subscribe to scale tier, this includes scale tier tokens. output_tokens: type: integer - description: The aggregated number of text output tokens used. For customers + description: + The aggregated number of text output tokens used. For customers subscribe to scale tier, this includes scale tier tokens. input_audio_tokens: type: integer - description: The aggregated number of audio input tokens used, including cached + description: + The aggregated number of audio input tokens used, including cached tokens. output_audio_tokens: type: integer @@ -31665,27 +33530,32 @@ components: project_id: type: string nullable: true - description: When `group_by=project_id`, this field provides the project ID of + description: + When `group_by=project_id`, this field provides the project ID of the grouped usage result. user_id: type: string nullable: true - description: When `group_by=user_id`, this field provides the user ID of the + description: + When `group_by=user_id`, this field provides the user ID of the grouped usage result. api_key_id: type: string nullable: true - description: When `group_by=api_key_id`, this field provides the API key ID of + description: + When `group_by=api_key_id`, this field provides the API key ID of the grouped usage result. model: type: string nullable: true - description: When `group_by=model`, this field provides the model name of the + description: + When `group_by=model`, this field provides the model name of the grouped usage result. batch: type: boolean nullable: true - description: When `group_by=batch`, this field tells whether the grouped usage + description: + When `group_by=batch`, this field tells whether the grouped usage result is batch or not. required: - object @@ -31727,22 +33597,26 @@ components: project_id: type: string nullable: true - description: When `group_by=project_id`, this field provides the project ID of + description: + When `group_by=project_id`, this field provides the project ID of the grouped usage result. user_id: type: string nullable: true - description: When `group_by=user_id`, this field provides the user ID of the + description: + When `group_by=user_id`, this field provides the user ID of the grouped usage result. api_key_id: type: string nullable: true - description: When `group_by=api_key_id`, this field provides the API key ID of + description: + When `group_by=api_key_id`, this field provides the API key ID of the grouped usage result. model: type: string nullable: true - description: When `group_by=model`, this field provides the model name of the + description: + When `group_by=model`, this field provides the model name of the grouped usage result. required: - object @@ -31778,33 +33652,39 @@ components: source: type: string nullable: true - description: When `group_by=source`, this field provides the source of the + description: + When `group_by=source`, this field provides the source of the grouped usage result, possible values are `image.generation`, `image.edit`, `image.variation`. size: type: string nullable: true - description: When `group_by=size`, this field provides the image size of the + description: + When `group_by=size`, this field provides the image size of the grouped usage result. project_id: type: string nullable: true - description: When `group_by=project_id`, this field provides the project ID of + description: + When `group_by=project_id`, this field provides the project ID of the grouped usage result. user_id: type: string nullable: true - description: When `group_by=user_id`, this field provides the user ID of the + description: + When `group_by=user_id`, this field provides the user ID of the grouped usage result. api_key_id: type: string nullable: true - description: When `group_by=api_key_id`, this field provides the API key ID of + description: + When `group_by=api_key_id`, this field provides the API key ID of the grouped usage result. model: type: string nullable: true - description: When `group_by=model`, this field provides the model name of the + description: + When `group_by=model`, this field provides the model name of the grouped usage result. required: - object @@ -31842,22 +33722,26 @@ components: project_id: type: string nullable: true - description: When `group_by=project_id`, this field provides the project ID of + description: + When `group_by=project_id`, this field provides the project ID of the grouped usage result. user_id: type: string nullable: true - description: When `group_by=user_id`, this field provides the user ID of the + description: + When `group_by=user_id`, this field provides the user ID of the grouped usage result. api_key_id: type: string nullable: true - description: When `group_by=api_key_id`, this field provides the API key ID of + description: + When `group_by=api_key_id`, this field provides the API key ID of the grouped usage result. model: type: string nullable: true - description: When `group_by=model`, this field provides the model name of the + description: + When `group_by=model`, this field provides the model name of the grouped usage result. required: - object @@ -31941,7 +33825,8 @@ components: project_id: type: string nullable: true - description: When `group_by=project_id`, this field provides the project ID of + description: + When `group_by=project_id`, this field provides the project ID of the grouped usage result. required: - object @@ -32057,14 +33942,16 @@ components: description: The expiration policy for a vector store. properties: anchor: - description: "Anchor timestamp after which the expiration policy applies. + description: + "Anchor timestamp after which the expiration policy applies. Supported anchors: `last_active_at`." type: string enum: - last_active_at x-stainless-const: true days: - description: The number of days after the anchor time that the vector store will + description: + The number of days after the anchor time that the vector store will expire. type: integer minimum: 1 @@ -32089,9 +33976,6 @@ components: length of 512 characters, booleans, or numbers. maxProperties: 16 - propertyNames: - type: string - maxLength: 64 additionalProperties: oneOf: - type: string @@ -32115,7 +33999,8 @@ components: - vector_store.files_batch x-stainless-const: true created_at: - description: The Unix timestamp (in seconds) for when the vector store files + description: + The Unix timestamp (in seconds) for when the vector store files batch was created. type: integer vector_store_id: @@ -32124,7 +34009,8 @@ components: [File](/docs/api-reference/files) is attached to. type: string status: - description: The status of the vector store files batch, which can be either + description: + The status of the vector store files batch, which can be either `in_progress`, `completed`, `cancelled` or `failed`. type: string enum: @@ -32230,11 +34116,13 @@ components: - vector_store.file x-stainless-const: true usage_bytes: - description: The total vector store usage in bytes. Note that this may be + description: + The total vector store usage in bytes. Note that this may be different from the original file size. type: integer created_at: - description: The Unix timestamp (in seconds) for when the vector store file was + description: + The Unix timestamp (in seconds) for when the vector store file was created. type: integer vector_store_id: @@ -32254,7 +34142,8 @@ components: - failed last_error: type: object - description: The last error associated with this vector store file. Will be + description: + The last error associated with this vector store file. Will be `null` if there are no errors. nullable: true properties: @@ -32311,7 +34200,8 @@ components: VectorStoreObject: type: object title: Vector store - description: A vector store is a collection of processed files can be used by + description: + A vector store is a collection of processed files can be used by the `file_search` tool. properties: id: @@ -32324,7 +34214,8 @@ components: - vector_store x-stainless-const: true created_at: - description: The Unix timestamp (in seconds) for when the vector store was + description: + The Unix timestamp (in seconds) for when the vector store was created. type: integer name: @@ -32358,7 +34249,8 @@ components: - cancelled - total status: - description: The status of the vector store, which can be either `expired`, + description: + The status of the vector store, which can be either `expired`, `in_progress`, or `completed`. A status of `completed` indicates that the vector store is ready for use. type: string @@ -32369,12 +34261,14 @@ components: expires_after: $ref: "#/components/schemas/VectorStoreExpirationAfter" expires_at: - description: The Unix timestamp (in seconds) for when the vector store will + description: + The Unix timestamp (in seconds) for when the vector store will expire. type: integer nullable: true last_active_at: - description: The Unix timestamp (in seconds) for when the vector store was last + description: + The Unix timestamp (in seconds) for when the vector store was last active. type: integer nullable: true @@ -32428,7 +34322,8 @@ components: type: boolean default: false max_num_results: - description: The maximum number of results to return. This number should be + description: + The maximum number of results to return. This number should be between 1 and 50 inclusive. type: integer default: 10 @@ -32543,6 +34438,23 @@ components: - next_page x-oaiMeta: name: Vector store search results page + VoiceIdsShared: + example: ash + anyOf: + - type: string + - type: string + enum: + - alloy + - ash + - ballad + - coral + - echo + - fable + - onyx + - nova + - sage + - shimmer + - verse Wait: type: object title: Wait @@ -32789,6 +34701,12 @@ x-oaiMeta: - type: object key: CreateTranscriptionResponseVerboseJson path: verbose-json-object + - type: object + key: TranscriptTextDeltaEvent + path: transcript-text-delta-event + - type: object + key: TranscriptTextDoneEvent + path: transcript-text-done-event - id: embeddings title: Embeddings description: > @@ -32825,6 +34743,15 @@ x-oaiMeta: - type: endpoint key: listFineTuningJobCheckpoints path: list-checkpoints + - type: endpoint + key: listFineTuningCheckpointPermissions + path: list-permissions + - type: endpoint + key: createFineTuningCheckpointPermission + path: create-permission + - type: endpoint + key: deleteFineTuningCheckpointPermission + path: delete-permission - type: endpoint key: retrieveFineTuningJob path: retrieve @@ -32849,6 +34776,9 @@ x-oaiMeta: - type: object key: FineTuningJobCheckpoint path: checkpoint-object + - type: object + key: FineTuningCheckpointPermission + path: permission-object - id: batch title: Batch description: > @@ -33149,9 +35079,15 @@ x-oaiMeta: - type: endpoint key: create-realtime-session path: create + - type: endpoint + key: create-realtime-transcription-session + path: create-transcription - type: object key: RealtimeSessionCreateResponse path: session_object + - type: object + key: RealtimeTranscriptionSessionCreateResponse + path: transcription_session_object - id: realtime-client-events title: Client events description: > @@ -33186,6 +35122,9 @@ x-oaiMeta: - type: object key: RealtimeClientEventResponseCancel path: + - type: object + key: RealtimeClientEventTranscriptionSessionUpdate + path: - id: realtime-server-events title: Server events description: > @@ -33211,6 +35150,9 @@ x-oaiMeta: - type: object key: RealtimeServerEventConversationItemInputAudioTranscriptionCompleted path: + - type: object + key: RealtimeServerEventConversationItemInputAudioTranscriptionDelta + path: - type: object key: RealtimeServerEventConversationItemInputAudioTranscriptionFailed path: @@ -33274,6 +35216,9 @@ x-oaiMeta: - type: object key: RealtimeServerEventResponseFunctionCallArgumentsDone path: + - type: object + key: RealtimeServerEventTranscriptionSessionUpdated + path: - type: object key: RealtimeServerEventRateLimitsUpdated path: @@ -33379,18 +35324,44 @@ x-oaiMeta: - id: admin-api-keys title: Admin API Keys description: > - The **Usage API** provides detailed insights into your activity across - the OpenAI API. It also includes a separate [Costs - endpoint](/docs/api-reference/usage/costs), which offers visibility into - your spend, breaking down consumption by invoice line items and project - IDs. + Admin API keys enable Organization Owners to programmatically manage + various aspects of their organization, including users, projects, and + API keys. These keys provide administrative capabilities, such as + creating, updating, and deleting users; managing projects; and + overseeing API key lifecycles. - While the Usage API delivers granular usage data, it may not always - reconcile perfectly with the Costs due to minor differences in how usage - and spend are recorded. For financial purposes, we recommend using the - [Costs endpoint](/docs/api-reference/usage/costs) or the [Costs - tab](/settings/organization/usage) in the Usage Dashboard, which will - reconcile back to your billing invoice. + + Key Features of Admin API Keys: + + + - User Management: Invite new users, update roles, and remove users from + the organization. + + + - Project Management: Create, update, archive projects, and manage user + assignments within projects. + + + - API Key Oversight: List, retrieve, and delete API keys associated with + projects. + + + Only Organization Owners have the authority to create and utilize Admin + API keys. To manage these keys, Organization Owners can navigate to the + Admin Keys section of their API Platform dashboard. + + + For direct access to the Admin Keys management page, Organization Owners + can use the following link: + + + [https://platform.openai.com/settings/organization/admin-keys](https://platform.openai.com/settings/organization/admin-keys) + + + It's crucial to handle Admin API keys with care due to their elevated + permissions. Adhering to best practices, such as regular key rotation + and assigning appropriate permissions, enhances security and ensures + proper governance within the organization. navigationGroup: administration sections: - type: endpoint