{"openapi":"3.0.0","info":{"description":"GPT models and AI services: Responses, Chat Completions, images, audio, videos, embeddings, files, uploads, batches, fine-tuning, vector stores, evals and moderations","version":[{"name":"v1","value":"v1"}]},"servers":[{"description":"GPT models and AI services: Responses, Chat Completions, images, audio, videos, embeddings, files, uploads, batches, fine-tuning, vector stores, evals and moderations","url":"https://api.apirails.com/openai"}],"paths":{"/v1/chat/completions":{"post":{"tags":["Chat"],"parameters":[],"responses":{"401":{"description":"Bearer token required (Authorization header)","content":{"application/json":{}}}},"externalDocs":{"api_ref":"https://platform.openai.com/docs/api-reference/chat/create","api_endpoint":"https://api.openai.com/v1/chat/completions"},"summary":"Create chat completion","description":"Creates a completion for the chat message.\n\n\nList of available models for ChatGPT API:  \n\n\n`gpt-3.5-turbo` (Current)\n\n`gpt-3.5-turbo-16k`\n\n`gpt-3.5-turbo-instruct`\n\n\n`gpt-4` \n\n`gpt-4-32k`\n\n`gpt-4-1106-preview`\n\n`gpt-4-vision-preview`\n\n\n[Official OpenAI model here: https://platform.openai.com/docs/models](https://platform.openai.com/docs/models)","security":[{"bearerAuth":[]}],"requestBody":{"description":"","required":true,"content":{"application/json":{"schema":{"type":"object","required":[],"properties":{"frequency_penalty":{"type":"number","description":"Number between -2.0 and 2.0. Positive values penalize new tokens based on their existing frequency in the text so far; decreasing the model's likelihood to repeat the same line verbatim"},"logit_bias":{"type":"number","description":"Modify the likelihood of specified tokens appearing in the completion"},"logprobs":{"type":"boolean","description":"Whether to return log probabilities of the output tokens or not","enum":[true,false]},"max_tokens":{"type":"number","description":"The maximum number of tokens allowed for the generated answer. By default the number of tokens the model can return will be (4096 - prompt tokens)"},"messages":{"type":"array","description":"The messages to generate chat completions for; in the chat format","required":true,"items":{"type":"object","properties":{"audio":{"type":"object","description":"Data about a previous audio response from the model"},"content":{"type":"string","description":"The contents of the message"},"function_call":{"type":"object","description":"Deprecated: replaced by tool_calls"},"name":{"type":"string","description":"An optional name for the participant"},"refusal":{"type":"string","description":"The refusal message by the assistant"},"role":{"type":"string","description":"The role of the messages author","required":true,"enum":["system","user","assistant","tool"]},"tool_call_id":{"type":"string","description":"Tool call that this message is responding to"},"tool_calls":{"type":"array","description":"The tool calls generated by the model"}}}},"model":{"type":"string","description":"ID of the model to use.","required":true},"n":{"type":"number","description":"How many chat completion choices to generate for each input message"},"parallel_tool_calls":{"type":"boolean","description":"Whether to enable parallel function calling during tool use","enum":[true,false]},"presence_penalty":{"type":"number","description":"Number between -2.0 and 2.0. Positive values penalize new tokens based on whether they appear in the text so far; increasing the model's likelihood to talk about new topics"},"response_format":{"type":"object","description":"An object specifying the format that the model must output","properties":{"type":{"type":"string","description":"The type of response format","required":true,"enum":["text","json_object","json_schema"]},"json_schema":{"type":"object","description":"A JSON schema object describing the format of the JSON response"}}},"seed":{"type":"integer","description":"Up to 4 sequences where the API will stop generating further tokens"},"stream":{"type":"boolean","description":"If set; partial message deltas will be sent like in ChatGPT. Tokens will be sent as data-only server-sent events as they become available; with the stream terminated by a data - [DONE] message","enum":[true,false]},"stream_options":{"type":"object","description":"Options for streaming response","properties":{"include_usage":{"type":"boolean","description":"Whether to include token usage in the stream"}}},"temperature":{"type":"number","description":"What sampling temperature to use between 0 and 2. Higher values like 0.8 will make the output more random; while lower values like 0.2 will make it more focused and deterministic. We generally recommend altering this or top_p but not both"},"tool_choice":{"type":"object","description":"Controls which (if any) tool is called by the model. none means the model will not call any tool and instead generates a message","properties":{"type":{"type":"string","description":"The type of tool choice","required":true,"enum":["none","auto","required","function","custom"]},"custom":{"type":"object","description":"Specifies a custom tool the model should call"},"function":{"type":"object","description":"Specifies a function the model should call"}}},"tools":{"type":"array","description":"A list of tools the model may call","items":{"type":"object","properties":{"type":{"type":"string","description":"The type of the tool","required":true,"enum":["function","custom"]},"function":{"type":"object","description":"The function definition","required":true}}}},"top_logprobs":{"type":"number","description":"An integer between 0 and 20 specifying the number of most likely tokens to return at each token position, each with an associated log probability"},"top_p":{"type":"number","description":"An alternative to sampling with temperature; called nucleus sampling; where the model considers the results of the tokens with top_p probability mass. So 0.1 means only the tokens comprising the top 10% probability mass are considered. We generally recommend altering this or temperature but not both"},"user":{"type":"string","description":"A unique identifier representing your end-user which can help OpenAI to monitor and detect abuse"}}},"example":{"frequency_penalty":"","logit_bias":"","logprobs":"","max_tokens":"","messages":[{"content":"Tell something interesting about ocean.","role":"user"}],"model":"gpt-5","n":"","parallel_tool_calls":"","presence_penalty":"","response_format":{},"seed":"","stream":"","stream_options":{},"temperature":0.8,"tool_choice":{},"tools":[],"top_logprobs":"","top_p":"","user":""}}}}}},"/v1/audio/transcriptions":{"post":{"tags":["Audio"],"parameters":[],"responses":{"401":{"description":"Bearer token required (Authorization header)","content":{"application/json":{}}}},"externalDocs":{"api_ref":"https://platform.openai.com/docs/api-reference/audio/createTranscription","api_endpoint":"https://api.openai.com/v1/audio/transcriptions"},"summary":"Create transcription","description":"Transcribes audio into the input language","security":[{"bearerAuth":[]}],"requestBody":{"description":"","required":false,"content":{"multipart/form-data":{"schema":{"type":"object","required":[],"properties":{"file":{"type":"string","format":"binary","description":"The audio file to transcribe in one of these formats","required":true},"language":{"type":"string","description":"The language of the input audio. Supplying the input language in ISO-639-1 format will improve accuracy and latency"},"model":{"type":"string","description":"ID of the model to use. Only whisper-1 is currently available","required":true},"prompt":{"type":"string","description":"An optional text to guide the model's style or continue a previous audio segment. The prompt should match the audio language"},"response_format":{"type":"string","description":"The format of the transcript output; in one of these options","enum":["json; text; srt; verbose_json; or vtt"]},"temperature":{"type":"number","description":"The sampling temperature; between 0 and 1. Higher values like 0.8 will make the output more random; while lower values like 0.2 will make it more focused and deterministic. If set to 0; the model will use log probability to automatically increase the temperature until certain thresholds are hit"},"timestamp_granularities[]":{"type":"array","description":"The timestamp granularities to populate for this transcription","items":{"type":"string"}}}},"example":{"file":"file","language":"","model":"whisper-1","prompt":"","response_format":"","temperature":"","timestamp_granularities[]":[]}}}}}},"/v1/audio/translations":{"post":{"tags":["Audio"],"parameters":[],"responses":{"401":{"description":"Bearer token required (Authorization header)","content":{"application/json":{}}}},"externalDocs":{"api_ref":"https://platform.openai.com/docs/api-reference/audio/createTranslation","api_endpoint":"https://api.openai.com/v1/audio/translations"},"summary":"Create translation","description":"Translates audio into into English","security":[{"bearerAuth":[]}],"requestBody":{"description":"","required":false,"content":{"multipart/form-data":{"schema":{"type":"object","required":[],"properties":{"file":{"type":"string","format":"binary","description":"The audio file to transcribe in one of these formats","required":true},"model":{"type":"string","description":"ID of the model to use. Only whisper-1 is currently available","required":true},"prompt":{"type":"string","description":"An optional text to guide the model's style or continue a previous audio segment. The prompt should match the audio language"},"response_format":{"type":"string","description":"The format of the transcript output; in one of these options","enum":["json; text; srt; verbose_json; or vtt"]},"temperature":{"type":"number","description":"The sampling temperature; between 0 and 1. Higher values like 0.8 will make the output more random; while lower values like 0.2 will make it more focused and deterministic. If set to 0; the model will use log probability to automatically increase the temperature until certain thresholds are hit"}}},"example":{"file":"(binary)","model":"","prompt":"","response_format":"","temperature":""}}}}}},"/v1/images/generations":{"post":{"tags":["Images"],"parameters":[],"responses":{"401":{"description":"Bearer token required (Authorization header)","content":{"application/json":{}}}},"externalDocs":{"api_ref":"https://platform.openai.com/docs/api-reference/images/create","api_endpoint":"https://api.openai.com/v1/images/generations"},"summary":"Create image","description":"Creates an image given a prompt","security":[{"bearerAuth":[]}],"requestBody":{"description":"","required":true,"content":{"application/json":{"schema":{"type":"object","required":[],"properties":{"model":{"type":"string","description":"The model to use for image generation"},"n":{"type":"number","description":"Specify the number of images to generate, between 1 and 10; for DALL-E 3, only n=1 is supported."},"prompt":{"type":"string","description":"Provide a text description of the desired image(s), with a maximum length of 1000 characters for DALL-E 2 and 4000 characters for DALL-E 3.","required":true},"quality":{"type":"string","description":"Specify the quality of the image; 'hd' creates images with finer details and greater consistency, supported only for DALL-E 3."},"response_format":{"type":"string","description":"Specify the format of the generated images, either 'url' or 'b64_json'; URLs are valid for 60 minutes after generation."},"size":{"type":"string","description":"Specify the size of the generated images: 256x256, 512x512, or 1024x1024 for DALL-E 2; 1024x1024, 1792x1024, or 1024x1792 for DALL-E 3."},"style":{"type":"string","description":"Specify the style of the generated images, either 'vivid' for hyper-real and dramatic images or 'natural' for more natural, less hyper-real images, supported only for DALL-E 3."},"user":{"type":"string","description":"Provide a unique identifier representing your end-user to help OpenAI monitor and detect abuse."}}},"example":{"model":"","n":"","prompt":"","quality":"","response_format":"","size":"","style":"","user":""}}}}}},"/v1/images/edits":{"post":{"tags":["Images"],"parameters":[],"responses":{"401":{"description":"Bearer token required (Authorization header)","content":{"application/json":{}}}},"externalDocs":{"api_ref":"https://platform.openai.com/docs/api-reference/images/createEdit","api_endpoint":"https://api.openai.com/v1/images/edits"},"summary":"Create image edit","description":"Creates an edited or extended image given an original image and a prompt","security":[{"bearerAuth":[]}],"requestBody":{"description":"","required":false,"content":{"multipart/form-data":{"schema":{"type":"object","required":[],"properties":{"image":{"type":"string","format":"binary","description":"Provide the image to edit, which must be a valid PNG file, less than 4MB, and square; if no mask is provided, the image must have transparency to be used as the mask","required":true},"mask":{"type":"string","format":"binary","description":"Provide an additional image where fully transparent areas (alpha zero) indicate where edits should be applied, valid as a PNG file, less than 4MB, and matching the dimensions of the main image"},"model":{"type":"string","description":"Specify the model for image generation; only DALL-E 2 is supported at this time"},"n":{"type":"number","description":"The number of images to generate. Must be between 1 and 10"},"prompt":{"type":"string","description":"Provide a text description of the desired image(s) within a maximum length of 1000 characters","required":true},"response_format":{"type":"string","description":"Specify the format for the generated images: 'url' or 'b64_json'. URLs are valid for 60 minutes after generation"},"size":{"type":"string","description":"The size of the generated images. Must be one of 256x256, 512x512, or 1024x1024"},"user":{"type":"string","description":"Provide a unique identifier representing your end-user to help OpenAI monitor and detect abuse."}}},"example":{"image":"(binary)","mask":"(binary)","model":"","n":"","prompt":"","response_format":"","size":"","user":""}}}}}},"/v1/images/variations":{"post":{"tags":["Images"],"parameters":[],"responses":{"401":{"description":"Bearer token required (Authorization header)","content":{"application/json":{}}}},"externalDocs":{"api_ref":"https://platform.openai.com/docs/api-reference/images/createVariation","api_endpoint":"https://api.openai.com/v1/images/variations"},"summary":"Create image variations","description":"Creates a variation of a given image","security":[{"bearerAuth":[]}],"requestBody":{"description":"","required":false,"content":{"multipart/form-data":{"schema":{"type":"object","required":[],"properties":{"image":{"type":"string","format":"binary","description":"The image to use as the basis for the variation(s). Must be a valid PNG file, less than 4MB, and square","required":true},"model":{"type":"string","description":"The model to use for image generation. Only dall-e-2 is supported at this time"},"n":{"type":"number","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","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":{"type":"string","description":"The size of the generated images. Must be one of 256x256, 512x512, or 1024x1024"},"user":{"type":"string","description":"A unique identifier representing your end-user, which can help OpenAI to monitor and detect abuse"}}},"example":{"image":"(binary)","model":"","n":"","response_format":"","size":"","user":""}}}}}},"/v1/audio/speech":{"post":{"tags":["Audio"],"parameters":[],"responses":{"401":{"description":"Bearer token required (Authorization header)","content":{"application/json":{}}}},"externalDocs":{"api_ref":"https://platform.openai.com/docs/api-reference/audio/createSpeech","api_endpoint":"https://api.openai.com/v1/audio/speech"},"summary":"Create speech","description":"Generates audio from the input text","security":[{"bearerAuth":[]}],"requestBody":{"description":"","required":true,"content":{"application/json":{"schema":{"type":"object","required":[],"properties":{"input":{"type":"string","description":"The text to generate audio","required":true},"model":{"type":"string","description":"one of the available TTS models","required":true},"response_format":{"type":"string","description":"The format to audio in. Supported formats are mp3 opus aac and flac"},"speed":{"type":"number","description":"The speed of the generated audio"},"voice":{"type":"string","description":"The voice to use when generating the audio","required":true}}},"example":{"input":"","model":"","response_format":"","speed":"","voice":""}}}}}},"/v1/embeddings":{"post":{"tags":["Embeddings"],"parameters":[],"responses":{"401":{"description":"Bearer token required (Authorization header)","content":{"application/json":{}}}},"externalDocs":{"api_ref":"https://platform.openai.com/docs/api-reference/embeddings/create","api_endpoint":"https://api.openai.com/v1/embeddings"},"summary":"Create embeddings","description":"Creates an embedding vector representing the input text","security":[{"bearerAuth":[]}],"requestBody":{"description":"","required":true,"content":{"application/json":{"schema":{"type":"object","required":[],"properties":{"dimensions":{"type":"number","description":"The number of dimensions the resulting output embeddings should have. Only supported in text-embedding-3 and later models"},"encoding_format":{"type":"string","description":"The format to return the embeddings in. Can be either float or base64."},"input":{"type":"array","description":"Input text to embed, encoded as a string or array of tokens","required":true,"items":{"type":"string"}},"model":{"type":"string","description":"ID of the model to use"},"user":{"type":"string","description":"A unique identifier representing your end-user, which can help OpenAI to monitor and detect abuse."}}},"example":{"dimensions":"","encoding_format":"","input":[],"model":"","user":""}}}}}},"/v1/files":{"get":{"tags":["Files"],"parameters":[{"name":"purpose","in":"query","description":"Only return files with the given purpose","schema":{"type":"string","example":""}}],"responses":{"401":{"description":"Bearer token required (Authorization header)","content":{"application/json":{}}}},"externalDocs":{"api_ref":"https://platform.openai.com/docs/api-reference/files/list","api_endpoint":"https://api.openai.com/v1/files"},"summary":"List Files","description":"Return a list of files that belong to the user's organization","security":[{"bearerAuth":[]}]},"post":{"tags":["Files"],"parameters":[],"responses":{"401":{"description":"Bearer token required (Authorization header)","content":{"application/json":{}}}},"externalDocs":{"api_ref":"https://developers.openai.com/api/reference/resources/files/methods/create","api_endpoint":"https://api.openai.com/v1/files"},"summary":"Upload files","description":"Upload a file that can be used across various endpoints. Individual files can be up to 512 MB. Each project can store up to 2.5 TB of files total (no org-wide limit). Rate-limited to 1,000 requests/min per user. The Batch API only supports .jsonl files up to 200 MB. Assistants API supports files up to 2 million tokens.","security":[{"bearerAuth":[]}],"requestBody":{"description":"","required":false,"content":{"multipart/form-data":{"schema":{"type":"object","required":[],"properties":{"expires_after":{"type":"object","description":"Expiration policy for the file. By default, batch files expire after 30 days; others persist until deleted.","properties":{"anchor":{"type":"string","description":"Anchor timestamp for expiration. Only supported value: created_at","enum":["created_at"]},"seconds":{"type":"number","description":"Seconds after anchor when file expires. Range: 1 hour to 30 days."}}},"file":{"type":"string","format":"binary","description":"The File object (not file name) to be uploaded","required":true},"purpose":{"type":"string","description":"The intended purpose of the uploaded file","required":true,"enum":["assistants","batch","fine-tune","vision","user_data","evals"]}}},"example":{"expires_after":{},"file":["mydata.jsonl"],"purpose":["fine-tune"]}}}}}},"/v1/files/{file_id}":{"delete":{"tags":["Files"],"parameters":[{"name":"file_id","in":"path","description":"The ID of the file to use for this request","required":true,"schema":{"type":"string","example":""}}],"responses":{"401":{"description":"Bearer token required (Authorization header)","content":{"application/json":{}}}},"externalDocs":{"api_ref":"https://platform.openai.com/docs/api-reference/files/delete","api_endpoint":"https://api.openai.com/v1/files/{file_id}"},"summary":"Delete files","description":"Delete files","security":[{"bearerAuth":[]}],"requestBody":{"description":"","required":true,"content":{"application/json":{"schema":{"type":"object","required":[],"properties":{}},"example":{}}}}},"get":{"tags":["Files"],"parameters":[{"name":"file_id","in":"path","description":"The ID of the file to use for this request","required":true,"schema":{"type":"string","example":""}}],"responses":{"401":{"description":"Bearer token required (Authorization header)","content":{"application/json":{}}}},"externalDocs":{"api_ref":"https://platform.openai.com/docs/api-reference/files/retrieve","api_endpoint":"https://api.openai.com/v1/files/{file_id}"},"summary":"Retrieve files","description":"Returns information about a specific file","security":[{"bearerAuth":[]}]}},"/v1/files/{file_id}/content":{"get":{"tags":["Files"],"parameters":[{"name":"file_id","in":"path","description":"The ID of the file to use for this request","required":true,"schema":{"type":"string","example":""}}],"responses":{"401":{"description":"Bearer token required (Authorization header)","content":{"application/json":{}}}},"externalDocs":{"api_ref":"https://platform.openai.com/docs/api-reference/files/retrieve-contents","api_endpoint":"https://api.openai.com/v1/files/{file_id}/content"},"summary":"Retrieve files content","description":"Returns the contents of the specified file","security":[{"bearerAuth":[]}]}},"/v1/fine_tuning/jobs":{"post":{"tags":["Fine Tunes"],"parameters":[],"responses":{"401":{"description":"Bearer token required (Authorization header)","content":{"application/json":{}}}},"externalDocs":{"api_ref":"https://platform.openai.com/docs/api-reference/fine-tuning/create","api_endpoint":"https://api.openai.com/v1/fine_tuning/jobs"},"summary":"Create fine-tuning job","description":"Creates a job that fine-tunes a specified model from a given dataset. Response includes details of the enqueued job including job status and the name of the fine-tuned models once complete","security":[{"bearerAuth":[]}],"requestBody":{"description":"","required":false,"content":{"multipart/form-data":{"schema":{"type":"object","required":[],"properties":{"hyperparameters":{"type":"object","description":"The hyperparameters used for the fine-tuning job","properties":{"batch_size":{"type":"string","description":"Batch size for training","enum":["auto","pow2","dynamic"]},"learning_rate_multiplier":{"type":"number","description":"Learning rate multiplier"},"n_epochs":{"type":"number","description":"Number of training epochs"}}},"integrations":{"type":"array","description":"A list of integrations to enable for your fine-tuning job","items":{"type":"object","properties":{"type":{"type":"string","description":"Integration type","required":true,"enum":["wandb"]},"wandb":{"type":"object","description":"Weights & Biases integration settings"}}}},"model":{"type":"string","description":"The name of the model to fine-tune","required":true},"seed":{"type":"number","description":"The weight to use for loss on the prompt tokens"},"suffix":{"type":"string","description":"A string of up to 18 characters that will be added to your fine-tuned model name"},"training_file":{"type":"string","description":"The ID of an uploaded file that contains training data","required":true},"validation_file":{"type":"string","description":"The ID of an uploaded file that contains validation data"}}},"example":{"hyperparameters":{},"integrations":[],"model":"","seed":"","suffix":"","training_file":"","validation_file":""}}}}},"get":{"tags":["Fine Tunes"],"parameters":[{"name":"after","in":"query","description":"Identifier for the last job from the previous pagination request","schema":{"type":"string","example":""}},{"name":"limit","in":"query","description":"Number of fine-tuning jobs to retrieve","schema":{"type":"number","example":""}}],"responses":{"401":{"description":"Bearer token required (Authorization header)","content":{"application/json":{}}}},"externalDocs":{"api_ref":"https://platform.openai.com/docs/api-reference/fine-tuning/list","api_endpoint":"https://api.openai.com/v1/fine_tuning/jobs"},"summary":"List fine-tuning jobs","description":"List your organization's fine-tuning jobs","security":[{"bearerAuth":[]}]}},"/v1/fine_tuning/jobs/{fine_tuning_job_id}/events":{"get":{"tags":["Fine Tunes"],"parameters":[{"name":"fine_tuning_job_id","in":"path","description":"The ID of the fine-tuning job to get events for","required":true,"schema":{"type":"string","example":""}},{"name":"after","in":"query","description":"Identifier for the last event from the previous pagination request","schema":{"type":"string","example":""}},{"name":"limit","in":"query","description":"Number of fine-tuning jobs to retrieve","schema":{"type":"number","example":""}}],"responses":{"401":{"description":"Bearer token required (Authorization header)","content":{"application/json":{}}}},"externalDocs":{"api_ref":"https://platform.openai.com/docs/api-reference/fine-tuning/list-events","api_endpoint":"https://api.openai.com/v1/fine_tuning/jobs/{fine_tuning_job_id}/events"},"summary":"List fine-tuning events","description":"Get status updates for a fine-tuning job","security":[{"bearerAuth":[]}]}},"/v1/fine_tuning/jobs/{fine_tuning_job_id}/checkpoints":{"get":{"tags":["Fine Tunes"],"parameters":[{"name":"fine_tuning_job_id","in":"path","description":"The ID of the fine-tuning job to get events for","required":true,"schema":{"type":"string","example":""}}],"responses":{"401":{"description":"Bearer token required (Authorization header)","content":{"application/json":{}}}},"externalDocs":{"api_ref":"https://platform.openai.com/docs/api-reference/fine-tuning/list-checkpoints","api_endpoint":"https://api.openai.com/v1/fine_tuning/jobs/{fine_tuning_job_id}/checkpoints"},"summary":"List fine-tuning checkpoints","description":"List checkpoints for a fine-tuning job","security":[{"bearerAuth":[]}]}},"/v1/fine_tuning/jobs/{fine_tuning_job_id}":{"get":{"tags":["Fine Tunes"],"parameters":[{"name":"fine_tuning_job_id","in":"path","description":"The ID of the fine-tuning job to get events for","required":true,"schema":{"type":"string","example":""}}],"responses":{"401":{"description":"Bearer token required (Authorization header)","content":{"application/json":{}}}},"externalDocs":{"api_ref":"https://platform.openai.com/docs/api-reference/fine-tuning/retrieve","api_endpoint":"https://api.openai.com/v1/fine_tuning/jobs/{fine_tuning_job_id}"},"summary":"Retrieve fine-tuning job","description":"Get fine-grained status updates for a fine-tune job","security":[{"bearerAuth":[]}]}},"/v1/fine_tuning/jobs/{fine_tuning_job_id}/cancel":{"post":{"tags":["Fine Tunes"],"parameters":[{"name":"fine_tuning_job_id","in":"path","description":"The ID of the fine-tuning job to get events for","required":true,"schema":{"type":"string","example":""}}],"responses":{"401":{"description":"Bearer token required (Authorization header)","content":{"application/json":{}}}},"externalDocs":{"api_ref":"https://platform.openai.com/docs/api-reference/fine-tuning/cancel","api_endpoint":"https://api.openai.com/v1/fine_tuning/jobs/{fine_tuning_job_id}/cancel"},"summary":"Cancel fine-tuning","description":"Immediately cancel a fine-tune job","security":[{"bearerAuth":[]}],"requestBody":{"description":"","required":true,"content":{"application/json":{"schema":{"type":"object","required":[],"properties":{}},"example":{}}}}}},"/v1/models":{"get":{"tags":["Models"],"parameters":[],"responses":{"401":{"description":"Bearer token required (Authorization header)","content":{"application/json":{}}}},"externalDocs":{"api_ref":"https://platform.openai.com/docs/api-reference/models","api_endpoint":"https://api.openai.com/v1/models"},"summary":"List models","description":"Lists the currently available models, and provides basic information about each one such as the owner and availability","security":[{"bearerAuth":[]}]}},"/v1/models/{model}":{"delete":{"tags":["Models"],"parameters":[{"name":"model","in":"path","description":"The model to delete","required":true,"schema":{"type":"string","example":""}}],"responses":{"401":{"description":"Bearer token required (Authorization header)","content":{"application/json":{}}}},"externalDocs":{"api_ref":"https://platform.openai.com/docs/api-reference/models/delete","api_endpoint":"https://api.openai.com/v1/models/{model}"},"summary":"Delete fine-tune model","description":"Delete a fine-tuned model. You must have the Owner role in your organization","security":[{"bearerAuth":[]}],"requestBody":{"description":"","required":true,"content":{"application/json":{"schema":{"type":"object","required":[],"properties":{}},"example":{}}}}},"get":{"tags":["Models"],"parameters":[{"name":"model","in":"path","description":"The ID of the model to use for this request","required":true,"schema":{"type":"string","example":""}}],"responses":{"401":{"description":"Bearer token required (Authorization header)","content":{"application/json":{}}}},"externalDocs":{"api_ref":"https://platform.openai.com/docs/api-reference/models/retrieve","api_endpoint":"https://api.openai.com/v1/models/{model}"},"summary":"Retrieve model","description":"Retrieves a model instance, providing basic information about the model such as the owner and permissioning","security":[{"bearerAuth":[]}]}},"/v1/moderations":{"post":{"tags":["Moderations"],"parameters":[],"responses":{"401":{"description":"Bearer token required (Authorization header)","content":{"application/json":{}}}},"externalDocs":{"api_ref":"https://platform.openai.com/docs/api-reference/moderations/create","api_endpoint":"https://api.openai.com/v1/moderations"},"summary":"Create moderations","description":"Classifies if text violates OpenAI's Content Policy","security":[{"bearerAuth":[]}],"requestBody":{"description":"","required":true,"content":{"application/json":{"schema":{"type":"object","required":[],"properties":{"input":{"type":"array","description":"The input text to classify","required":true,"items":{"type":"string"}},"model":{"type":"string","description":"Two content moderations models are available: text-moderation-stable and text-moderation-latest"}}},"example":{"input":[],"model":""}}}}}},"/v1/batches":{"post":{"tags":["Batch"],"parameters":[],"responses":{"401":{"description":"Bearer token required (Authorization header)","content":{"application/json":{}}}},"externalDocs":{"api_ref":"https://platform.openai.com/docs/api-reference/batch/create","api_endpoint":"https://api.openai.com/v1/batches"},"summary":"Create batch","description":"Creates a batch job that processes multiple requests asynchronously","security":[{"bearerAuth":[]}],"requestBody":{"description":"","required":true,"content":{"application/json":{"schema":{"type":"object","required":[],"properties":{"completion_window":{"type":"string","description":"The time frame within which the batch should be processed. Currently only 24h is supported"},"endpoint":{"type":"string","description":"The endpoint to be used for the batch. Currently only /v1/chat/completions is supported","required":true},"input_file_id":{"type":"string","description":"The ID of an uploaded file that contains requests for the new batch","required":true},"metadata":{"type":"object","description":"Set of 16 key-value pairs that can be attached to an object","properties":{"(key)":{"type":"string","description":"Metadata key-value pair (string to string)"}}}}},"example":{"completion_window":"24h","endpoint":"/v1/chat/completions","input_file_id":"","metadata":{}}}}}},"get":{"tags":["Batch"],"parameters":[{"name":"after","in":"query","description":"A cursor for use in pagination","schema":{"type":"string","example":""}},{"name":"limit","in":"query","description":"A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 20","schema":{"type":"number","example":""}}],"responses":{"401":{"description":"Bearer token required (Authorization header)","content":{"application/json":{}}}},"externalDocs":{"api_ref":"https://platform.openai.com/docs/api-reference/batch/list","api_endpoint":"https://api.openai.com/v1/batches"},"summary":"List batches","description":"List your organization's batches","security":[{"bearerAuth":[]}]}},"/v1/batches/{batch_id}":{"get":{"tags":["Batch"],"parameters":[{"name":"batch_id","in":"path","description":"The ID of the batch to retrieve","required":true,"schema":{"type":"string","example":""}}],"responses":{"401":{"description":"Bearer token required (Authorization header)","content":{"application/json":{}}}},"externalDocs":{"api_ref":"https://platform.openai.com/docs/api-reference/batch/retrieve","api_endpoint":"https://api.openai.com/v1/batches/{batch_id}"},"summary":"Retrieve batch","description":"Retrieves a batch","security":[{"bearerAuth":[]}]}},"/v1/batches/{batch_id}/cancel":{"post":{"tags":["Batch"],"parameters":[{"name":"batch_id","in":"path","description":"The ID of the batch to cancel","required":true,"schema":{"type":"string","example":""}}],"responses":{"401":{"description":"Bearer token required (Authorization header)","content":{"application/json":{}}}},"externalDocs":{"api_ref":"https://platform.openai.com/docs/api-reference/batch/cancel","api_endpoint":"https://api.openai.com/v1/batches/{batch_id}/cancel"},"summary":"Cancel batch","description":"Cancels an in-progress batch","security":[{"bearerAuth":[]}],"requestBody":{"description":"","required":true,"content":{"application/json":{"schema":{"type":"object","required":[],"properties":{}},"example":{}}}}}},"/v1/vector_stores":{"post":{"tags":["Vector Stores"],"parameters":[],"responses":{"401":{"description":"Bearer token required (Authorization header)","content":{"application/json":{}}}},"externalDocs":{"api_ref":"https://platform.openai.com/docs/api-reference/vector-stores/create","api_endpoint":"https://api.openai.com/v1/vector_stores"},"summary":"Create vector store","description":"Create a vector store","security":[{"bearerAuth":[]}],"requestBody":{"description":"","required":true,"content":{"application/json":{"schema":{"type":"object","required":[],"properties":{"expires_after":{"type":"object","description":"The expiration policy for a vector store","properties":{"anchor":{"type":"string","description":"Anchor timestamp for expiration"},"days":{"type":"number","description":"Number of days after the anchor time"}}},"file_ids":{"type":"array","description":"A list of File IDs that the vector store should use. Useful for tools like file_search that can access files","items":{"type":"string"}},"metadata":{"type":"object","description":"Set of 16 key-value pairs that can be attached to an object","properties":{"(key)":{"type":"string","description":"Metadata key-value pair (string to string)"}}},"name":{"type":"string","description":"The name of the vector store"}}},"example":{"expires_after":{},"file_ids":[],"metadata":{},"name":""}}}}},"get":{"tags":["Vector Stores"],"parameters":[{"name":"after","in":"query","description":"A cursor for use in pagination","schema":{"type":"string","example":""}},{"name":"before","in":"query","description":"A cursor for use in pagination","schema":{"type":"string","example":""}},{"name":"limit","in":"query","description":"A limit on the number of objects to be returned","schema":{"type":"number","example":""}},{"name":"order","in":"query","description":"Sort order by the created_at timestamp of the objects","schema":{"type":"string","example":""}}],"responses":{"401":{"description":"Bearer token required (Authorization header)","content":{"application/json":{}}}},"externalDocs":{"api_ref":"https://platform.openai.com/docs/api-reference/vector-stores/list","api_endpoint":"https://api.openai.com/v1/vector_stores"},"summary":"List vector stores","description":"Returns a list of vector stores","security":[{"bearerAuth":[]}]}},"/v1/vector_stores/{vector_store_id}":{"get":{"tags":["Vector Stores"],"parameters":[{"name":"vector_store_id","in":"path","description":"The ID of the vector store to retrieve","required":true,"schema":{"type":"string","example":""}}],"responses":{"401":{"description":"Bearer token required (Authorization header)","content":{"application/json":{}}}},"externalDocs":{"api_ref":"https://platform.openai.com/docs/api-reference/vector-stores/retrieve","api_endpoint":"https://api.openai.com/v1/vector_stores/{vector_store_id}"},"summary":"Retrieve vector store","description":"Retrieves a vector store","security":[{"bearerAuth":[]}]},"post":{"tags":["Vector Stores"],"parameters":[{"name":"vector_store_id","in":"path","description":"The ID of the vector store to modify","required":true,"schema":{"type":"string","example":""}}],"responses":{"401":{"description":"Bearer token required (Authorization header)","content":{"application/json":{}}}},"externalDocs":{"api_ref":"https://platform.openai.com/docs/api-reference/vector-stores/modify","api_endpoint":"https://api.openai.com/v1/vector_stores/{vector_store_id}"},"summary":"Modify vector store","description":"Modifies a vector store","security":[{"bearerAuth":[]}],"requestBody":{"description":"","required":true,"content":{"application/json":{"schema":{"type":"object","required":[],"properties":{"expires_after":{"type":"object","description":"The expiration policy for a vector store","properties":{"anchor":{"type":"string","description":"Anchor timestamp for expiration"},"days":{"type":"number","description":"Number of days after the anchor time"}}},"metadata":{"type":"object","description":"Set of 16 key-value pairs that can be attached to an object","properties":{"(key)":{"type":"string","description":"Metadata key-value pair (string to string)"}}},"name":{"type":"string","description":"The name of the vector store"}}},"example":{"expires_after":{},"metadata":{},"name":""}}}}},"delete":{"tags":["Vector Stores"],"parameters":[{"name":"vector_store_id","in":"path","description":"The ID of the vector store to delete","required":true,"schema":{"type":"string","example":""}}],"responses":{"401":{"description":"Bearer token required (Authorization header)","content":{"application/json":{}}}},"externalDocs":{"api_ref":"https://platform.openai.com/docs/api-reference/vector-stores/delete","api_endpoint":"https://api.openai.com/v1/vector_stores/{vector_store_id}"},"summary":"Delete vector store","description":"Delete a vector store","security":[{"bearerAuth":[]}],"requestBody":{"description":"","required":true,"content":{"application/json":{"schema":{"type":"object","required":[],"properties":{}},"example":{}}}}}},"/v1/vector_stores/{vector_store_id}/files":{"post":{"tags":["Vector Stores"],"parameters":[{"name":"vector_store_id","in":"path","description":"The ID of the vector store for which to create a File","required":true,"schema":{"type":"string","example":""}}],"responses":{"401":{"description":"Bearer token required (Authorization header)","content":{"application/json":{}}}},"externalDocs":{"api_ref":"https://platform.openai.com/docs/api-reference/vector-stores-files/create","api_endpoint":"https://api.openai.com/v1/vector_stores/{vector_store_id}/files"},"summary":"Create vector store file","description":"Create a vector store file by attaching a File to a vector store","security":[{"bearerAuth":[]}],"requestBody":{"description":"","required":true,"content":{"application/json":{"schema":{"type":"object","required":[],"properties":{"file_id":{"type":"string","description":"A File ID that the vector store should use","required":true}}},"example":{"file_id":""}}}}},"get":{"tags":["Vector Stores"],"parameters":[{"name":"vector_store_id","in":"path","description":"The ID of the vector store that the files belong to","required":true,"schema":{"type":"string","example":""}},{"name":"after","in":"query","description":"A cursor for use in pagination","schema":{"type":"string","example":""}},{"name":"before","in":"query","description":"A cursor for use in pagination","schema":{"type":"string","example":""}},{"name":"filter","in":"query","description":"Filter by file status","schema":{"type":"string","example":""}},{"name":"limit","in":"query","description":"A limit on the number of objects to be returned","schema":{"type":"number","example":""}},{"name":"order","in":"query","description":"Sort order by the created_at timestamp of the objects","schema":{"type":"string","example":""}}],"responses":{"401":{"description":"Bearer token required (Authorization header)","content":{"application/json":{}}}},"externalDocs":{"api_ref":"https://platform.openai.com/docs/api-reference/vector-stores-files/list","api_endpoint":"https://api.openai.com/v1/vector_stores/{vector_store_id}/files"},"summary":"List vector store files","description":"Returns a list of files in a vector store","security":[{"bearerAuth":[]}]}},"/v1/vector_stores/{vector_store_id}/files/{file_id}":{"get":{"tags":["Vector Stores"],"parameters":[{"name":"file_id","in":"path","description":"The ID of the file being retrieved","required":true,"schema":{"type":"string","example":""}},{"name":"vector_store_id","in":"path","description":"The ID of the vector store that the file belongs to","required":true,"schema":{"type":"string","example":""}}],"responses":{"401":{"description":"Bearer token required (Authorization header)","content":{"application/json":{}}}},"externalDocs":{"api_ref":"https://platform.openai.com/docs/api-reference/vector-stores-files/retrieve","api_endpoint":"https://api.openai.com/v1/vector_stores/{vector_store_id}/files/{file_id}"},"summary":"Retrieve vector store file","description":"Retrieves a vector store file","security":[{"bearerAuth":[]}]},"delete":{"tags":["Vector Stores"],"parameters":[{"name":"file_id","in":"path","description":"The ID of the file to delete","required":true,"schema":{"type":"string","example":""}},{"name":"vector_store_id","in":"path","description":"The ID of the vector store that the file belongs to","required":true,"schema":{"type":"string","example":""}}],"responses":{"401":{"description":"Bearer token required (Authorization header)","content":{"application/json":{}}}},"externalDocs":{"api_ref":"https://platform.openai.com/docs/api-reference/vector-stores-files/delete","api_endpoint":"https://api.openai.com/v1/vector_stores/{vector_store_id}/files/{file_id}"},"summary":"Delete vector store file","description":"Delete a vector store file","security":[{"bearerAuth":[]}],"requestBody":{"description":"","required":true,"content":{"application/json":{"schema":{"type":"object","required":[],"properties":{}},"example":{}}}}},"post":{"tags":["Vector Stores"],"parameters":[{"name":"file_id","in":"path","description":"The ID of the file","required":true,"schema":{"type":"string","example":""}},{"name":"vector_store_id","in":"path","description":"The ID of the vector store that the file belongs to","required":true,"schema":{"type":"string","example":""}}],"responses":{"401":{"description":"Bearer token required (Authorization header)","content":{"application/json":{}}}},"externalDocs":{"api_ref":"https://developers.openai.com/api/reference/resources/vector_stores/subresources/files/methods/update","api_endpoint":"https://api.openai.com/v1/vector_stores/{vector_store_id}/files/{file_id}"},"summary":"Update vector store file attributes","description":"Update attributes on a vector store file.","security":[{"bearerAuth":[]}],"requestBody":{"description":"","required":true,"content":{"application/json":{"schema":{"type":"object","required":[],"properties":{"attributes":{"type":"object","description":"Set of 16 key-value pairs that can be attached to an object. This can be useful for storing additional information about the object in a structured format, and querying for objects via API or the dashboard. Keys are strings with a maximum length of 64 characters. Values are strings with a maximum length of 512 characters, booleans, or numbers.","required":true,"properties":{}}}},"example":{"attributes":{}}}}}}},"/v1/responses":{"post":{"tags":["Responses"],"parameters":[],"responses":{"401":{"description":"Bearer token required (Authorization header)","content":{"application/json":{}}}},"externalDocs":{"api_ref":"https://developers.openai.com/api/reference/resources/responses/methods/create","api_endpoint":"https://api.openai.com/v1/responses"},"summary":"Create a model response","description":"Creates a model response. Provide [text](/api/docs/guides/text) or [image](/api/docs/guides/images-vision) inputs to generate [text](/api/docs/guides/text) or [JSON](/api/docs/guides/structured-outputs) outputs. Have the model call your own [custom code](/api/docs/guides/function-calling) or use built-in [tools](/api/docs/guides/tools) like [web search](/api/docs/guides/tools-web-search) or [file search](/api/docs/guides/tools-file-search) to use your own data as input for the model's response.","security":[{"bearerAuth":[]}],"requestBody":{"description":"","required":true,"content":{"application/json":{"schema":{"type":"object","required":[],"properties":{"text":{"type":"string","description":"Configuration options for a text response from the model. Can be plain text or structured JSON data. Learn more:"},"background":{"type":"boolean","description":"Whether to run the model response in the background. [Learn more](/api/docs/guides/background).","enum":[true,false]},"context_management":{"type":"array","description":"Context management configuration for this request.","items":{"type":"object","properties":{"type":{"type":"string","required":true}}}},"conversation":{"type":"string","description":"The conversation that this response belongs to. Items from this conversation are prepended to `input_items` for this response request. Input items and output items from this response are automatically added to this conversation after this response completes."},"include":{"type":"array","description":"Specify additional output data to include in the model response. Currently supported values are:","items":{"type":"string"}},"input":{"type":"string","description":"Text, image, or file inputs to the model, used to generate a response. Learn more:"},"instructions":{"type":"string","description":"A system (or developer) message inserted into the model's context. When using along with `previous_response_id`, the instructions from a previous response will not be carried over to the next response. This makes it simple to swap out system (or developer) messages in new responses."},"max_output_tokens":{"type":"number","description":"An upper bound for the number of tokens that can be generated for a response, including visible output tokens and [reasoning tokens](/api/docs/guides/reasoning)."},"max_tool_calls":{"type":"number","description":"The maximum number of total calls to built-in tools that can be processed in a response. This maximum number applies across all built-in tool calls, not per individual tool. Any further attempts to call a tool by the model will be ignored."},"metadata":{"type":"string","description":"Set of 16 key-value pairs that can be attached to an object. This can be useful for storing additional information about the object in a structured format, and querying for objects via API or the dashboard. Keys are strings with a maximum length of 64 characters. Values are strings with a maximum length of 512 characters."},"model":{"type":"string","description":"Model ID used to generate the response, like `gpt-6-astra`. OpenAI offers a wide range of models with different capabilities, performance characteristics, and price points. Refer to the [model guide](/api/docs/models) to browse and compare available models."},"moderation":{"type":"object","description":"Configuration for running moderation on the input and output of this response.","properties":{"model":{"type":"string","required":true}}},"parallel_tool_calls":{"type":"boolean","description":"Whether to allow the model to run tool calls in parallel.","enum":[true,false]},"previous_response_id":{"type":"string","description":"The unique ID of the previous response to the model. Use this to create multi-turn conversations. Learn more about [conversation state](/api/docs/guides/conversation-state). Cannot be used in conjunction with `conversation`."},"prompt":{"type":"string","description":"Reference to a prompt template and its variables. [Learn more](/api/docs/guides/text?api-mode=responses#version-prompts-in-code)."},"prompt_cache_key":{"type":"string","description":"Used by OpenAI to cache responses for similar requests to optimize your cache hit rates. Replaces the `user` field. [Learn more](/api/docs/guides/prompt-caching)."},"prompt_cache_options":{"type":"object","description":"Options for prompt caching. Supported for `gpt-5.6` and later models. By default, OpenAI automatically chooses one implicit cache breakpoint. You can add explicit breakpoints to content blocks with `prompt_cache_breakpoint`. Each request can write up to four breakpoints. For cache matching, OpenAI considers up to the latest 80 breakpoints in the conversation, without a content-block lookback limit. Set `mode` to `explicit` to disable the implicit breakpoint. The `ttl` defaults to `30m`, which is currently the only supported value. See the [prompt caching guide](/api/docs/guides/prompt-caching) for current details.","properties":{"comparison_response_id":{"type":"string"}}},"prompt_cache_retention":{"type":"string","description":"Deprecated. Use `prompt_cache_options.ttl` instead. The retention policy for the prompt cache. Set to `24h` to enable extended prompt caching, which keeps cached prefixes active for longer, up to a maximum of 24 hours. [Learn more](/api/docs/guides/prompt-caching#prompt-cache-retention). This field expresses a maximum retention policy, while fields are independent and do not interact. For `gpt-5.5`, `gpt-5.5-pro`, and future models, only `24h` is supported. For older models that support both `in_memory` and `24h`, the default depends on your organization's data retention policy:","enum":["in_memory","24h"]},"reasoning":{"type":"string","description":"Configuration options for [reasoning models](/api/docs/guides/reasoning)."},"safety_identifier":{"type":"string","description":"A stable identifier used to help detect users of your application that may be violating OpenAI's usage policies. The IDs should be a string that uniquely identifies each user, with a maximum length of 64 characters. We recommend hashing their username or email address, in order to avoid sending us any identifying information. [Learn more](/api/docs/guides/safety-best-practices#implement-safety-identifiers)."},"service_tier":{"type":"string","description":"Specifies the processing type used for serving the request. When the `service_tier` parameter is set, the response body will include the `service_tier` value based on the processing mode actually used to serve the request. This response value may be different from the value set in the parameter."},"store":{"type":"boolean","description":"Whether to store the generated model response for later retrieval via API. Defaults to true when omitted. If set to true, response data will be stored for at least 30 days, subject to the [data retention exceptions](/api/docs/guides/your-data#v1responses).","enum":[true,false]},"stream":{"type":"boolean","description":"If set to true, the model response data will be streamed to the client as it is generated using [server-sent events](https://developer.mozilla.org/en-US/docs/Web/API/Server-sent_events/Using_server-sent_events#Event_stream_format). See the [Streaming section below](/api/reference/resources/responses/streaming-events) for more information.","enum":[true,false]},"stream_options":{"type":"object","description":"Options for streaming responses. Only set this when you set `stream: true`.","properties":{"include_obfuscation":{"type":"boolean","enum":[true,false]}}},"temperature":{"type":"number","description":"What sampling temperature to use, between 0 and 2. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. We generally recommend altering this or `top_p` but not both."},"tool_choice":{"type":"string","description":"How the model should select which tool (or tools) to use when generating a response. See the `tools` parameter to see how to specify which tools the model can call."},"tools":{"type":"array","description":"An array of tools the model may call while generating a response. You can specify which tool to use by setting the `tool_choice` parameter. We support the following categories of tools:","items":{"type":"string"}},"top_logprobs":{"type":"number","description":"An integer between 0 and 20 specifying the maximum number of most likely tokens to return at each token position, each with an associated log probability. In some cases, the number of returned tokens may be fewer than requested."},"top_p":{"type":"number","description":"An alternative to sampling with temperature, called nucleus sampling, where the model considers the results of the tokens with top_p probability mass. So 0.1 means only the tokens comprising the top 10% probability mass are considered. We generally recommend altering this or `temperature` but not both."},"truncation":{"type":"string","description":"The truncation strategy to use for the model response.","enum":["auto","disabled"]},"user":{"type":"string","description":"This field is being replaced by `safety_identifier` and `prompt_cache_key`. Use `prompt_cache_key` instead to maintain caching optimizations. A stable identifier for your end-users. Used to boost cache hit rates by better bucketing similar requests and to help OpenAI detect and prevent abuse. [Learn more](/api/docs/guides/safety-best-practices#implement-safety-identifiers)."}}},"example":{"text":"","background":"","context_management":[],"conversation":"","include":[],"input":"","instructions":"","max_output_tokens":"","max_tool_calls":"","metadata":"","model":"","moderation":{},"parallel_tool_calls":"","previous_response_id":"","prompt":"","prompt_cache_key":"","prompt_cache_options":{},"prompt_cache_retention":"","reasoning":"","safety_identifier":"","service_tier":"","store":"","stream":"","stream_options":{},"temperature":"","tool_choice":"","tools":[],"top_logprobs":"","top_p":"","truncation":"","user":""}}}}}},"/v1/responses/{response_id}":{"get":{"tags":["Responses"],"parameters":[{"name":"response_id","in":"path","description":"The ID of the response to retrieve","required":true,"schema":{"type":"string","example":""}},{"name":"include","in":"query","description":"Additional fields to include in the response. See the `include` parameter for Response creation above for more information.","schema":{"type":"array","example":""}},{"name":"include_obfuscation","in":"query","description":"When true, stream obfuscation will be enabled. Stream obfuscation adds random characters to an `obfuscation` field on streaming delta events to normalize payload sizes as a mitigation to certain side-channel attacks. These obfuscation fields are included by default, but add a small amount of overhead to the data stream. You can set the network links between your application and the OpenAI API.","schema":{"type":"boolean","example":"","items":{"type":"string","enum":[true,false]}}},{"name":"starting_after","in":"query","description":"The sequence number of the event after which to start streaming.","schema":{"type":"number","example":""}},{"name":"stream","in":"query","description":"If set to true, the model response data will be streamed to the client as it is generated using [server-sent events](https://developer.mozilla.org/en-US/docs/Web/API/Server-sent_events/Using_server-sent_events#Event_stream_format). See the [Streaming section below](/api/reference/resources/responses/streaming-events) for more information.","schema":{"type":"string","example":""}}],"responses":{"401":{"description":"Bearer token required (Authorization header)","content":{"application/json":{}}}},"externalDocs":{"api_ref":"https://developers.openai.com/api/reference/resources/responses/methods/retrieve","api_endpoint":"https://api.openai.com/v1/responses/{response_id}"},"summary":"Get a model response","description":"Retrieves a model response with the given ID.","security":[{"bearerAuth":[]}]},"delete":{"tags":["Responses"],"parameters":[{"name":"response_id","in":"path","description":"The ID of the response to retrieve","required":true,"schema":{"type":"string","example":""}}],"responses":{"401":{"description":"Bearer token required (Authorization header)","content":{"application/json":{}}}},"externalDocs":{"api_ref":"https://developers.openai.com/api/reference/resources/responses/methods/delete","api_endpoint":"https://api.openai.com/v1/responses/{response_id}"},"summary":"Delete a model response","description":"Deletes a model response with the given ID.","security":[{"bearerAuth":[]}],"requestBody":{"description":"","required":true,"content":{"application/json":{"schema":{"type":"object","required":[],"properties":{}},"example":{}}}}}},"/v1/responses/{response_id}/cancel":{"post":{"tags":["Responses"],"parameters":[{"name":"response_id","in":"path","description":"The ID of the response to retrieve","required":true,"schema":{"type":"string","example":""}}],"responses":{"401":{"description":"Bearer token required (Authorization header)","content":{"application/json":{}}}},"externalDocs":{"api_ref":"https://developers.openai.com/api/reference/resources/responses/methods/cancel","api_endpoint":"https://api.openai.com/v1/responses/{response_id}/cancel"},"summary":"Cancel a response","description":"Cancels a model response with the given ID. Only responses created with the `background` parameter set to `true` can be cancelled. [Learn more](/api/docs/guides/background).","security":[{"bearerAuth":[]}],"requestBody":{"description":"","required":true,"content":{"application/json":{"schema":{"type":"object","required":[],"properties":{}},"example":{}}}}}},"/v1/responses/compact":{"post":{"tags":["Responses"],"parameters":[],"responses":{"401":{"description":"Bearer token required (Authorization header)","content":{"application/json":{}}}},"externalDocs":{"api_ref":"https://developers.openai.com/api/reference/resources/responses/methods/compact","api_endpoint":"https://api.openai.com/v1/responses/compact"},"summary":"Compact conversation","description":"Compact a conversation. Returns a compacted response object. Learn when and how to compact long-running conversations in the [conversation state guide](/api/docs/guides/conversation-state#managing-the-context-window). For ZDR-compatible compaction details, see [Compaction (advanced)](/api/docs/guides/conversation-state#compaction-advanced).","security":[{"bearerAuth":[]}],"requestBody":{"description":"","required":true,"content":{"application/json":{"schema":{"type":"object","required":[],"properties":{"input":{"type":"string","description":"Text, image, or file inputs to the model, used to generate a response"},"instructions":{"type":"string","description":"A system (or developer) message inserted into the model's context. When used along with `previous_response_id`, the instructions from a previous response will not be carried over to the next response. This makes it simple to swap out system (or developer) messages in new responses."},"model":{"type":"string","description":"Model ID used to generate the response, like `gpt-6-astra`. OpenAI offers a wide range of models with different capabilities, performance characteristics, and price points. Refer to the [model guide](/api/docs/models) to browse and compare available models.","required":true,"enum":["gpt-6-astra","gpt-5.6-sol","gpt-5.6-terra"]},"previous_response_id":{"type":"string","description":"The unique ID of the previous response to the model. Use this to create multi-turn conversations. Learn more about [conversation state](/api/docs/guides/conversation-state). Cannot be used in conjunction with `conversation`."},"prompt_cache_key":{"type":"string","description":"A key to use when reading from or writing to the prompt cache."},"prompt_cache_options":{"type":"object","description":"Options for prompt caching. Supported for `gpt-5.6` and later models. By default, OpenAI automatically chooses one implicit cache breakpoint. You can add explicit breakpoints to content blocks with `prompt_cache_breakpoint`. Each request can write up to four breakpoints. For cache matching, OpenAI considers up to the latest 80 breakpoints in the conversation, without a content-block lookback limit. Set `mode` to `explicit` to disable the implicit breakpoint. The `ttl` defaults to `30m`, which is currently the only supported value. See the [prompt caching guide](/api/docs/guides/prompt-caching) for current details.","properties":{"mode":{"type":"string","enum":["implicit","explicit"]}}},"prompt_cache_retention":{"type":"string","description":"How long to retain a prompt cache entry created by this request.","enum":["in_memory","24h"]},"service_tier":{"type":"string","description":"Specifies the processing type used for serving the request. - If set to 'auto', then the request will be processed with the service tier configured in the Project settings. Unless otherwise configured, the Project will use 'default'. - If set to 'default', then the request will be processed with the standard pricing and performance for the selected model. - If set to '[flex](/api/docs/guides/flex-processing)', then the request will be processed with the Flex Processing service tier. - To opt-in to [Fast mode](/api/docs/guides/fast-mode) at the request level, include the `service_tier=fast` or `service_tier=priority` parameter for Responses or Chat Completions. For models with a dedicated Fast tier, either value resolves to `service_tier=fast`; for other models, either value resolves to `service_tier=priority`. - When not set, the default behavior is 'auto'. When the `service_tier` parameter is set, the response body will include the `service_tier` value based on the processing mode actually used to serve the request. This response value may be different from the value set in the parameter.","enum":["auto","default","fast"]}}},"example":{"input":"","instructions":"","model":"","previous_response_id":"","prompt_cache_key":"","prompt_cache_options":{},"prompt_cache_retention":"","service_tier":""}}}}}},"/v1/responses/{response_id}/input_items":{"get":{"tags":["Responses"],"parameters":[{"name":"response_id","in":"path","description":"The ID of the response to retrieve","required":true,"schema":{"type":"string","example":""}},{"name":"after","in":"query","description":"An item ID to list items after, used in pagination.","schema":{"type":"string","example":""}},{"name":"include","in":"query","description":"Additional fields to include in the response. See the `include` parameter for Response creation above for more information.","schema":{"type":"array","example":""}},{"name":"limit","in":"query","description":"A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 20.","schema":{"type":"number","example":""}},{"name":"order","in":"query","description":"The order to return the input items in. Default is `desc`.","schema":{"type":"string","example":"","items":{"type":"string","enum":["asc","desc"]}}}],"responses":{"401":{"description":"Bearer token required (Authorization header)","content":{"application/json":{}}}},"externalDocs":{"api_ref":"https://developers.openai.com/api/reference/resources/responses/subresources/input_items/methods/list","api_endpoint":"https://api.openai.com/v1/responses/{response_id}/input_items"},"summary":"List input items","description":"Returns a list of input items for a given response.","security":[{"bearerAuth":[]}]}},"/v1/chat/completions/{completion_id}":{"get":{"tags":["Chat"],"parameters":[{"name":"completion_id","in":"path","description":"The ID of the chat completion to retrieve","required":true,"schema":{"type":"string","example":""}}],"responses":{"401":{"description":"Bearer token required (Authorization header)","content":{"application/json":{}}}},"externalDocs":{"api_ref":"https://developers.openai.com/api/reference/resources/chat/subresources/completions/methods/retrieve","api_endpoint":"https://api.openai.com/v1/chat/completions/{completion_id}"},"summary":"Get chat completion","description":"Get a stored chat completion. Only Chat Completions that have been created with the `store` parameter set to `true` will be returned.","security":[{"bearerAuth":[]}]}},"/v1/completions":{"post":{"tags":["Completions"],"parameters":[],"responses":{"401":{"description":"Bearer token required (Authorization header)","content":{"application/json":{}}}},"externalDocs":{"api_ref":"https://developers.openai.com/api/reference/resources/completions/methods/create","api_endpoint":"https://api.openai.com/v1/completions"},"summary":"Create completion","description":"Creates a completion for the provided prompt and parameters. Returns a completion object, or a sequence of completion objects if the request is streamed.","security":[{"bearerAuth":[]}],"requestBody":{"description":"","required":true,"content":{"application/json":{"schema":{"type":"object","required":[],"properties":{"best_of":{"type":"number","description":"Generates `best_of` completions server-side and returns the \"best\" (the one with the highest log probability per token). Results cannot be streamed. When used with `n`, `best_of` controls the number of candidate completions and `n` specifies how many to return – `best_of` must be greater than `n`. **Note:** Because this parameter generates many completions, it can quickly consume your token quota. Use carefully and ensure that you have reasonable settings for `max_tokens` and `stop`."},"echo":{"type":"boolean","description":"Echo back the prompt in addition to the completion","enum":[true,false]},"frequency_penalty":{"type":"number","description":"Number between -2.0 and 2.0. Positive values penalize new tokens based on their existing frequency in the text so far, decreasing the model's likelihood to repeat the same line verbatim. [See more information about frequency and presence penalties.](/api/docs/guides/text)"},"logit_bias":{"type":"object","description":"Modify the likelihood of specified tokens appearing in the completion. Accepts a JSON object that maps tokens (specified by their token ID in the GPT tokenizer) to an associated bias value from -100 to 100. You can use this [tokenizer tool](https://platform.openai.com/tokenizer?view=bpe) to convert text to token IDs. Mathematically, the bias is added to the logits generated by the model prior to sampling. The exact effect will vary per model, but values between -1 and 1 should decrease or increase likelihood of selection; values like -100 or 100 should result in a ban or exclusive selection of the relevant token. As an example, you can pass `{\"50256\": -100}` to prevent the <|endoftext|> token from being generated.","properties":{}},"logprobs":{"type":"number","description":"Include the log probabilities on the `logprobs` most likely output tokens, as well the chosen tokens. For example, if `logprobs` is 5, the API will return a list of the 5 most likely tokens. The API will always return the `logprob` of the sampled token, so there may be up to `logprobs+1` elements in the response. The maximum value for `logprobs` is 5."},"max_tokens":{"type":"number","description":"The maximum number of [tokens](https://platform.openai.com/tokenizer) that can be generated in the completion. The token count of your prompt plus `max_tokens` cannot exceed the model's context length. [Example Python code](https://cookbook.openai.com/examples/how_to_count_tokens_with_tiktoken) for counting tokens."},"model":{"type":"string","description":"ID of the model to use. You can use the [List models](/api/reference/resources/models/methods/list) API to see all of your available models, or see our [Model overview](/api/docs/models) for descriptions of them.","required":true,"enum":["gpt-3.5-turbo-instruct","davinci-002","babbage-002"]},"n":{"type":"number","description":"How many completions to generate for each prompt. **Note:** Because this parameter generates many completions, it can quickly consume your token quota. Use carefully and ensure that you have reasonable settings for `max_tokens` and `stop`."},"presence_penalty":{"type":"number","description":"Number between -2.0 and 2.0. Positive values penalize new tokens based on whether they appear in the text so far, increasing the model's likelihood to talk about new topics. [See more information about frequency and presence penalties.](/api/docs/guides/text)"},"prompt":{"type":"string","description":"The prompt(s) to generate completions for, encoded as a string, array of strings, array of tokens, or array of token arrays. Note that <|endoftext|> is the document separator that the model sees during training, so if a prompt is not specified the model will generate as if from the beginning of a new document.","required":true},"seed":{"type":"number","description":"If specified, our system will make a best effort to sample deterministically, such that repeated requests with the same `seed` and parameters should return the same result. Determinism is not guaranteed, and you should refer to the `system_fingerprint` response parameter to monitor changes in the backend."},"stop":{"type":"string","description":"Not supported with latest reasoning models `o3` and `o4-mini`. Up to 4 sequences where the API will stop generating further tokens. The returned text will not contain the stop sequence."},"stream":{"type":"boolean","description":"Whether to stream back partial progress. If set, tokens will be sent as data-only [server-sent events](https://developer.mozilla.org/en-US/docs/Web/API/Server-sent_events/Using_server-sent_events#Event_stream_format) as they become available, with the stream terminated by a `data: [DONE]` message. [Example Python code](https://cookbook.openai.com/examples/how_to_stream_completions).","enum":[true,false]},"stream_options":{"type":"string","description":"Options for streaming response. Only set this when you set `stream: true`."},"suffix":{"type":"string","description":"The suffix that comes after a completion of inserted text. This parameter is only supported for `gpt-3.5-turbo-instruct`."},"temperature":{"type":"number","description":"What sampling temperature to use, between 0 and 2. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. We generally recommend altering this or `top_p` but not both."},"top_p":{"type":"number","description":"An alternative to sampling with temperature, called nucleus sampling, where the model considers the results of the tokens with top_p probability mass. So 0.1 means only the tokens comprising the top 10% probability mass are considered. We generally recommend altering this or `temperature` but not both."},"user":{"type":"string","description":"A unique identifier representing your end-user, which can help OpenAI to monitor and detect abuse. [Learn more](/api/docs/guides/safety-best-practices#implement-safety-identifiers)."}}},"example":{"best_of":"","echo":"","frequency_penalty":"","logit_bias":{},"logprobs":"","max_tokens":"","model":"","n":"","presence_penalty":"","prompt":"","seed":"","stop":"","stream":"","stream_options":"","suffix":"","temperature":"","top_p":"","user":""}}}}}},"/v1/videos":{"post":{"tags":["Videos"],"parameters":[],"responses":{"401":{"description":"Bearer token required (Authorization header)","content":{"application/json":{}}}},"externalDocs":{"api_ref":"https://developers.openai.com/api/reference/resources/videos/methods/create","api_endpoint":"https://api.openai.com/v1/videos"},"summary":"Create a video","description":"Create a new video generation job from a prompt and optional reference assets.","security":[{"bearerAuth":[]}],"requestBody":{"description":"","required":true,"content":{"application/json":{"schema":{"type":"object","required":[],"properties":{"input_reference":{"type":"string","description":"Optional reference object that guides generation. Provide exactly one of `image_url` or `file_id`."},"model":{"type":"string","description":"The video generation model to use (allowed values: sora-2, sora-2-pro). Defaults to `sora-2`."},"prompt":{"type":"string","description":"Text prompt that describes the video to generate.","required":true},"seconds":{"type":"string","description":"Clip duration in seconds (allowed values: 4, 8, 12). Defaults to 4 seconds."},"size":{"type":"string","description":"Output resolution formatted as width x height (allowed values: 720x1280, 1280x720, 1024x1792, 1792x1024). Defaults to 720x1280."}}},"example":{"input_reference":"","model":"","prompt":"","seconds":"","size":""}}}}},"get":{"tags":["Videos"],"parameters":[{"name":"after","in":"query","description":"Identifier for the last item from the previous pagination request","schema":{"type":"string","example":""}},{"name":"limit","in":"query","description":"Number of items to retrieve","schema":{"type":"number","example":""}},{"name":"order","in":"query","description":"Sort order of results by timestamp. Use `asc` for ascending order or `desc` for descending order.","schema":{"type":"string","example":"","items":{"type":"string","enum":["asc","desc"]}}}],"responses":{"401":{"description":"Bearer token required (Authorization header)","content":{"application/json":{}}}},"externalDocs":{"api_ref":"https://developers.openai.com/api/reference/resources/videos/methods/list","api_endpoint":"https://api.openai.com/v1/videos"},"summary":"List videos","description":"List recently generated videos for the current project.","security":[{"bearerAuth":[]}]}},"/v1/videos/{video_id}":{"get":{"tags":["Videos"],"parameters":[{"name":"video_id","in":"path","description":"The ID of the video","required":true,"schema":{"type":"string","example":""}}],"responses":{"401":{"description":"Bearer token required (Authorization header)","content":{"application/json":{}}}},"externalDocs":{"api_ref":"https://developers.openai.com/api/reference/resources/videos/methods/retrieve","api_endpoint":"https://api.openai.com/v1/videos/{video_id}"},"summary":"Retrieve a video","description":"Fetch the latest metadata for a generated video.","security":[{"bearerAuth":[]}]},"delete":{"tags":["Videos"],"parameters":[{"name":"video_id","in":"path","description":"The ID of the video","required":true,"schema":{"type":"string","example":""}}],"responses":{"401":{"description":"Bearer token required (Authorization header)","content":{"application/json":{}}}},"externalDocs":{"api_ref":"https://developers.openai.com/api/reference/resources/videos/methods/delete","api_endpoint":"https://api.openai.com/v1/videos/{video_id}"},"summary":"Delete a video","description":"Permanently delete a completed or failed video and its stored assets.","security":[{"bearerAuth":[]}],"requestBody":{"description":"","required":true,"content":{"application/json":{"schema":{"type":"object","required":[],"properties":{}},"example":{}}}}}},"/v1/vector_stores/{vector_store_id}/search":{"post":{"tags":["Vector Stores"],"parameters":[{"name":"vector_store_id","in":"path","description":"The ID of the vector store that the file belongs to","required":true,"schema":{"type":"string","example":""}}],"responses":{"401":{"description":"Bearer token required (Authorization header)","content":{"application/json":{}}}},"externalDocs":{"api_ref":"https://developers.openai.com/api/reference/resources/vector_stores/methods/search","api_endpoint":"https://api.openai.com/v1/vector_stores/{vector_store_id}/search"},"summary":"Search vector store","description":"Search a vector store for relevant chunks based on a query and file attributes filter.","security":[{"bearerAuth":[]}],"requestBody":{"description":"","required":true,"content":{"application/json":{"schema":{"type":"object","required":[],"properties":{"filters":{"type":"string","description":"A filter to apply based on file attributes."},"max_num_results":{"type":"number","description":"The maximum number of results to return. This number should be between 1 and 50 inclusive."},"query":{"type":"string","description":"A query string for a search","required":true},"ranking_options":{"type":"object","description":"Ranking options for search.","properties":{"ranker":{"type":"string","enum":["none","auto","default-2024-11-15"]}}},"rewrite_query":{"type":"boolean","description":"Whether to rewrite the natural language query for vector search.","enum":[true,false]}}},"example":{"filters":"","max_num_results":"","query":"","ranking_options":{},"rewrite_query":""}}}}}},"/v1/vector_stores/{vector_store_id}/files/{file_id}/content":{"get":{"tags":["Vector Stores"],"parameters":[{"name":"file_id","in":"path","description":"The ID of the file","required":true,"schema":{"type":"string","example":""}},{"name":"vector_store_id","in":"path","description":"The ID of the vector store that the file belongs to","required":true,"schema":{"type":"string","example":""}}],"responses":{"401":{"description":"Bearer token required (Authorization header)","content":{"application/json":{}}}},"externalDocs":{"api_ref":"https://developers.openai.com/api/reference/resources/vector_stores/subresources/files/methods/content","api_endpoint":"https://api.openai.com/v1/vector_stores/{vector_store_id}/files/{file_id}/content"},"summary":"Retrieve vector store file content","description":"Retrieve the parsed contents of a vector store file.","security":[{"bearerAuth":[]}]}},"/v1/vector_stores/{vector_store_id}/file_batches":{"post":{"tags":["Vector Stores"],"parameters":[{"name":"vector_store_id","in":"path","description":"The ID of the vector store that the file belongs to","required":true,"schema":{"type":"string","example":""}}],"responses":{"401":{"description":"Bearer token required (Authorization header)","content":{"application/json":{}}}},"externalDocs":{"api_ref":"https://developers.openai.com/api/reference/resources/vector_stores/subresources/file_batches/methods/create","api_endpoint":"https://api.openai.com/v1/vector_stores/{vector_store_id}/file_batches"},"summary":"Create vector store file batch","description":"Create a vector store file batch.","security":[{"bearerAuth":[]}],"requestBody":{"description":"","required":true,"content":{"application/json":{"schema":{"type":"object","required":[],"properties":{"attributes":{"type":"object","description":"Set of 16 key-value pairs that can be attached to an object. This can be useful for storing additional information about the object in a structured format, and querying for objects via API or the dashboard. Keys are strings with a maximum length of 64 characters. Values are strings with a maximum length of 512 characters, booleans, or numbers.","properties":{}},"chunking_strategy":{"type":"string","description":"The chunking strategy used to chunk the file(s). If not set, will use the `auto` strategy."},"file_ids":{"type":"array","description":"A list of [File](/api/reference/resources/files) IDs that the vector store should use. Useful for tools like `file_search` that can access files. If `attributes` or `chunking_strategy` are provided, they will be applied to all files in the batch. The maximum batch size is 2000 files. This endpoint is recommended for multi-file ingestion and helps reduce per-vector-store write request pressure. Mutually exclusive with `files`.","items":{"type":"string"}},"files":{"type":"array","description":"A list of objects that each include a `file_id` plus optional `attributes` or `chunking_strategy`. Use this when you need to override metadata for specific files. The global `attributes` or `chunking_strategy` will be ignored and must be specified for each file. The maximum batch size is 2000 files. This endpoint is recommended for multi-file ingestion and helps reduce per-vector-store write request pressure. Mutually exclusive with `file_ids`.","items":{"type":"object","properties":{"file_id":{"type":"string","required":true}}}}}},"example":{"attributes":{},"chunking_strategy":"","file_ids":[],"files":[]}}}}}},"/v1/vector_stores/{vector_store_id}/file_batches/{batch_id}":{"get":{"tags":["Vector Stores"],"parameters":[{"name":"batch_id","in":"path","description":"The ID of the file batch","required":true,"schema":{"type":"string","example":""}},{"name":"vector_store_id","in":"path","description":"The ID of the vector store that the file belongs to","required":true,"schema":{"type":"string","example":""}}],"responses":{"401":{"description":"Bearer token required (Authorization header)","content":{"application/json":{}}}},"externalDocs":{"api_ref":"https://developers.openai.com/api/reference/resources/vector_stores/subresources/file_batches/methods/retrieve","api_endpoint":"https://api.openai.com/v1/vector_stores/{vector_store_id}/file_batches/{batch_id}"},"summary":"Retrieve vector store file batch","description":"Retrieves a vector store file batch.","security":[{"bearerAuth":[]}]}},"/v1/vector_stores/{vector_store_id}/file_batches/{batch_id}/cancel":{"post":{"tags":["Vector Stores"],"parameters":[{"name":"batch_id","in":"path","description":"The ID of the file batch","required":true,"schema":{"type":"string","example":""}},{"name":"vector_store_id","in":"path","description":"The ID of the vector store that the file belongs to","required":true,"schema":{"type":"string","example":""}}],"responses":{"401":{"description":"Bearer token required (Authorization header)","content":{"application/json":{}}}},"externalDocs":{"api_ref":"https://developers.openai.com/api/reference/resources/vector_stores/subresources/file_batches/methods/cancel","api_endpoint":"https://api.openai.com/v1/vector_stores/{vector_store_id}/file_batches/{batch_id}/cancel"},"summary":"Cancel vector store file batch","description":"Cancel a vector store file batch. This attempts to cancel the processing of files in this batch as soon as possible.","security":[{"bearerAuth":[]}],"requestBody":{"description":"","required":true,"content":{"application/json":{"schema":{"type":"object","required":[],"properties":{}},"example":{}}}}}},"/v1/vector_stores/{vector_store_id}/file_batches/{batch_id}/files":{"get":{"tags":["Vector Stores"],"parameters":[{"name":"batch_id","in":"path","description":"The ID of the file batch","required":true,"schema":{"type":"string","example":""}},{"name":"vector_store_id","in":"path","description":"The ID of the vector store that the file belongs to","required":true,"schema":{"type":"string","example":""}},{"name":"after","in":"query","description":"A cursor for use in pagination. `after` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with obj_foo, your subsequent call can include after=obj_foo in order to fetch the next page of the list.","schema":{"type":"string","example":""}},{"name":"before","in":"query","description":"A cursor for use in pagination. `before` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, starting with obj_foo, your subsequent call can include before=obj_foo in order to fetch the previous page of the list.","schema":{"type":"string","example":""}},{"name":"filter","in":"query","description":"Filter by file status. One of `in_progress`, `completed`, `failed`, `cancelled`.","schema":{"type":"string","example":"","items":{"type":"string","enum":["in_progress","completed","failed","cancelled"]}}},{"name":"limit","in":"query","description":"A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 20.","schema":{"type":"number","example":""}},{"name":"order","in":"query","description":"Sort order by the `created_at` timestamp of the objects. `asc` for ascending order and `desc` for descending order.","schema":{"type":"string","example":"","items":{"type":"string","enum":["asc","desc"]}}}],"responses":{"401":{"description":"Bearer token required (Authorization header)","content":{"application/json":{}}}},"externalDocs":{"api_ref":"https://developers.openai.com/api/reference/resources/vector_stores/subresources/file_batches/methods/list_files","api_endpoint":"https://api.openai.com/v1/vector_stores/{vector_store_id}/file_batches/{batch_id}/files"},"summary":"List vector store files in a batch","description":"Returns a list of vector store files in a batch.","security":[{"bearerAuth":[]}]}},"/v1/uploads":{"post":{"tags":["Uploads"],"parameters":[],"responses":{"401":{"description":"Bearer token required (Authorization header)","content":{"application/json":{}}}},"externalDocs":{"api_ref":"https://developers.openai.com/api/reference/resources/uploads/methods/create","api_endpoint":"https://api.openai.com/v1/uploads"},"summary":"Create upload","description":"Creates an intermediate [Upload](/api/reference/resources/uploads) object that you can add [Parts](/api/reference/resources/uploads/subresources/parts) to. Currently, an Upload can accept at most 8 GB in total and expires after an hour after you create it. Once you complete the Upload, we will create a [File](/api/reference/resources/files) object that contains all the parts you uploaded. This File is usable in the rest of our platform as a regular File object. For certain `purpose` values, the correct `mime_type` must be specified. Please refer to documentation for the [supported MIME types for your use case](/api/docs/guides/tools-file-search#supported-files). For guidance on the proper filename extensions for each purpose, please follow the documentation on [creating a File](/api/reference/resources/files/methods/create). Returns the Upload object with status `pending`.","security":[{"bearerAuth":[]}],"requestBody":{"description":"","required":false,"content":{"multipart/form-data":{"schema":{"type":"object","required":[],"properties":{"bytes":{"type":"number","description":"The number of bytes in the file you are uploading.","required":true},"expires_after":{"type":"object","description":"The expiration policy for a file. By default, files with `purpose=batch` expire after 30 days and all other files are persisted until they are manually deleted.","properties":{"anchor":{"type":"string","required":true,"enum":["created_at"]}}},"filename":{"type":"string","description":"The name of the file to upload.","required":true},"mime_type":{"type":"string","description":"The MIME type of the file. This must fall within the supported MIME types for your file purpose. See the supported MIME types for assistants and vision.","required":true},"purpose":{"type":"string","description":"The intended purpose of the uploaded file. See the [documentation on File purposes](/api/reference/resources/files/methods/create#%28resource%29%20files%20%3E%20%28method%29%20create%20%3E%20%28params%29%200%20%3E%20%28param%29%20purpose%20%3E%20%28schema%29).","required":true,"enum":["assistants","batch","fine-tune","vision"]}}},"example":{"bytes":"","expires_after":{},"filename":"","mime_type":"","purpose":""}}}}}},"/v1/uploads/{upload_id}/parts":{"post":{"tags":["Uploads"],"parameters":[{"name":"upload_id","in":"path","description":"The ID of the upload","required":true,"schema":{"type":"string","example":""}}],"responses":{"401":{"description":"Bearer token required (Authorization header)","content":{"application/json":{}}}},"externalDocs":{"api_ref":"https://developers.openai.com/api/reference/resources/uploads/subresources/parts/methods/create","api_endpoint":"https://api.openai.com/v1/uploads/{upload_id}/parts"},"summary":"Add upload part","description":"Adds a [Part](/api/reference/resources/uploads/subresources/parts) to an [Upload](/api/reference/resources/uploads) object. A Part represents a chunk of bytes from the file you are trying to upload. Each Part can be at most 64 MB, and you can add Parts until you hit the Upload maximum of 8 GB. It is possible to add multiple Parts in parallel. You can decide the intended order of the Parts when you [complete the Upload](/api/reference/resources/uploads/methods/complete).","security":[{"bearerAuth":[]}],"requestBody":{"description":"","required":false,"content":{"multipart/form-data":{"schema":{"type":"object","required":[],"properties":{}},"example":{}}}}}},"/v1/uploads/{upload_id}/cancel":{"post":{"tags":["Uploads"],"parameters":[{"name":"upload_id","in":"path","description":"The ID of the upload","required":true,"schema":{"type":"string","example":""}}],"responses":{"401":{"description":"Bearer token required (Authorization header)","content":{"application/json":{}}}},"externalDocs":{"api_ref":"https://developers.openai.com/api/reference/resources/uploads/methods/cancel","api_endpoint":"https://api.openai.com/v1/uploads/{upload_id}/cancel"},"summary":"Cancel upload","description":"Cancels the Upload. No Parts may be added after an Upload is cancelled. Returns the Upload object with status `cancelled`.","security":[{"bearerAuth":[]}],"requestBody":{"description":"","required":false,"content":{"multipart/form-data":{"schema":{"type":"object","required":[],"properties":{}},"example":{}}}}}},"/v1/fine_tuning/checkpoints/{fine_tuned_model_checkpoint}/permissions":{"post":{"tags":["Fine Tunes"],"parameters":[{"name":"fine_tuned_model_checkpoint","in":"path","description":"The ID of the fine-tuned model checkpoint","required":true,"schema":{"type":"string","example":""}}],"responses":{"401":{"description":"Bearer token required (Authorization header)","content":{"application/json":{}}}},"externalDocs":{"api_ref":"https://developers.openai.com/api/reference/resources/fine_tuning/subresources/checkpoints/subresources/permissions/methods/create","api_endpoint":"https://api.openai.com/v1/fine_tuning/checkpoints/{fine_tuned_model_checkpoint}/permissions"},"summary":"Create checkpoint permissions","description":"This enables organization owners to share fine-tuned models with other projects in their organization.","security":[{"bearerAuth":[]}],"requestBody":{"description":"","required":true,"content":{"application/json":{"schema":{"type":"object","required":[],"properties":{"project_ids":{"type":"array","description":"The project identifiers to grant access to.","required":true,"items":{"type":"string"}}}},"example":{"project_ids":[]}}}}},"get":{"tags":["Fine Tunes"],"parameters":[{"name":"fine_tuned_model_checkpoint","in":"path","description":"The ID of the fine-tuned model checkpoint","required":true,"schema":{"type":"string","example":""}},{"name":"after","in":"query","description":"Identifier for the last permission ID from the previous pagination request.","schema":{"type":"string","example":""}},{"name":"limit","in":"query","description":"Number of permissions to retrieve.","schema":{"type":"number","example":""}},{"name":"order","in":"query","description":"The order in which to retrieve permissions.","schema":{"type":"string","example":"","items":{"type":"string","enum":["ascending","descending"]}}},{"name":"project_id","in":"query","description":"The ID of the project to get permissions for.","schema":{"type":"string","example":""}}],"responses":{"401":{"description":"Bearer token required (Authorization header)","content":{"application/json":{}}}},"externalDocs":{"api_ref":"https://developers.openai.com/api/reference/resources/fine_tuning","api_endpoint":"https://api.openai.com/v1/fine_tuning/checkpoints/{fine_tuned_model_checkpoint}/permissions"},"summary":"List checkpoint permissions","description":"Organization owners can use this endpoint to view all permissions for a fine-tuned model checkpoint.","security":[{"bearerAuth":[]}]}},"/v1/fine_tuning/checkpoints/{fine_tuned_model_checkpoint}/permissions/{permission_id}":{"delete":{"tags":["Fine Tunes"],"parameters":[{"name":"fine_tuned_model_checkpoint","in":"path","description":"The ID of the fine-tuned model checkpoint","required":true,"schema":{"type":"string","example":""}},{"name":"permission_id","in":"path","description":"The ID of the permission","required":true,"schema":{"type":"string","example":""}}],"responses":{"401":{"description":"Bearer token required (Authorization header)","content":{"application/json":{}}}},"externalDocs":{"api_ref":"https://developers.openai.com/api/reference/resources/fine_tuning/subresources/checkpoints/subresources/permissions/methods/delete","api_endpoint":"https://api.openai.com/v1/fine_tuning/checkpoints/{fine_tuned_model_checkpoint}/permissions/{permission_id}"},"summary":"Delete checkpoint permission","description":"Organization owners can use this endpoint to delete a permission for a fine-tuned model checkpoint.","security":[{"bearerAuth":[]}],"requestBody":{"description":"","required":true,"content":{"application/json":{"schema":{"type":"object","required":[],"properties":{}},"example":{}}}}}},"/v1/fine_tuning/jobs/{fine_tuning_job_id}/pause":{"post":{"tags":["Fine Tunes"],"parameters":[{"name":"fine_tuning_job_id","in":"path","description":"The ID of the fine-tuning job","required":true,"schema":{"type":"string","example":""}}],"responses":{"401":{"description":"Bearer token required (Authorization header)","content":{"application/json":{}}}},"externalDocs":{"api_ref":"https://developers.openai.com/api/reference/resources/fine_tuning","api_endpoint":"https://api.openai.com/v1/fine_tuning/jobs/{fine_tuning_job_id}/pause"},"summary":"Pause fine-tuning","description":"Pause a fine-tune job.","security":[{"bearerAuth":[]}],"requestBody":{"description":"","required":true,"content":{"application/json":{"schema":{"type":"object","required":[],"properties":{}},"example":{}}}}}},"/v1/fine_tuning/jobs/{fine_tuning_job_id}/resume":{"post":{"tags":["Fine Tunes"],"parameters":[{"name":"fine_tuning_job_id","in":"path","description":"The ID of the fine-tuning job","required":true,"schema":{"type":"string","example":""}}],"responses":{"401":{"description":"Bearer token required (Authorization header)","content":{"application/json":{}}}},"externalDocs":{"api_ref":"https://developers.openai.com/api/reference/resources/fine_tuning","api_endpoint":"https://api.openai.com/v1/fine_tuning/jobs/{fine_tuning_job_id}/resume"},"summary":"Resume fine-tuning","description":"Resume a fine-tune job.","security":[{"bearerAuth":[]}],"requestBody":{"description":"","required":true,"content":{"application/json":{"schema":{"type":"object","required":[],"properties":{}},"example":{}}}}}},"/v1/evals":{"post":{"tags":["Evals"],"parameters":[],"responses":{"401":{"description":"Bearer token required (Authorization header)","content":{"application/json":{}}}},"externalDocs":{"api_ref":"https://developers.openai.com/api/reference/resources/evals/methods/create","api_endpoint":"https://api.openai.com/v1/evals"},"summary":"Create eval","description":"Create the structure of an evaluation that can be used to test a model's performance. An evaluation is a set of testing criteria and the config for a data source, which dictates the schema of the data used in the evaluation. After creating an evaluation, you can run it on different models and model parameters. We support several types of graders and datasources. For more information, see the [Evals guide](/api/docs/guides/evals).","security":[{"bearerAuth":[]}],"requestBody":{"description":"","required":true,"content":{"application/json":{"schema":{"type":"object","required":[],"properties":{"data_source_config":{"type":"object","description":"The configuration for the data source used for the evaluation runs. Dictates the schema of the data used in the evaluation.","required":true,"properties":{}},"metadata":{"type":"string","description":"Set of 16 key-value pairs that can be attached to an object. This can be useful for storing additional information about the object in a structured format, and querying for objects via API or the dashboard. Keys are strings with a maximum length of 64 characters. Values are strings with a maximum length of 512 characters."},"name":{"type":"string","description":"The name of the evaluation."},"testing_criteria":{"type":"array","description":"A list of graders for all eval runs in this group. Graders can reference variables in the data source using double curly braces notation, like `{{item.variable_name}}`. To reference the model's output, use the `sample` namespace (ie, `{{sample.output_text}}`).","required":true,"items":{"type":"string"}}}},"example":{"data_source_config":{},"metadata":"","name":"","testing_criteria":[]}}}}},"get":{"tags":["Evals"],"parameters":[{"name":"after","in":"query","description":"Identifier for the last eval from the previous pagination request.","schema":{"type":"string","example":""}},{"name":"limit","in":"query","description":"Number of evals to retrieve.","schema":{"type":"number","example":""}},{"name":"order","in":"query","description":"Sort order for evals by timestamp. Use `asc` for ascending order or `desc` for descending order.","schema":{"type":"string","example":"","items":{"type":"string","enum":["asc","desc"]}}},{"name":"order_by","in":"query","description":"Evals can be ordered by creation time or last updated time. Use","schema":{"type":"string","example":"","items":{"type":"string","enum":["created_at","updated_at"]}}}],"responses":{"401":{"description":"Bearer token required (Authorization header)","content":{"application/json":{}}}},"externalDocs":{"api_ref":"https://developers.openai.com/api/reference/resources/evals/methods/list","api_endpoint":"https://api.openai.com/v1/evals"},"summary":"List evals","description":"List evaluations for a project.","security":[{"bearerAuth":[]}]}},"/v1/evals/{eval_id}":{"get":{"tags":["Evals"],"parameters":[{"name":"eval_id","in":"path","description":"The ID of the eval","required":true,"schema":{"type":"string","example":""}}],"responses":{"401":{"description":"Bearer token required (Authorization header)","content":{"application/json":{}}}},"externalDocs":{"api_ref":"https://developers.openai.com/api/reference/resources/evals/methods/retrieve","api_endpoint":"https://api.openai.com/v1/evals/{eval_id}"},"summary":"Get an eval","description":"Get an evaluation by ID.","security":[{"bearerAuth":[]}]},"post":{"tags":["Evals"],"parameters":[{"name":"eval_id","in":"path","description":"The ID of the eval","required":true,"schema":{"type":"string","example":""}}],"responses":{"401":{"description":"Bearer token required (Authorization header)","content":{"application/json":{}}}},"externalDocs":{"api_ref":"https://developers.openai.com/api/reference/resources/evals/methods/update","api_endpoint":"https://api.openai.com/v1/evals/{eval_id}"},"summary":"Update an eval","description":"Update certain properties of an evaluation.","security":[{"bearerAuth":[]}],"requestBody":{"description":"","required":true,"content":{"application/json":{"schema":{"type":"object","required":[],"properties":{"metadata":{"type":"string","description":"Set of 16 key-value pairs that can be attached to an object. This can be useful for storing additional information about the object in a structured format, and querying for objects via API or the dashboard. Keys are strings with a maximum length of 64 characters. Values are strings with a maximum length of 512 characters."},"name":{"type":"string","description":"Rename the evaluation."}}},"example":{"metadata":"","name":""}}}}},"delete":{"tags":["Evals"],"parameters":[{"name":"eval_id","in":"path","description":"The ID of the eval","required":true,"schema":{"type":"string","example":""}}],"responses":{"401":{"description":"Bearer token required (Authorization header)","content":{"application/json":{}}}},"externalDocs":{"api_ref":"https://developers.openai.com/api/reference/resources/evals/methods/delete","api_endpoint":"https://api.openai.com/v1/evals/{eval_id}"},"summary":"Delete an eval","description":"Delete an evaluation.","security":[{"bearerAuth":[]}],"requestBody":{"description":"","required":true,"content":{"application/json":{"schema":{"type":"object","required":[],"properties":{}},"example":{}}}}}},"/v1/evals/{eval_id}/runs":{"post":{"tags":["Evals"],"parameters":[{"name":"eval_id","in":"path","description":"The ID of the eval","required":true,"schema":{"type":"string","example":""}}],"responses":{"401":{"description":"Bearer token required (Authorization header)","content":{"application/json":{}}}},"externalDocs":{"api_ref":"https://developers.openai.com/api/reference/resources/evals","api_endpoint":"https://api.openai.com/v1/evals/{eval_id}/runs"},"summary":"Create eval run","description":"Kicks off a new run for a given evaluation, specifying the data source, and what model configuration to use to test. The datasource will be validated against the schema specified in the config of the evaluation.","security":[{"bearerAuth":[]}],"requestBody":{"description":"","required":true,"content":{"application/json":{"schema":{"type":"object","required":[],"properties":{"data_source":{"type":"object","description":"Details about the run's data source.","required":true,"properties":{}},"metadata":{"type":"string","description":"Set of 16 key-value pairs that can be attached to an object. This can be useful for storing additional information about the object in a structured format, and querying for objects via API or the dashboard. Keys are strings with a maximum length of 64 characters. Values are strings with a maximum length of 512 characters."},"name":{"type":"string","description":"The name of the run."}}},"example":{"data_source":{},"metadata":"","name":""}}}}},"get":{"tags":["Evals"],"parameters":[{"name":"eval_id","in":"path","description":"The ID of the eval","required":true,"schema":{"type":"string","example":""}},{"name":"after","in":"query","description":"Identifier for the last run from the previous pagination request.","schema":{"type":"string","example":""}},{"name":"limit","in":"query","description":"Number of runs to retrieve.","schema":{"type":"number","example":""}},{"name":"order","in":"query","description":"Sort order for runs by timestamp. Use `asc` for ascending order or `desc` for descending order. Defaults to `asc`.","schema":{"type":"string","example":"","items":{"type":"string","enum":["asc","desc"]}}},{"name":"status","in":"query","description":"Filter runs by status. One of `queued` | `in_progress` | `failed` | `completed` | `canceled`.","schema":{"type":"string","example":"","items":{"type":"string","enum":["queued","in_progress","completed"]}}}],"responses":{"401":{"description":"Bearer token required (Authorization header)","content":{"application/json":{}}}},"externalDocs":{"api_ref":"https://developers.openai.com/api/reference/resources/evals","api_endpoint":"https://api.openai.com/v1/evals/{eval_id}/runs"},"summary":"Get eval runs","description":"Get a list of runs for an evaluation.","security":[{"bearerAuth":[]}]}},"/v1/evals/{eval_id}/runs/{run_id}":{"get":{"tags":["Evals"],"parameters":[{"name":"eval_id","in":"path","description":"The ID of the eval","required":true,"schema":{"type":"string","example":""}},{"name":"run_id","in":"path","description":"The ID of the eval run","required":true,"schema":{"type":"string","example":""}}],"responses":{"401":{"description":"Bearer token required (Authorization header)","content":{"application/json":{}}}},"externalDocs":{"api_ref":"https://developers.openai.com/api/reference/resources/evals","api_endpoint":"https://api.openai.com/v1/evals/{eval_id}/runs/{run_id}"},"summary":"Get an eval run","description":"Get an evaluation run by ID.","security":[{"bearerAuth":[]}]},"delete":{"tags":["Evals"],"parameters":[{"name":"eval_id","in":"path","description":"The ID of the eval","required":true,"schema":{"type":"string","example":""}},{"name":"run_id","in":"path","description":"The ID of the eval run","required":true,"schema":{"type":"string","example":""}}],"responses":{"401":{"description":"Bearer token required (Authorization header)","content":{"application/json":{}}}},"externalDocs":{"api_ref":"https://developers.openai.com/api/reference/resources/evals","api_endpoint":"https://api.openai.com/v1/evals/{eval_id}/runs/{run_id}"},"summary":"Delete eval run","description":"Delete an eval run.","security":[{"bearerAuth":[]}],"requestBody":{"description":"","required":true,"content":{"application/json":{"schema":{"type":"object","required":[],"properties":{}},"example":{}}}}}},"/v1/evals/{eval_id}/runs/{run_id}/cancel":{"post":{"tags":["Evals"],"parameters":[{"name":"eval_id","in":"path","description":"The ID of the eval","required":true,"schema":{"type":"string","example":""}},{"name":"run_id","in":"path","description":"The ID of the eval run","required":true,"schema":{"type":"string","example":""}}],"responses":{"401":{"description":"Bearer token required (Authorization header)","content":{"application/json":{}}}},"externalDocs":{"api_ref":"https://developers.openai.com/api/reference/resources/evals","api_endpoint":"https://api.openai.com/v1/evals/{eval_id}/runs/{run_id}/cancel"},"summary":"Cancel eval run","description":"Cancel an ongoing evaluation run.","security":[{"bearerAuth":[]}],"requestBody":{"description":"","required":true,"content":{"application/json":{"schema":{"type":"object","required":[],"properties":{}},"example":{}}}}}},"/v1/evals/{eval_id}/runs/{run_id}/output_items":{"get":{"tags":["Evals"],"parameters":[{"name":"eval_id","in":"path","description":"The ID of the eval","required":true,"schema":{"type":"string","example":""}},{"name":"run_id","in":"path","description":"The ID of the eval run","required":true,"schema":{"type":"string","example":""}},{"name":"after","in":"query","description":"Identifier for the last output item from the previous pagination request.","schema":{"type":"string","example":""}},{"name":"limit","in":"query","description":"Number of output items to retrieve.","schema":{"type":"number","example":""}},{"name":"order","in":"query","description":"Sort order for output items by timestamp. Use `asc` for ascending order or `desc` for descending order. Defaults to `asc`.","schema":{"type":"string","example":"","items":{"type":"string","enum":["asc","desc"]}}},{"name":"status","in":"query","description":"Filter output items by status. Use `failed` to filter by failed output items or `pass` to filter by passed output items.","schema":{"type":"string","example":"","items":{"type":"string","enum":["fail","pass"]}}}],"responses":{"401":{"description":"Bearer token required (Authorization header)","content":{"application/json":{}}}},"externalDocs":{"api_ref":"https://developers.openai.com/api/reference/resources/evals","api_endpoint":"https://api.openai.com/v1/evals/{eval_id}/runs/{run_id}/output_items"},"summary":"Get eval run output items","description":"Get a list of output items for an evaluation run.","security":[{"bearerAuth":[]}]}},"/v1/decisions":{"post":{"tags":["Decisions"],"parameters":[],"responses":{"401":{"description":"Bearer token required (Authorization header)","content":{"application/json":{}}}},"externalDocs":{"api_ref":"https://developers.openai.com/api/reference/resources/decisions/methods/create","api_endpoint":"https://api.openai.com/v1/decisions"},"summary":"Create a decision","description":"Use this endpoint to ask classification or scoring questions about the same input. You’ll get the answers back in the order you asked the questions. For text, you can pass a string. You can also send user messages containing `input_text` and `input_image` parts, with up to 128 images per request. Images can be base64 data URLs or publicly accessible HTTP(S) URLs. File IDs aren’t accepted. Other message roles, function calls, files, audio, and item references aren’t supported. Sometimes a question returns a refusal instead of an answer. The result has type `refusal` and includes the question’s name, or `null` if you didn’t give it one.","security":[{"bearerAuth":[]}],"requestBody":{"description":"","required":true,"content":{"application/json":{"schema":{"type":"object","required":[],"properties":{"input":{"type":"string","description":"The text or images to evaluate for every question. Provide a text string or user messages containing text and images. Images can be base64 data URLs or publicly accessible HTTP(S) URLs; at most 128 images are allowed across all messages in one request. Files, audio, tools, and item references are not supported.","required":true},"model":{"type":"string","description":"The model to use for the decision. The Decisions API is currently available with `gpt-6-luna`.","required":true},"questions":{"type":"array","description":"The classification or scoring questions to ask about the input. Answers come back in the order asked. Each question is one of `predicate`, `choice`, or `score`.","required":true,"items":{"type":"object","properties":{"type":{"type":"string","description":"The kind of question: `predicate` asks true/false, `choice` selects from provided options, `score` rates against provided levels.","required":true,"enum":["predicate","choice","score"]},"choices":{"type":"array","description":"The answer choices. Provide between 2 and 255 choices; each must be unique. Required for `choice` questions."},"instructions":{"type":"string","description":"The question instructions.","required":true},"levels":{"type":"array","description":"The score levels to rate against. Required for `score` questions."},"name":{"type":"string","description":"An optional correlation name for the question."}}}},"safety_identifier":{"type":"string","description":"Opaque caller-provided end-user identifier, scoped by the verified org. Match Responses' limit; this is never the authenticated user identity."}}},"example":{"input":"","model":"","questions":[],"safety_identifier":""}}}}}},"/v1/agents":{"post":{"tags":["Agents"],"parameters":[],"responses":{"401":{"description":"Bearer token required (Authorization header)","content":{"application/json":{}}}},"externalDocs":{"api_ref":"https://developers.openai.com/api/reference/resources/beta/subresources/agents/methods/create","api_endpoint":"https://api.openai.com/v1/agents"},"summary":"Create an agent","description":"Creates a reusable agent without storing credentials. See [agent configuration](https://developers.openai.com/api/docs/guides/agents-api/configuration).","security":[{"bearerAuth":[]}],"requestBody":{"description":"","required":true,"content":{"application/json":{"schema":{"type":"object","required":[],"properties":{"text":{"type":"string","description":"Configuration for generated text. Defaults to the `text` format and medium verbosity."},"instructions":{"type":"string","description":"Additional instructions appended to the agent's default base instructions. Omit or set to null to add no custom instructions."},"metadata":{"type":"object","description":"Up to 16 string key-value pairs, with keys up to 64 and values up to 512 characters. Omission or null defaults to an empty map."},"model":{"type":"string","description":"The model to use for the agent. The requested model name is preserved.","required":true},"multi_agent":{"type":"string","description":"Configuration for creating and coordinating subagents. Subagent tools are disabled by default."},"name":{"type":"string","description":"A human-readable name for the agent. Omission or null leaves the agent unnamed."},"reasoning":{"type":"string","description":"Configuration for model reasoning. Omission uses the model's default effort."},"service_tier":{"type":"string","description":"The service tier used for model requests. Defaults to `auto`."},"tools":{"type":"array","description":"Tools available to the agent. Defaults to an empty list. The tool list must fit within 3 MiB (3,145,728 bytes) of compact UTF-8 JSON.","items":{"type":"string"}}}},"example":{"text":"","instructions":"","metadata":{},"model":"","multi_agent":"","name":"","reasoning":"","service_tier":"","tools":[]}}}}},"get":{"tags":["Agents"],"parameters":[{"name":"after","in":"query","description":"Return resources after this resource ID in the selected order.","schema":{"type":"string","example":""}},{"name":"limit","in":"query","description":"The maximum number of resources to return, between 1 and 100. Defaults to 20.","schema":{"type":"integer","example":""}},{"name":"order","in":"query","description":"The order in which resources are returned. Defaults to `desc`.","schema":{"type":"string","example":"","items":{"type":"string","enum":["asc","desc"]}}}],"responses":{"401":{"description":"Bearer token required (Authorization header)","content":{"application/json":{}}}},"externalDocs":{"api_ref":"https://developers.openai.com/api/reference/resources/beta/subresources/agents/methods/list","api_endpoint":"https://api.openai.com/v1/agents"},"summary":"List agents","description":"Lists reusable agents in the current project. See [agent configuration](https://developers.openai.com/api/docs/guides/agents-api/configuration).","security":[{"bearerAuth":[]}]}},"/v1/agents/{agent_id}":{"get":{"tags":["Agents"],"parameters":[{"name":"agent_id","in":"path","description":"The ID of the reusable agent.","required":true,"schema":{"type":"string","example":""}}],"responses":{"401":{"description":"Bearer token required (Authorization header)","content":{"application/json":{}}}},"externalDocs":{"api_ref":"https://developers.openai.com/api/reference/resources/beta/subresources/agents/methods/retrieve","api_endpoint":"https://api.openai.com/v1/agents/{agent_id}"},"summary":"Retrieve an agent","description":"Retrieves a reusable agent by ID. See [agent configuration](https://developers.openai.com/api/docs/guides/agents-api/configuration).","security":[{"bearerAuth":[]}]},"post":{"tags":["Agents"],"parameters":[{"name":"agent_id","in":"path","description":"The ID of the reusable agent.","required":true,"schema":{"type":"string","example":""}}],"responses":{"401":{"description":"Bearer token required (Authorization header)","content":{"application/json":{}}}},"externalDocs":{"api_ref":"https://developers.openai.com/api/reference/resources/beta/subresources/agents/methods/update","api_endpoint":"https://api.openai.com/v1/agents/{agent_id}"},"summary":"Update an agent","description":"Updates a reusable agent. See [agent configuration](https://developers.openai.com/api/docs/guides/agents-api/configuration).","security":[{"bearerAuth":[]}],"requestBody":{"description":"","required":true,"content":{"application/json":{"schema":{"type":"object","required":[],"properties":{"text":{"type":"string","description":"Configuration for text generated by the agent."},"instructions":{"type":"string","description":"Additional instructions appended to the agent's default base instructions. Omit to leave unchanged."},"metadata":{"type":"object","description":"Replaces all metadata. Omit to leave unchanged, or pass null or {} to clear it. Up to 16 string key-value pairs, with keys up to 64 and values up to 512 characters."},"model":{"type":"string","description":"The model to use for the agent. The requested model name is preserved."},"multi_agent":{"type":"string","description":"Configuration for creating and coordinating subagents."},"name":{"type":"string","description":"A replacement name. Omit to leave unchanged, or pass null to clear it."},"reasoning":{"type":"string","description":"Configuration for model reasoning. Omit to keep the current settings; pass `null` to reset to the model's default effort."},"service_tier":{"type":"string","description":"The service tier used for model requests."},"tools":{"type":"array","description":"Replaces the tool list. Omit to leave it unchanged, or pass null to clear it. The replacement must fit within 3 MiB (3,145,728 bytes) of compact UTF-8 JSON.","items":{"type":"string"}}}},"example":{"text":"","instructions":"","metadata":{},"model":"","multi_agent":"","name":"","reasoning":"","service_tier":"","tools":[]}}}}},"delete":{"tags":["Agents"],"parameters":[{"name":"agent_id","in":"path","description":"The ID of the reusable agent.","required":true,"schema":{"type":"string","example":""}}],"responses":{"401":{"description":"Bearer token required (Authorization header)","content":{"application/json":{}}}},"externalDocs":{"api_ref":"https://developers.openai.com/api/reference/resources/beta/subresources/agents/methods/delete","api_endpoint":"https://api.openai.com/v1/agents/{agent_id}"},"summary":"Delete an agent","description":"Deletes a reusable agent. See [agent configuration](https://developers.openai.com/api/docs/guides/agents-api/configuration).","security":[{"bearerAuth":[]}],"requestBody":{"description":"","required":true,"content":{"application/json":{"schema":{"type":"object","required":[],"properties":{}},"example":{}}}}}},"/v1/agents/environments":{"post":{"tags":["Agents"],"parameters":[],"responses":{"401":{"description":"Bearer token required (Authorization header)","content":{"application/json":{}}}},"externalDocs":{"api_ref":"https://developers.openai.com/api/reference/resources/beta/subresources/agents/subresources/environments/methods/create","api_endpoint":"https://api.openai.com/v1/agents/environments"},"summary":"Create an agent environment","description":"Creates an OpenAI-hosted environment before creating a session. Requires access to the prewarming beta. An optional `Idempotency-Key` header (deduplicates creation for 24 hours within the organization, project, and creator) is supported by the API.","security":[{"bearerAuth":[]}],"requestBody":{"description":"","required":true,"content":{"application/json":{"schema":{"type":"object","required":[],"properties":{"environment":{"type":"string","description":"Configuration for a new prewarmed OpenAI-hosted environment.","required":true},"vault_ids":{"type":"array","description":"The IDs of up to 10 vaults made available to an OpenAI-hosted environment.","items":{"type":"string"}}}},"example":{"environment":"","vault_ids":[]}}}}},"get":{"tags":["Agents"],"parameters":[{"name":"type","in":"query","description":"The hosting type to list. Defaults to `openai_hosted`.","schema":{"type":"string","example":"","items":{"type":"string","enum":["openai_hosted"]}}},{"name":"after","in":"query","description":"Return resources after this resource ID in the selected order.","schema":{"type":"string","example":""}},{"name":"limit","in":"query","description":"The maximum number of resources to return, between 1 and 100. Defaults to 20.","schema":{"type":"integer","example":""}},{"name":"order","in":"query","description":"The order in which resources are returned. Defaults to `desc`.","schema":{"type":"string","example":"","items":{"type":"string","enum":["asc","desc"]}}}],"responses":{"401":{"description":"Bearer token required (Authorization header)","content":{"application/json":{}}}},"externalDocs":{"api_ref":"https://developers.openai.com/api/reference/resources/beta/subresources/agents/subresources/environments/methods/list","api_endpoint":"https://api.openai.com/v1/agents/environments"},"summary":"List agent environments","description":"Lists OpenAI-hosted environments owned by the authenticated principal. Requires access to the prewarming beta.","security":[{"bearerAuth":[]}]}},"/v1/agents/environments/{environment_id}":{"get":{"tags":["Agents"],"parameters":[{"name":"environment_id","in":"path","description":"The ID of the environment.","required":true,"schema":{"type":"string","example":""}}],"responses":{"401":{"description":"Bearer token required (Authorization header)","content":{"application/json":{}}}},"externalDocs":{"api_ref":"https://developers.openai.com/api/reference/resources/beta/subresources/agents/subresources/environments/methods/retrieve","api_endpoint":"https://api.openai.com/v1/agents/environments/{environment_id}"},"summary":"Retrieve an agent environment","description":"Retrieves an execution environment's connection status and safe installed metadata. See [environment lifecycle](https://developers.openai.com/api/docs/guides/agents-api/environments/lifecycle).","security":[{"bearerAuth":[]}]}},"/v1/agents/environments/{environment_id}/files":{"get":{"tags":["Agents"],"parameters":[{"name":"environment_id","in":"path","description":"The ID of the environment.","required":true,"schema":{"type":"string","example":""}},{"name":"path","in":"query","description":"Restrict the listing to this absolute workspace directory.","schema":{"type":["string","null"],"example":""}},{"name":"limit","in":"query","description":"The maximum number of files to return, between 1 and 100.","schema":{"type":["integer","null"],"example":""}},{"name":"order","in":"query","description":"Sort by case-sensitive path components. Defaults to descending.","schema":{"type":"string","example":"","items":{"type":"string","enum":["asc","desc"]}}},{"name":"page","in":"query","description":"The opaque token from the previous page. Keep the same path, order, and limit.","schema":{"type":"string","example":""}}],"responses":{"401":{"description":"Bearer token required (Authorization header)","content":{"application/json":{}}}},"externalDocs":{"api_ref":"https://developers.openai.com/api/reference/resources/beta/subresources/agents/subresources/environments/subresources/files/methods/list","api_endpoint":"https://api.openai.com/v1/agents/environments/{environment_id}/files"},"summary":"List agent environment files","description":"Lists live files on a connected execution environment with optional directory filtering and opaque cursor pagination. See [environment files](https://developers.openai.com/api/docs/guides/agents-api/environments/files).","security":[{"bearerAuth":[]}]},"post":{"tags":["Agents"],"parameters":[{"name":"environment_id","in":"path","description":"The ID of the environment.","required":true,"schema":{"type":"string","example":""}}],"responses":{"401":{"description":"Bearer token required (Authorization header)","content":{"application/json":{}}}},"externalDocs":{"api_ref":"https://developers.openai.com/api/reference/resources/beta/subresources/agents/subresources/environments/subresources/files/methods/create","api_endpoint":"https://api.openai.com/v1/agents/environments/{environment_id}/files"},"summary":"Create an agent environment file","description":"Copies inline bytes or a Files API file into a connected execution environment. See [environment files](https://developers.openai.com/api/docs/guides/agents-api/environments/files).","security":[{"bearerAuth":[]}],"requestBody":{"description":"","required":true,"content":{"application/json":{"schema":{"type":"object","required":[],"properties":{"type":{"type":"string","description":"The type of the object. Use `file_id` for a file previously uploaded through the Files API, or `inline` for standard-base64 data.","required":true,"enum":["file_id","inline"]},"path":{"type":"string","description":"The absolute destination path inside `/workspace`.","required":true},"data":{"type":"string","description":"The standard-base64-encoded file contents. Required when `type` is `inline`."},"file_id":{"type":"string","description":"The ID of the uploaded file. Required when `type` is `file_id`."}}},"example":{"type":"","path":"","data":"","file_id":""}}}}}},"/v1/agents/environments/templates":{"post":{"tags":["Agents"],"parameters":[],"responses":{"401":{"description":"Bearer token required (Authorization header)","content":{"application/json":{}}}},"externalDocs":{"api_ref":"https://developers.openai.com/api/reference/resources/beta/subresources/agents/subresources/environments/subresources/templates/methods/create","api_endpoint":"https://api.openai.com/v1/agents/environments/templates"},"summary":"Create an agent environment template","description":"Creates reusable environment configuration without returning confidential setup commands or environment values. See [reusing a hosted setup](https://developers.openai.com/api/docs/guides/agents-api/tools#reuse-a-hosted-plugin-setup).","security":[{"bearerAuth":[]}],"requestBody":{"description":"","required":true,"content":{"application/json":{"schema":{"type":"object","required":[],"properties":{"capability_directories":{"type":"array","description":"Directories that contain capabilities exposed to the agent. Defaults to an empty list.","items":{"type":"string"}},"desktop":{"type":"string","description":"Desktop provisioning. Omission or null inherits the template setting, or defaults to disabled."},"env":{"type":"object","description":"Environment variables made available to the agent."},"files":{"type":"array","description":"Files available before the agent starts. Defaults to an empty list.","items":{"type":"string"}},"name":{"type":"string","description":"An optional human-readable display name for the template."},"network":{"type":"string","description":"Network access policy for the environment. If omitted, the API version determines whether network access is enabled or disabled."},"packages":{"type":"string","description":"Packages to install in the environment. Defaults to empty package lists."},"plugins":{"type":"array","description":"Plugins provided as inline ZIP archives. Defaults to an empty list.","items":{"type":"string"}},"setup_commands":{"type":"array","description":"Ordered, confidential setup commands. Command bodies are never returned.","items":{"type":"string"}},"skills":{"type":"array","description":"Skills referenced by ID or provided as inline ZIP archives. Defaults to an empty list.","items":{"type":"string"}}}},"example":{"capability_directories":[],"desktop":"","env":{},"files":[],"name":"","network":"","packages":"","plugins":[],"setup_commands":[],"skills":[]}}}}},"get":{"tags":["Agents"],"parameters":[{"name":"after","in":"query","description":"Return resources after this resource ID in the selected order.","schema":{"type":"string","example":""}},{"name":"limit","in":"query","description":"The maximum number of resources to return, between 1 and 100. Defaults to 20.","schema":{"type":"integer","example":""}},{"name":"order","in":"query","description":"The order in which resources are returned. Defaults to `desc`.","schema":{"type":"string","example":"","items":{"type":"string","enum":["asc","desc"]}}}],"responses":{"401":{"description":"Bearer token required (Authorization header)","content":{"application/json":{}}}},"externalDocs":{"api_ref":"https://developers.openai.com/api/reference/resources/beta/subresources/agents/subresources/environments/subresources/templates/methods/list","api_endpoint":"https://api.openai.com/v1/agents/environments/templates"},"summary":"List agent environment templates","description":"Lists reusable environment templates without returning confidential values. See [reusing a hosted setup](https://developers.openai.com/api/docs/guides/agents-api/tools#reuse-a-hosted-plugin-setup).","security":[{"bearerAuth":[]}]}},"/v1/agents/environments/templates/{environment_template_id}":{"get":{"tags":["Agents"],"parameters":[{"name":"environment_template_id","in":"path","description":"The ID of the reusable environment template.","required":true,"schema":{"type":"string","example":""}}],"responses":{"401":{"description":"Bearer token required (Authorization header)","content":{"application/json":{}}}},"externalDocs":{"api_ref":"https://developers.openai.com/api/reference/resources/beta/subresources/agents/subresources/environments/subresources/templates/methods/retrieve","api_endpoint":"https://api.openai.com/v1/agents/environments/templates/{environment_template_id}"},"summary":"Retrieve an agent environment template","description":"Retrieves reusable environment configuration without returning confidential values. See [reusing a hosted setup](https://developers.openai.com/api/docs/guides/agents-api/tools#reuse-a-hosted-plugin-setup).","security":[{"bearerAuth":[]}]},"post":{"tags":["Agents"],"parameters":[{"name":"environment_template_id","in":"path","description":"The ID of the reusable environment template.","required":true,"schema":{"type":"string","example":""}}],"responses":{"401":{"description":"Bearer token required (Authorization header)","content":{"application/json":{}}}},"externalDocs":{"api_ref":"https://developers.openai.com/api/reference/resources/beta/subresources/agents/subresources/environments/subresources/templates/methods/update","api_endpoint":"https://api.openai.com/v1/agents/environments/templates/{environment_template_id}"},"summary":"Update an agent environment template","description":"Updates reusable environment configuration without returning confidential values. See [reusing a hosted setup](https://developers.openai.com/api/docs/guides/agents-api/tools#reuse-a-hosted-plugin-setup).","security":[{"bearerAuth":[]}],"requestBody":{"description":"","required":true,"content":{"application/json":{"schema":{"type":"object","required":[],"properties":{"capability_directories":{"type":"array","description":"Directories that expose capabilities to the agent.","items":{"type":"string"}},"desktop":{"type":"string","description":"Replacement desktop configuration, or null to disable the desktop."},"env":{"type":"object","description":"Replacement confidential environment values."},"files":{"type":"array","description":"Replacement file configuration materialized for each new session.","items":{"type":"string"}},"name":{"type":"string","description":"A replacement human-readable display name, or `null` to clear the name."},"network":{"type":"string","description":"Network access available after setup completes. Omit to preserve the current policy, or pass `null` to reset to the default policy."},"packages":{"type":"string","description":"Packages installed before the runtime network policy applies."},"plugins":{"type":"array","description":"Replacement plugin configuration installed for each new session.","items":{"type":"string"}},"setup_commands":{"type":"array","description":"Replacement confidential setup commands, never included in returned resources.","items":{"type":"string"}},"skills":{"type":"array","description":"Replacement skill configuration installed for each new session.","items":{"type":"string"}}}},"example":{"capability_directories":[],"desktop":"","env":{},"files":[],"name":"","network":"","packages":"","plugins":[],"setup_commands":[],"skills":[]}}}}},"delete":{"tags":["Agents"],"parameters":[{"name":"environment_template_id","in":"path","description":"The ID of the reusable environment template.","required":true,"schema":{"type":"string","example":""}}],"responses":{"401":{"description":"Bearer token required (Authorization header)","content":{"application/json":{}}}},"externalDocs":{"api_ref":"https://developers.openai.com/api/reference/resources/beta/subresources/agents/subresources/environments/subresources/templates/methods/delete","api_endpoint":"https://api.openai.com/v1/agents/environments/templates/{environment_template_id}"},"summary":"Delete an agent environment template","description":"Deletes reusable environment configuration and all confidential template inputs. See [reusing a hosted setup](https://developers.openai.com/api/docs/guides/agents-api/tools#reuse-a-hosted-plugin-setup).","security":[{"bearerAuth":[]}],"requestBody":{"description":"","required":true,"content":{"application/json":{"schema":{"type":"object","required":[],"properties":{}},"example":{}}}}}},"/v1/agents/sessions":{"post":{"tags":["Agents"],"parameters":[],"responses":{"401":{"description":"Bearer token required (Authorization header)","content":{"application/json":{}}}},"externalDocs":{"api_ref":"https://developers.openai.com/api/reference/resources/beta/subresources/agents/subresources/sessions/methods/create","api_endpoint":"https://api.openai.com/v1/agents/sessions"},"summary":"Create an agent session","description":"Creates a managed agent session, optionally submits initial input, and returns the session or streams its events when stream is true. See [running sessions](https://developers.openai.com/api/docs/guides/agents-api/sessions).","security":[{"bearerAuth":[]}],"requestBody":{"description":"","required":true,"content":{"application/json":{"schema":{"type":"object","required":[],"properties":{"agent":{"type":"object","description":"Agent configuration for a session. Omitted fields inherit from `agent_id` when supplied. Supplied objects and arrays replace the whole field; null resets nullable fields.","properties":{"text":{"type":"string"},"instructions":{"type":["string","null"]},"model":{"type":"string"},"multi_agent":{"type":"string"},"reasoning":{"type":"string"},"service_tier":{"type":"string"},"tools":{"type":["array","null"]}}},"agent_id":{"type":"string","description":"The ID of a saved reusable agent. Omit `agent` to use its configuration unchanged."},"environment":{"type":"string","description":"The execution environment and optional reusable template for a session.","required":true},"input":{"type":"string","description":"Initial input to submit when the session is created. A string is shorthand for a single user message. Required when `environment.type` is `none`, or when `stream` is `true` for an environment that is not `self_hosted`; optional for self-hosted and non-streaming execution environments."},"metadata":{"type":"object","description":"Up to 16 string key-value pairs, with keys up to 64 and values up to 512 characters. Omission or null defaults to an empty map."},"spend_control":{"type":"string","description":"Optional spending limit in USD cents. Omission or null creates an unlimited session."},"stream":{"type":"boolean","description":"Whether to stream session events as server-sent events. Defaults to `false`.","enum":[true,false]},"vault_ids":{"type":"array","description":"The IDs of vaults made available to the session.","items":{"type":"string"}}}},"example":{"agent":{},"agent_id":"","environment":"","input":"","metadata":{},"spend_control":"","stream":"","vault_ids":[]}}}}},"get":{"tags":["Agents"],"parameters":[{"name":"after","in":"query","description":"Return resources after this resource ID in the selected order.","schema":{"type":"string","example":""}},{"name":"agent_id","in":"query","description":"Only return sessions whose root agent has this ID. Omit to return sessions for all agents.","schema":{"type":"string","example":""}},{"name":"limit","in":"query","description":"The maximum number of resources to return, between 1 and 100. Defaults to 20.","schema":{"type":"integer","example":""}},{"name":"order","in":"query","description":"The order in which resources are returned. Defaults to `desc`.","schema":{"type":"string","example":"","items":{"type":"string","enum":["asc","desc"]}}}],"responses":{"401":{"description":"Bearer token required (Authorization header)","content":{"application/json":{}}}},"externalDocs":{"api_ref":"https://developers.openai.com/api/reference/resources/beta/subresources/agents/subresources/sessions/methods/list","api_endpoint":"https://api.openai.com/v1/agents/sessions"},"summary":"List agent sessions","description":"Lists managed agent sessions using ID-based pagination and the requested sort order. See [managing sessions](https://developers.openai.com/api/docs/guides/agents-api/sessions/manage).","security":[{"bearerAuth":[]}]}},"/v1/agents/sessions/{session_id}":{"get":{"tags":["Agents"],"parameters":[{"name":"session_id","in":"path","description":"The ID of the session.","required":true,"schema":{"type":"string","example":""}}],"responses":{"401":{"description":"Bearer token required (Authorization header)","content":{"application/json":{}}}},"externalDocs":{"api_ref":"https://developers.openai.com/api/reference/resources/beta/subresources/agents/subresources/sessions/methods/retrieve","api_endpoint":"https://api.openai.com/v1/agents/sessions/{session_id}"},"summary":"Retrieve an agent session","description":"Retrieves the current state of a managed agent session. See [managing sessions](https://developers.openai.com/api/docs/guides/agents-api/sessions/manage).","security":[{"bearerAuth":[]}]},"post":{"tags":["Agents"],"parameters":[{"name":"session_id","in":"path","description":"The ID of the session.","required":true,"schema":{"type":"string","example":""}}],"responses":{"401":{"description":"Bearer token required (Authorization header)","content":{"application/json":{}}}},"externalDocs":{"api_ref":"https://developers.openai.com/api/reference/resources/beta/subresources/agents/subresources/sessions/methods/update","api_endpoint":"https://api.openai.com/v1/agents/sessions/{session_id}"},"summary":"Update an agent session","description":"Updates session metadata, model, reasoning effort, or service tier. Model settings apply to subsequent turns. Omitted fields are unchanged. See [managing sessions](https://developers.openai.com/api/docs/guides/agents-api/sessions/manage).","security":[{"bearerAuth":[]}],"requestBody":{"description":"","required":true,"content":{"application/json":{"schema":{"type":"object","required":[],"properties":{"agent":{"type":"object","description":"Model settings that can change after session creation.","properties":{"model":{"type":"string"},"reasoning":{"type":"object"},"service_tier":{"type":"string"}}},"metadata":{"type":"object","description":"Replaces all metadata. Omit to leave unchanged, or pass null or {} to clear it. Up to 16 string key-value pairs, with keys up to 64 and values up to 512 characters."},"spend_control":{"type":"string","description":"Omit to retain the limit; null or a null limit removes it without resetting spend."}}},"example":{"agent":{},"metadata":{},"spend_control":""}}}}},"delete":{"tags":["Agents"],"parameters":[{"name":"session_id","in":"path","description":"The ID of the session.","required":true,"schema":{"type":"string","example":""}}],"responses":{"401":{"description":"Bearer token required (Authorization header)","content":{"application/json":{}}}},"externalDocs":{"api_ref":"https://developers.openai.com/api/reference/resources/beta/subresources/agents/subresources/sessions/methods/delete","api_endpoint":"https://api.openai.com/v1/agents/sessions/{session_id}"},"summary":"Delete an agent session","description":"Removes a managed agent session from the public API and returns a deletion confirmation. If backend execution has ended, deletion can cancel a still-open public turn and abandon unpublished outputs. Running execution must be cancelled first. Physical cleanup may continue asynchronously. See [managing sessions](https://developers.openai.com/api/docs/guides/agents-api/sessions/manage).","security":[{"bearerAuth":[]}],"requestBody":{"description":"","required":true,"content":{"application/json":{"schema":{"type":"object","required":[],"properties":{}},"example":{}}}}}},"/v1/agents/sessions/{session_id}/artifacts":{"get":{"tags":["Agents"],"parameters":[{"name":"session_id","in":"path","description":"The ID of the session.","required":true,"schema":{"type":"string","example":""}},{"name":"after","in":"query","description":"Return resources after this resource ID in the selected order.","schema":{"type":"string","example":""}},{"name":"environment_id","in":"query","description":"Restrict the listing to artifacts produced by this environment.","schema":{"type":["string","null"],"example":""}},{"name":"limit","in":"query","description":"The maximum number of resources to return, between 1 and 100. Defaults to 20.","schema":{"type":"integer","example":""}},{"name":"order","in":"query","description":"The order in which resources are returned. Defaults to `desc`.","schema":{"type":"string","example":"","items":{"type":"string","enum":["asc","desc"]}}}],"responses":{"401":{"description":"Bearer token required (Authorization header)","content":{"application/json":{}}}},"externalDocs":{"api_ref":"https://developers.openai.com/api/reference/resources/beta/subresources/agents/subresources/sessions/subresources/artifacts/methods/list","api_endpoint":"https://api.openai.com/v1/agents/sessions/{session_id}/artifacts"},"summary":"List agent session artifacts","description":"Lists immutable artifacts published by completed hosted session turns. See [session artifacts](https://developers.openai.com/api/docs/guides/agents-api/environments/files#openai-hosted-artifacts).","security":[{"bearerAuth":[]}]}},"/v1/agents/sessions/{session_id}/artifacts/{artifact_id}":{"get":{"tags":["Agents"],"parameters":[{"name":"artifact_id","in":"path","description":"The immutable session artifact ID.","required":true,"schema":{"type":"string","example":""}},{"name":"session_id","in":"path","description":"The ID of the session that owns the artifact.","required":true,"schema":{"type":"string","example":""}}],"responses":{"401":{"description":"Bearer token required (Authorization header)","content":{"application/json":{}}}},"externalDocs":{"api_ref":"https://developers.openai.com/api/reference/resources/beta/subresources/agents/subresources/sessions/subresources/artifacts/methods/retrieve","api_endpoint":"https://api.openai.com/v1/agents/sessions/{session_id}/artifacts/{artifact_id}"},"summary":"Retrieve an agent session artifact","description":"Retrieves immutable metadata for one durable session artifact. See [session artifacts](https://developers.openai.com/api/docs/guides/agents-api/environments/files#openai-hosted-artifacts).","security":[{"bearerAuth":[]}]},"delete":{"tags":["Agents"],"parameters":[{"name":"artifact_id","in":"path","description":"The immutable session artifact ID.","required":true,"schema":{"type":"string","example":""}},{"name":"session_id","in":"path","description":"The ID of the session that owns the artifact.","required":true,"schema":{"type":"string","example":""}}],"responses":{"401":{"description":"Bearer token required (Authorization header)","content":{"application/json":{}}}},"externalDocs":{"api_ref":"https://developers.openai.com/api/reference/resources/beta/subresources/agents/subresources/sessions/subresources/artifacts/methods/delete","api_endpoint":"https://api.openai.com/v1/agents/sessions/{session_id}/artifacts/{artifact_id}"},"summary":"Delete an agent session artifact","description":"Deletes an immutable session artifact without deleting its live environment file or original Files API object. See [session artifacts](https://developers.openai.com/api/docs/guides/agents-api/environments/files#openai-hosted-artifacts).","security":[{"bearerAuth":[]}],"requestBody":{"description":"","required":true,"content":{"application/json":{"schema":{"type":"object","required":[],"properties":{}},"example":{}}}}}},"/v1/agents/sessions/{session_id}/artifacts/{artifact_id}/content":{"get":{"tags":["Agents"],"parameters":[{"name":"artifact_id","in":"path","description":"The immutable session artifact ID.","required":true,"schema":{"type":"string","example":""}},{"name":"session_id","in":"path","description":"The ID of the session that owns the artifact.","required":true,"schema":{"type":"string","example":""}}],"responses":{"401":{"description":"Bearer token required (Authorization header)","content":{"application/json":{}}}},"externalDocs":{"api_ref":"https://developers.openai.com/api/reference/resources/beta/subresources/agents/subresources/sessions/subresources/artifacts","api_endpoint":"https://api.openai.com/v1/agents/sessions/{session_id}/artifacts/{artifact_id}/content"},"summary":"Retrieve agent session artifact content","description":"Downloads immutable session artifact bytes after the execution environment expires. See [session artifacts](https://developers.openai.com/api/docs/guides/agents-api/environments/files#openai-hosted-artifacts).","security":[{"bearerAuth":[]}]}},"/v1/agents/sessions/{session_id}/events":{"get":{"tags":["Agents"],"parameters":[{"name":"session_id","in":"path","description":"The ID of the session.","required":true,"schema":{"type":"string","example":""}}],"responses":{"401":{"description":"Bearer token required (Authorization header)","content":{"application/json":{}}}},"externalDocs":{"api_ref":"https://developers.openai.com/api/reference/resources/beta/subresources/agents/subresources/sessions/subresources/events","api_endpoint":"https://api.openai.com/v1/agents/sessions/{session_id}/events"},"summary":"Stream agent session events","description":"Streams live events for an agent session. See [session events](https://developers.openai.com/api/docs/guides/agents-api/sessions/events).","security":[{"bearerAuth":[]}]},"post":{"tags":["Agents"],"parameters":[{"name":"session_id","in":"path","description":"The ID of the session.","required":true,"schema":{"type":"string","example":""}}],"responses":{"401":{"description":"Bearer token required (Authorization header)","content":{"application/json":{}}}},"externalDocs":{"api_ref":"https://developers.openai.com/api/reference/resources/beta/subresources/agents/subresources/sessions/subresources/events/methods/create","api_endpoint":"https://api.openai.com/v1/agents/sessions/{session_id}/events"},"summary":"Create agent session input events","description":"Submits message, cancellation, tool-result, or computer-use approval-response events to a managed agent session. Cancellation can recover a still-open turn whose backend execution has ended by marking it cancelled and abandoning unpublished outputs. Saved results, published files, and existing terminal outcomes are preserved. HTTP 202 confirms acceptance, not durable completion. See [session events](https://developers.openai.com/api/docs/guides/agents-api/sessions/events). An optional `Idempotency-Key` header makes retries of submitted messages idempotent.","security":[{"bearerAuth":[]}],"requestBody":{"description":"","required":true,"content":{"application/json":{"schema":{"type":"object","required":[],"properties":{"events":{"type":"array","description":"The input events to submit to the session.","required":true,"items":{"type":"object","properties":{"type":{"type":"string","description":"The type of input event: a message, a computer-use approval request result, a cancel, or a tool result.","required":true,"enum":["agent.session.input.message","agent.session.input.computer_use_approval_request_result","agent.session.input.cancel","agent.session.input.tool_result"]}}}}}},"example":{"events":[]}}}}}},"/v1/agents/sessions/{session_id}/items":{"get":{"tags":["Agents"],"parameters":[{"name":"session_id","in":"path","description":"The ID of the session.","required":true,"schema":{"type":"string","example":""}},{"name":"after","in":"query","description":"Return resources after this resource ID in the selected order.","schema":{"type":"string","example":""}},{"name":"limit","in":"query","description":"The maximum number of resources to return, between 1 and 100. Defaults to 20.","schema":{"type":"integer","example":""}},{"name":"order","in":"query","description":"The order in which resources are returned. Defaults to `desc`.","schema":{"type":"string","example":"","items":{"type":"string","enum":["asc","desc"]}}}],"responses":{"401":{"description":"Bearer token required (Authorization header)","content":{"application/json":{}}}},"externalDocs":{"api_ref":"https://developers.openai.com/api/reference/resources/beta/subresources/agents/subresources/sessions/subresources/items/methods/list","api_endpoint":"https://api.openai.com/v1/agents/sessions/{session_id}/items"},"summary":"List agent session items","description":"Lists items produced by the session's root agent, including its interactions with subagents. Each subagent has its own item history. See [inspecting agent output](https://developers.openai.com/api/docs/guides/agents-api/observability).","security":[{"bearerAuth":[]}]}},"/v1/agents/sessions/{session_id}/subagents":{"get":{"tags":["Agents"],"parameters":[{"name":"session_id","in":"path","description":"The ID of the session.","required":true,"schema":{"type":"string","example":""}},{"name":"after","in":"query","description":"Return resources after this resource ID in the selected order.","schema":{"type":"string","example":""}},{"name":"limit","in":"query","description":"The maximum number of resources to return, between 1 and 100. Defaults to 20.","schema":{"type":"integer","example":""}},{"name":"order","in":"query","description":"The order in which resources are returned. Defaults to `desc`.","schema":{"type":"string","example":"","items":{"type":"string","enum":["asc","desc"]}}}],"responses":{"401":{"description":"Bearer token required (Authorization header)","content":{"application/json":{}}}},"externalDocs":{"api_ref":"https://developers.openai.com/api/reference/resources/beta/subresources/agents/subresources/sessions/subresources/subagents/methods/list","api_endpoint":"https://api.openai.com/v1/agents/sessions/{session_id}/subagents"},"summary":"List session subagents","description":"Lists subagents in a session, including nested and closed subagents. See [subagent workflows](https://developers.openai.com/api/docs/guides/agents-api/multi-agent).","security":[{"bearerAuth":[]}]}},"/v1/agents/sessions/{session_id}/subagents/{subagent_id}":{"get":{"tags":["Agents"],"parameters":[{"name":"session_id","in":"path","description":"The ID of the session.","required":true,"schema":{"type":"string","example":""}},{"name":"subagent_id","in":"path","description":"The ID of the subagent in this session.","required":true,"schema":{"type":"string","example":""}}],"responses":{"401":{"description":"Bearer token required (Authorization header)","content":{"application/json":{}}}},"externalDocs":{"api_ref":"https://developers.openai.com/api/reference/resources/beta/subresources/agents/subresources/sessions/subresources/subagents/methods/retrieve","api_endpoint":"https://api.openai.com/v1/agents/sessions/{session_id}/subagents/{subagent_id}"},"summary":"Retrieve a session subagent","description":"Retrieves a subagent belonging to this session. See [subagent workflows](https://developers.openai.com/api/docs/guides/agents-api/multi-agent).","security":[{"bearerAuth":[]}]}},"/v1/agents/sessions/{session_id}/subagents/{subagent_id}/items":{"get":{"tags":["Agents"],"parameters":[{"name":"session_id","in":"path","description":"The ID of the session.","required":true,"schema":{"type":"string","example":""}},{"name":"subagent_id","in":"path","description":"The ID of the subagent in this session.","required":true,"schema":{"type":"string","example":""}},{"name":"after","in":"query","description":"Return resources after this resource ID in the selected order.","schema":{"type":"string","example":""}},{"name":"limit","in":"query","description":"The maximum number of resources to return, between 1 and 100. Defaults to 20.","schema":{"type":"integer","example":""}},{"name":"order","in":"query","description":"The order in which resources are returned. Defaults to `desc`.","schema":{"type":"string","example":"","items":{"type":"string","enum":["asc","desc"]}}}],"responses":{"401":{"description":"Bearer token required (Authorization header)","content":{"application/json":{}}}},"externalDocs":{"api_ref":"https://developers.openai.com/api/reference/resources/beta/subresources/agents/subresources/sessions/subresources/subagents/subresources/items/methods/list","api_endpoint":"https://api.openai.com/v1/agents/sessions/{session_id}/subagents/{subagent_id}/items"},"summary":"List subagent items","description":"Lists this subagent's own items across all of its turns. See [subagent workflows](https://developers.openai.com/api/docs/guides/agents-api/multi-agent).","security":[{"bearerAuth":[]}]}},"/v1/agents/sessions/{session_id}/subagents/{subagent_id}/turns":{"get":{"tags":["Agents"],"parameters":[{"name":"session_id","in":"path","description":"The ID of the session.","required":true,"schema":{"type":"string","example":""}},{"name":"subagent_id","in":"path","description":"The ID of the subagent in this session.","required":true,"schema":{"type":"string","example":""}},{"name":"after","in":"query","description":"Return resources after this resource ID in the selected order.","schema":{"type":"string","example":""}},{"name":"limit","in":"query","description":"The maximum number of resources to return, between 1 and 100. Defaults to 20.","schema":{"type":"integer","example":""}},{"name":"order","in":"query","description":"The order in which resources are returned. Defaults to `desc`.","schema":{"type":"string","example":"","items":{"type":"string","enum":["asc","desc"]}}}],"responses":{"401":{"description":"Bearer token required (Authorization header)","content":{"application/json":{}}}},"externalDocs":{"api_ref":"https://developers.openai.com/api/reference/resources/beta/subresources/agents/subresources/sessions/subresources/subagents/subresources/turns/methods/list","api_endpoint":"https://api.openai.com/v1/agents/sessions/{session_id}/subagents/{subagent_id}/turns"},"summary":"List subagent turns","description":"Lists all turns of this subagent, including turns after a resume. See [subagent workflows](https://developers.openai.com/api/docs/guides/agents-api/multi-agent).","security":[{"bearerAuth":[]}]}},"/v1/agents/sessions/{session_id}/subagents/{subagent_id}/turns/{turn_id}":{"get":{"tags":["Agents"],"parameters":[{"name":"session_id","in":"path","description":"The ID of the session.","required":true,"schema":{"type":"string","example":""}},{"name":"subagent_id","in":"path","description":"The ID of the subagent in this session.","required":true,"schema":{"type":"string","example":""}},{"name":"turn_id","in":"path","description":"The ID of a turn belonging to this subagent.","required":true,"schema":{"type":"string","example":""}}],"responses":{"401":{"description":"Bearer token required (Authorization header)","content":{"application/json":{}}}},"externalDocs":{"api_ref":"https://developers.openai.com/api/reference/resources/beta/subresources/agents/subresources/sessions/subresources/subagents/subresources/turns/methods/retrieve","api_endpoint":"https://api.openai.com/v1/agents/sessions/{session_id}/subagents/{subagent_id}/turns/{turn_id}"},"summary":"Retrieve a subagent turn","description":"Retrieves a turn belonging to this subagent. See [subagent workflows](https://developers.openai.com/api/docs/guides/agents-api/multi-agent).","security":[{"bearerAuth":[]}]}},"/v1/agents/sessions/{session_id}/subagents/{subagent_id}/turns/{turn_id}/items":{"get":{"tags":["Agents"],"parameters":[{"name":"session_id","in":"path","description":"The ID of the session.","required":true,"schema":{"type":"string","example":""}},{"name":"subagent_id","in":"path","description":"The ID of the subagent in this session.","required":true,"schema":{"type":"string","example":""}},{"name":"turn_id","in":"path","description":"The ID of a turn belonging to this subagent.","required":true,"schema":{"type":"string","example":""}},{"name":"after","in":"query","description":"Return resources after this resource ID in the selected order.","schema":{"type":"string","example":""}},{"name":"limit","in":"query","description":"The maximum number of resources to return, between 1 and 100. Defaults to 20.","schema":{"type":"integer","example":""}},{"name":"order","in":"query","description":"The order in which resources are returned. Defaults to `desc`.","schema":{"type":"string","example":"","items":{"type":"string","enum":["asc","desc"]}}}],"responses":{"401":{"description":"Bearer token required (Authorization header)","content":{"application/json":{}}}},"externalDocs":{"api_ref":"https://developers.openai.com/api/reference/resources/beta/subresources/agents/subresources/sessions/subresources/subagents/subresources/turns/subresources/items/methods/list","api_endpoint":"https://api.openai.com/v1/agents/sessions/{session_id}/subagents/{subagent_id}/turns/{turn_id}/items"},"summary":"List subagent turn items","description":"Lists items belonging to one turn of this subagent. See [subagent workflows](https://developers.openai.com/api/docs/guides/agents-api/multi-agent).","security":[{"bearerAuth":[]}]}},"/v1/agents/sessions/{session_id}/traces":{"get":{"tags":["Agents"],"parameters":[{"name":"session_id","in":"path","description":"The ID of the session.","required":true,"schema":{"type":"string","example":""}},{"name":"after","in":"query","description":"Return resources after this resource ID in the selected order.","schema":{"type":"string","example":""}},{"name":"limit","in":"query","description":"The maximum number of resources to return, between 1 and 100. Defaults to 20.","schema":{"type":"integer","example":""}},{"name":"order","in":"query","description":"The order in which resources are returned. Defaults to `desc`.","schema":{"type":"string","example":"","items":{"type":"string","enum":["asc","desc"]}}}],"responses":{"401":{"description":"Bearer token required (Authorization header)","content":{"application/json":{}}}},"externalDocs":{"api_ref":"https://developers.openai.com/api/reference/resources/beta/subresources/agents/subresources/sessions/subresources/traces/methods/list","api_endpoint":"https://api.openai.com/v1/agents/sessions/{session_id}/traces"},"summary":"List agent session traces","description":"Lists published root-turn traces as OTLP JSON, ordered by turn creation time and ID. Unpublished traces are skipped. Each page returns data available when read; it does not wait for late traces. Trace reads and the JSON response are limited to 16 MiB per request. If the limit is exceeded, request fewer traces.","security":[{"bearerAuth":[]}]}},"/v1/agents/sessions/{session_id}/turns":{"get":{"tags":["Agents"],"parameters":[{"name":"session_id","in":"path","description":"The ID of the session.","required":true,"schema":{"type":"string","example":""}},{"name":"after","in":"query","description":"Return resources after this resource ID in the selected order.","schema":{"type":"string","example":""}},{"name":"limit","in":"query","description":"The maximum number of resources to return, between 1 and 100. Defaults to 20.","schema":{"type":"integer","example":""}},{"name":"order","in":"query","description":"The order in which resources are returned. Defaults to `desc`.","schema":{"type":"string","example":"","items":{"type":"string","enum":["asc","desc"]}}}],"responses":{"401":{"description":"Bearer token required (Authorization header)","content":{"application/json":{}}}},"externalDocs":{"api_ref":"https://developers.openai.com/api/reference/resources/beta/subresources/agents/subresources/sessions/subresources/turns/methods/list","api_endpoint":"https://api.openai.com/v1/agents/sessions/{session_id}/turns"},"summary":"List agent session turns","description":"Lists turns by creation time and turn ID. The after cursor is exclusive in the selected order. See [session turns](https://developers.openai.com/api/docs/guides/agents-api/sessions/manage#inspect-session-turns).","security":[{"bearerAuth":[]}]}},"/v1/agents/sessions/{session_id}/turns/{turn_id}":{"get":{"tags":["Agents"],"parameters":[{"name":"session_id","in":"path","description":"The ID of the session that owns the turn.","required":true,"schema":{"type":"string","example":""}},{"name":"turn_id","in":"path","description":"The ID of the turn.","required":true,"schema":{"type":"string","example":""}}],"responses":{"401":{"description":"Bearer token required (Authorization header)","content":{"application/json":{}}}},"externalDocs":{"api_ref":"https://developers.openai.com/api/reference/resources/beta/subresources/agents/subresources/sessions/subresources/turns/methods/retrieve","api_endpoint":"https://api.openai.com/v1/agents/sessions/{session_id}/turns/{turn_id}"},"summary":"Retrieve an agent session turn","description":"Retrieves a turn's current status, timestamps, usage, and error. Returns 404 if the turn does not belong to the session. See [session turns](https://developers.openai.com/api/docs/guides/agents-api/sessions/manage#inspect-session-turns).","security":[{"bearerAuth":[]}]}},"/v1/agents/sessions/{session_id}/turns/{turn_id}/items":{"get":{"tags":["Agents"],"parameters":[{"name":"session_id","in":"path","description":"The ID of the session that owns the turn.","required":true,"schema":{"type":"string","example":""}},{"name":"turn_id","in":"path","description":"The ID of the turn.","required":true,"schema":{"type":"string","example":""}},{"name":"after","in":"query","description":"Return resources after this resource ID in the selected order.","schema":{"type":"string","example":""}},{"name":"limit","in":"query","description":"The maximum number of resources to return, between 1 and 100. Defaults to 20.","schema":{"type":"integer","example":""}},{"name":"order","in":"query","description":"The order in which resources are returned. Defaults to `desc`.","schema":{"type":"string","example":"","items":{"type":"string","enum":["asc","desc"]}}}],"responses":{"401":{"description":"Bearer token required (Authorization header)","content":{"application/json":{}}}},"externalDocs":{"api_ref":"https://developers.openai.com/api/reference/resources/beta/subresources/agents/subresources/sessions/subresources/turns/subresources/items/methods/list","api_endpoint":"https://api.openai.com/v1/agents/sessions/{session_id}/turns/{turn_id}/items"},"summary":"List agent session turn items","description":"Lists items belonging to one root-agent turn, including its interactions with subagents. See [inspecting agent output](https://developers.openai.com/api/docs/guides/agents-api/observability).","security":[{"bearerAuth":[]}]}},"/v1/live/sessions":{"post":{"tags":["Live"],"parameters":[],"responses":{"401":{"description":"Bearer token required (Authorization header)","content":{"application/json":{}}}},"externalDocs":{"api_ref":"https://developers.openai.com/api/docs/guides/live","api_endpoint":"https://api.openai.com/v1/live/sessions"},"summary":"Create session","description":"Create a Live WebRTC session or place an outbound SIP call. Start with the [Live prompting guide](https://developers.openai.com/api/docs/guides/live-prompting) for session configuration and [Telephony and SIP](https://developers.openai.com/api/docs/guides/voice-sip?api=live#place-an-outbound-call) for trunk setup and call monitoring. Set transport.type to `webrtc` and supply an SDP offer, or set it to `sip` and supply an E.164 destination and trunk credentials. Outbound SIP calling must be enabled for your organization. Ringing is limited to 3 minutes and connected calls to 2 hours; these limits are not configurable in the request. Returns `201 Created` after session initialization. WebRTC r","security":[{"bearerAuth":[]}],"requestBody":{"description":"","required":true,"content":{"application/json":{"schema":{"type":"object","required":[],"properties":{"session":{"type":"object","description":"Startup configuration for a Live media session. Follow the [Live prompting guide](https://developers.openai.com/api/docs/guides/live-prompting) when writing frontend instructions and the backend prompt under delegation.responses.instructions.","required":true,"properties":{"audio":{"type":"object"},"client":{"type":"object"},"delegation":{"type":"string"},"input":{"type":"array","description":"Ordered text-only history supplied before startup. Supports developer, user, and assistant messages with one text part each; at most 128 messages and 8,192 rendered tokens in total."},"instructions":{"type":"string"},"model":{"type":"string","required":true},"store":{"type":"boolean"}}},"transport":{"type":"string","description":"WebRTC transport with an SDP offer, or SIP transport with a destination and per-call trunk credentials.","required":true}}},"example":{"session":{},"transport":""}}}}}},"/v1/live/sessions/{session_id}/accept":{"post":{"tags":["Live"],"parameters":[{"name":"session_id","in":"path","description":"Opaque Live session identifier from the creation response or incoming-call webhook. Preserve the returned value unchanged, including its prefix.","required":true,"schema":{"type":"string","example":""}}],"responses":{"401":{"description":"Bearer token required (Authorization header)","content":{"application/json":{}}}},"externalDocs":{"api_ref":"https://developers.openai.com/api/docs/guides/voice-sip?api=live","api_endpoint":"https://api.openai.com/v1/live/sessions/{session_id}/accept"},"summary":"Accept call","description":"Accept an incoming SIP call. Supply session with type live, the model, and startup configuration. Before accepting calls, follow the [Live prompting guide](https://developers.openai.com/api/docs/guides/live-prompting) to write frontend conversation instructions and a separate backend prompt. SIP media format is negotiated; omit audio.format.","security":[{"bearerAuth":[]}],"requestBody":{"description":"","required":true,"content":{"application/json":{"schema":{"type":"object","required":[],"properties":{"session":{"type":"object","description":"Startup configuration for accepting an incoming Live SIP call. Follow the [Live prompting guide](https://developers.openai.com/api/docs/guides/live-prompting) when writing frontend and backend instructions.","required":true,"properties":{"type":{"type":"string","required":true,"enum":["live"]},"audio":{"type":"object"},"delegation":{"type":"string"},"input":{"type":"array","description":"Ordered text-only history supplied before startup. Supports developer, user, and assistant messages with one text part each; at most 128 messages and 8,192 rendered tokens in total."},"instructions":{"type":"string"},"model":{"type":"string","required":true},"store":{"type":"boolean"}}}}},"example":{"session":{}}}}}}},"/v1/live/sessions/{session_id}/content":{"get":{"tags":["Live"],"parameters":[{"name":"session_id","in":"path","description":"The ID of the stored Live session to download. Use the session ID returned when the session started with storage enabled.","required":true,"schema":{"type":"string","example":""}}],"responses":{"401":{"description":"Bearer token required (Authorization header)","content":{"application/json":{}}}},"externalDocs":{"api_ref":"https://developers.openai.com/api/docs/guides/live","api_endpoint":"https://api.openai.com/v1/live/sessions/{session_id}/content"},"summary":"Download recording","description":"Get Live session content","security":[{"bearerAuth":[]}]}},"/v1/live/sessions/{session_id}/fork":{"post":{"tags":["Live"],"parameters":[{"name":"session_id","in":"path","description":"The ID of the stored Live session to fork.","required":true,"schema":{"type":"string","example":""}}],"responses":{"401":{"description":"Bearer token required (Authorization header)","content":{"application/json":{}}}},"externalDocs":{"api_ref":"https://developers.openai.com/api/docs/guides/live","api_endpoint":"https://api.openai.com/v1/live/sessions/{session_id}/fork"},"summary":"Fork session","description":"Fork a stored Live session onto a new WebRTC connection.","security":[{"bearerAuth":[]}],"requestBody":{"description":"","required":true,"content":{"application/json":{"schema":{"type":"object","required":[],"properties":{"session":{"type":"object","description":"Optional overrides for a stored Live session. Omitted settings are inherited. The model, voice, frontend instructions, and prior conversation come from the stored session. WebRTC negotiates its audio format; audio.format is only supported on WebSocket forks.","properties":{"client":{"type":"object"},"delegation":{"type":"object"},"store":{"type":"boolean"}}},"transport":{"type":"object","description":"WebRTC transport carrying the offer SDP in a creation request or answer SDP in its response.","required":true,"properties":{"type":{"type":"string","required":true,"enum":["webrtc"]},"sdp":{"type":"string","required":true}}}}},"example":{"session":{},"transport":{}}}}}}},"/v1/live/sessions/{session_id}/hangup":{"post":{"tags":["Live"],"parameters":[{"name":"session_id","in":"path","description":"Opaque Live session identifier from the creation response or incoming-call webhook. Preserve the returned value unchanged, including its prefix.","required":true,"schema":{"type":"string","example":""}}],"responses":{"401":{"description":"Bearer token required (Authorization header)","content":{"application/json":{}}}},"externalDocs":{"api_ref":"https://developers.openai.com/api/docs/guides/voice-sip?api=live","api_endpoint":"https://api.openai.com/v1/live/sessions/{session_id}/hangup"},"summary":"Hang up session","description":"End a SIP call identified by session_id.","security":[{"bearerAuth":[]}],"requestBody":{"description":"","required":true,"content":{"application/json":{"schema":{"type":"object","required":[],"properties":{}},"example":{}}}}}},"/v1/live/sessions/{session_id}/refer":{"post":{"tags":["Live"],"parameters":[{"name":"session_id","in":"path","description":"Opaque Live session identifier from the creation response or incoming-call webhook. Preserve the returned value unchanged, including its prefix.","required":true,"schema":{"type":"string","example":""}}],"responses":{"401":{"description":"Bearer token required (Authorization header)","content":{"application/json":{}}}},"externalDocs":{"api_ref":"https://developers.openai.com/api/docs/guides/voice-sip?api=live","api_endpoint":"https://api.openai.com/v1/live/sessions/{session_id}/refer"},"summary":"Transfer call","description":"Transfer a SIP call to another destination. Supply a nonblank target_uri for the SIP Refer-To header.","security":[{"bearerAuth":[]}],"requestBody":{"description":"","required":true,"content":{"application/json":{"schema":{"type":"object","required":[],"properties":{"target_uri":{"type":"string","description":"URI that should appear in the SIP Refer-To header. Supports values like `tel:+14155550123` or `sip:agent@example.com`.","required":true}}},"example":{"target_uri":""}}}}}},"/v1/live/sessions/{session_id}/reject":{"post":{"tags":["Live"],"parameters":[{"name":"session_id","in":"path","description":"Opaque Live session identifier from the creation response or incoming-call webhook. Preserve the returned value unchanged, including its prefix.","required":true,"schema":{"type":"string","example":""}}],"responses":{"401":{"description":"Bearer token required (Authorization header)","content":{"application/json":{}}}},"externalDocs":{"api_ref":"https://developers.openai.com/api/docs/guides/voice-sip?api=live","api_endpoint":"https://api.openai.com/v1/live/sessions/{session_id}/reject"},"summary":"Reject call","description":"Reject an incoming SIP call. Send a required SIP rejection status_code between 300 and 699.","security":[{"bearerAuth":[]}],"requestBody":{"description":"","required":true,"content":{"application/json":{"schema":{"type":"object","required":[],"properties":{"status_code":{"type":"number","description":"SIP rejection status sent to the caller. This field is required.","required":true}}},"example":{"status_code":""}}}}}},"/v1/responses/input_tokens":{"post":{"tags":["Responses"],"parameters":[],"responses":{"401":{"description":"Bearer token required (Authorization header)","content":{"application/json":{}}}},"externalDocs":{"api_ref":"https://developers.openai.com/api/reference/resources/responses/subresources/input_tokens","api_endpoint":"https://api.openai.com/v1/responses/input_tokens"},"summary":"Get input token counts","description":"Returns input token counts of the request. Returns an object with `object` set to `response.input_tokens` and an `input_tokens` count.","security":[{"bearerAuth":[]}],"requestBody":{"description":"","required":true,"content":{"application/json":{"schema":{"type":"object","required":[],"properties":{"text":{"type":"string","description":"Configuration options for a text response from the model. Can be plain text or structured JSON data. Learn more:"},"conversation":{"type":"string","description":"The conversation that this response belongs to. Items from this conversation are prepended to `input_items` for this response request. Input items and output items from this response are automatically added to this conversation after this response completes."},"input":{"type":"string","description":"Text, image, or file inputs to the model, used to generate a response. Learn more:"},"instructions":{"type":"string","description":"A system (or developer) message inserted into the model's context. When using along with `previous_response_id`, the instructions from a previous response will not be carried over to the next response. This makes it simple to swap out system (or developer) messages in new responses."},"model":{"type":"string","description":"Model ID used to generate the response, like `gpt-6-astra`. OpenAI offers a wide range of models with different capabilities, performance characteristics, and price points. Refer to the [model guide](/api/docs/models) to browse and compare available models."},"parallel_tool_calls":{"type":"string","description":"Whether to allow the model to run tool calls in parallel."},"personality":{"type":"string","description":"A model-owned style preset to apply to this request. Omit this parameter to use the model's default style. Supported values may expand over time. Values must be at most 64 characters."},"previous_response_id":{"type":"string","description":"The unique ID of the previous response to the model. Use this to create multi-turn conversations. Learn more about [conversation state](/api/docs/guides/conversation-state). Cannot be used in conjunction with `conversation`."},"reasoning":{"type":"string","description":"Configuration options for [reasoning models](/api/docs/guides/reasoning)."},"tool_choice":{"type":"string","description":"How the model should select which tool (or tools) to use when generating a response. See the `tools` parameter to see how to specify which tools the model can call."},"tools":{"type":"string","description":"An array of tools the model may call while generating a response. You can specify which tool to use by setting the `tool_choice` parameter. We support the following categories of tools:"},"truncation":{"type":"string","description":"The truncation strategy to use for the model response.","enum":["auto","disabled"]}}},"example":{"text":"","conversation":"","input":"","instructions":"","model":"","parallel_tool_calls":"","personality":"","previous_response_id":"","reasoning":"","tool_choice":"","tools":"","truncation":""}}}}}},"/v1/uploads/{upload_id}/complete":{"post":{"tags":["Uploads"],"parameters":[{"name":"upload_id","in":"path","description":"The ID of the Upload.","required":true,"schema":{"type":"string","example":""}}],"responses":{"401":{"description":"Bearer token required (Authorization header)","content":{"application/json":{}}}},"externalDocs":{"api_ref":"https://developers.openai.com/api/reference/resources/uploads/methods/complete","api_endpoint":"https://api.openai.com/v1/uploads/{upload_id}/complete"},"summary":"Complete upload","description":"Completes the [Upload](https://developers.openai.com/api/reference/resources/uploads). Within the returned Upload object, there is a nested [File](https://developers.openai.com/api/reference/resources/files) object that is ready to use in the rest of the platform. You can specify the order of the Parts by passing in an ordered list of the Part IDs. The number of bytes uploaded upon completion must match the number of bytes initially specified when creating the Upload object. No Parts may be added after an Upload is completed. Returns the Upload object with status `completed`, including an additional `file` property containing the created usable File object.","security":[{"bearerAuth":[]}],"requestBody":{"description":"","required":false,"content":{"multipart/form-data":{"schema":{"type":"object","required":[],"properties":{"md5":{"type":"string","description":"The optional md5 checksum for the file contents to verify if the bytes uploaded matches what you expect."},"part_ids":{"type":"array","description":"The ordered list of Part IDs.","required":true,"items":{"type":"string"}}}},"example":{"md5":"","part_ids":[]}}}}}}},"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer"}}},"security":[{"bearerAuth":[]}]}