1{"responses":{"200":{"description":"Chat completion generated successfully","content":{"application/json":{"schema":{"type":"object","description":"Represents a chat completion response returned by model, based on the provided input.","required":["id","choices","created","model","object"],"properties":{"choices":{"type":"array","items":{"type":"object","required":["index","message"],"properties":{"finish_reason":{"oneOf":[{"type":"null"},{"description":"The reason the model stopped generating tokens. This will be `stop` if the model hit a natural stop point or a provided stop sequence,\n`length` if the maximum number of tokens specified in the request was reached,\n`content_filter` if content was omitted due to a flag from our content filters,\n`tool_calls` if the model called a tool, or `function_call` (deprecated) if the model called a function.","type":"string","enum":["stop","length","tool_calls","content_filter","function_call"],"title":"FinishReason"}]},"index":{"type":"integer","format":"int32","description":"The index of the choice in the list of choices.","minimum":0},"logprobs":{"oneOf":[{"type":"null"},{"description":"Log probability information for the choice.","type":"object","properties":{"content":{"type":["array","null"],"items":{"type":"object","required":["token","logprob","top_logprobs"],"properties":{"bytes":{"type":["array","null"],"items":{"type":"integer","format":"int32","minimum":0},"description":"A list of integers representing the UTF-8 bytes representation of the token. Useful in instances where characters are represented by multiple tokens and their byte representations must be combined to generate the correct text representation. Can be `null` if there is no bytes representation for the token."},"logprob":{"type":"number","format":"float","description":"The log probability of this token, if it is within the top 20 most likely tokens. Otherwise, the value `-9999.0` is used to signify that the token is very unlikely."},"token":{"type":"string","description":"The token."},"top_logprobs":{"type":"array","items":{"type":"object","required":["token","logprob"],"properties":{"bytes":{"type":["array","null"],"items":{"type":"integer","format":"int32","minimum":0},"description":"A list of integers representing the UTF-8 bytes representation of the token. Useful in instances where characters are represented by multiple tokens and their byte representations must be combined to generate the correct text representation. Can be `null` if there is no bytes representation for the token."},"logprob":{"type":"number","format":"float","description":"The log probability of this token."},"token":{"type":"string","description":"The token."}},"title":"TopLogprobs"},"description":"List of the most likely tokens and their log probability, at this token position. In rare cases, there may be fewer than the number of requested `top_logprobs` returned."}},"title":"ChatCompletionTokenLogprob"},"description":"A list of message content tokens with log probability information."},"refusal":{"type":["array","null"],"items":{"type":"object","required":["token","logprob","top_logprobs"],"properties":{"bytes":{"type":["array","null"],"items":{"type":"integer","format":"int32","minimum":0},"description":"A list of integers representing the UTF-8 bytes representation of the token. Useful in instances where characters are represented by multiple tokens and their byte representations must be combined to generate the correct text representation. Can be `null` if there is no bytes representation for the token."},"logprob":{"type":"number","format":"float","description":"The log probability of this token, if it is within the top 20 most likely tokens. Otherwise, the value `-9999.0` is used to signify that the token is very unlikely."},"token":{"type":"string","description":"The token."},"top_logprobs":{"type":"array","items":{"type":"object","required":["token","logprob"],"properties":{"bytes":{"type":["array","null"],"items":{"type":"integer","format":"int32","minimum":0},"description":"A list of integers representing the UTF-8 bytes representation of the token. Useful in instances where characters are represented by multiple tokens and their byte representations must be combined to generate the correct text representation. Can be `null` if there is no bytes representation for the token."},"logprob":{"type":"number","format":"float","description":"The log probability of this token."},"token":{"type":"string","description":"The token."}},"title":"TopLogprobs"},"description":"List of the most likely tokens and their log probability, at this token position. In rare cases, there may be fewer than the number of requested `top_logprobs` returned."}},"title":"ChatCompletionTokenLogprob"}}},"title":"ChatChoiceLogprobs"}]},"message":{"type":"object","description":"A chat completion message generated by the model.","required":["role"],"properties":{"annotations":{"type":["array","null"],"items":{"oneOf":[{"type":"object","required":["url_citation","type"],"properties":{"type":{"type":"string","enum":["url_citation"]},"url_citation":{"type":"object","required":["end_index","start_index","title","url"],"properties":{"end_index":{"type":"integer","format":"int32","description":"The index of the last character of the URL citation in the message.","minimum":0},"start_index":{"type":"integer","format":"int32","description":"The index of the first character of the URL citation in the message.","minimum":0},"title":{"type":"string","description":"The title of the web resource."},"url":{"type":"string","description":"The URL of the web resource."}},"title":"UrlCitation"}}}],"title":"ChatCompletionResponseMessageAnnotation"}},"audio":{"oneOf":[{"type":"null"},{"description":"If the audio output modality is requested, this object contains data about the audio response from the model. [Learn more](https://platform.openai.com/docs/guides/audio).","type":"object","required":["id","expires_at","data","transcript"],"properties":{"data":{"type":"string","description":"Base64 encoded audio bytes generated by the model, in the format specified in the request."},"expires_at":{"type":"integer","format":"int64","description":"The Unix timestamp (in seconds) for when this audio response will no longer be accessible on the server for use in multi-turn conversations.","minimum":0},"id":{"type":"string","description":"Unique identifier for this audio response."},"transcript":{"type":"string","description":"Transcript of the audio generated by the model."}},"title":"ChatCompletionResponseMessageAudio"}]},"content":{"type":["string","null"],"description":"The contents of the message."},"function_call":{"oneOf":[{"type":"null"},{"description":"Deprecated and replaced by `tool_calls`.\nThe name and arguments of a function that should be called, as generated by the model.","type":"object","required":["name","arguments"],"properties":{"arguments":{"type":"string","description":"The arguments to call the function with, as generated by the model in JSON format. Note that the model does not always generate valid JSON, and may hallucinate parameters not defined by your function schema. Validate the arguments in your code before calling your function."},"name":{"type":"string","description":"The name of the function to call."}},"title":"FunctionCall"}]},"refusal":{"type":["string","null"],"description":"The refusal message generated by the model."},"role":{"description":"The role of the author of this message.","type":"string","enum":["user","assistant","system","developer"],"title":"Role"},"tool_calls":{"type":["array","null"],"items":{"oneOf":[{"allOf":[{"type":"object","required":["id","function"],"properties":{"function":{"description":"The function that the model called.","type":"object","required":["name","arguments"],"properties":{"arguments":{"type":"string","description":"The arguments to call the function with, as generated by the model in JSON format. Note that the model does not always generate valid JSON, and may hallucinate parameters not defined by your function schema. Validate the arguments in your code before calling your function."},"name":{"type":"string","description":"The name of the function to call."}},"title":"FunctionCall"},"id":{"type":"string","description":"The ID of the tool call."}},"title":"ChatCompletionMessageToolCall"},{"type":"object","required":["type"],"properties":{"type":{"type":"string","enum":["function"]}}}]},{"allOf":[{"type":"object","required":["id","custom_tool"],"properties":{"custom_tool":{"description":"The custom tool that the model called.","type":"object","required":["name","input"],"properties":{"input":{"type":"string","description":"The input for the custom tool call generated by the model."},"name":{"type":"string","description":"The name of the custom tool to call."}},"title":"CustomTool"},"id":{"type":"string","description":"The ID of the tool call."}},"title":"ChatCompletionMessageCustomToolCall"},{"type":"object","required":["type"],"properties":{"type":{"type":"string","enum":["custom"]}}}]}],"title":"ChatCompletionMessageToolCalls"},"description":"The tool calls generated by the model, such as function calls."}},"title":"ChatCompletionResponseMessage"}},"title":"ChatChoice"},"description":"A list of chat completion choices. Can be more than one if `n` is greater than 1."},"created":{"type":"integer","format":"int32","description":"The Unix timestamp (in seconds) of when the chat completion was created.","minimum":0},"id":{"type":"string","description":"A unique identifier for the chat completion."},"model":{"type":"string","description":"The model used for the chat completion."},"object":{"type":"string","description":"The object type, which is always `chat.completion`."},"service_tier":{"oneOf":[{"type":"null"},{"description":"The service tier used for processing the request. This field is only included if the `service_tier` parameter is specified in the request.","type":"string","enum":["auto","default","flex","scale","priority"],"title":"ServiceTier"}]},"system_fingerprint":{"type":["string","null"],"description":"This fingerprint represents the backend configuration that the model runs with.\n\nCan be used in conjunction with the `seed` request parameter to understand when backend changes have been made that might impact determinism.","deprecated":true},"usage":{"oneOf":[{"type":"null"},{"type":"object","description":"Usage statistics for the completion request.","required":["prompt_tokens","completion_tokens","total_tokens"],"properties":{"completion_tokens":{"type":"integer","format":"int32","description":"Number of tokens in the generated completion.","minimum":0},"completion_tokens_details":{"oneOf":[{"type":"null"},{"description":"Breakdown of tokens used in a completion.","type":"object","properties":{"accepted_prediction_tokens":{"type":["integer","null"],"format":"int32","minimum":0},"audio_tokens":{"type":["integer","null"],"format":"int32","description":"Audio input tokens generated by the model.","minimum":0},"reasoning_tokens":{"type":["integer","null"],"format":"int32","description":"Tokens generated by the model for reasoning.","minimum":0},"rejected_prediction_tokens":{"type":["integer","null"],"format":"int32","description":" When using Predicted Outputs, the number of tokens in the\nprediction that did not appear in the completion. However, like\nreasoning tokens, these tokens are still counted in the total\ncompletion tokens for purposes of billing, output, and context\nwindow limits.","minimum":0}},"title":"CompletionTokensDetails"}]},"prompt_tokens":{"type":"integer","format":"int32","description":"Number of tokens in the prompt.","minimum":0},"prompt_tokens_details":{"oneOf":[{"type":"null"},{"description":"Breakdown of tokens used in the prompt.","type":"object","properties":{"audio_tokens":{"type":["integer","null"],"format":"int32","description":"Audio input tokens present in the prompt.","minimum":0},"cached_tokens":{"type":["integer","null"],"format":"int32","description":"Cached tokens present in the prompt.","minimum":0}},"title":"PromptTokensDetails"}]},"total_tokens":{"type":"integer","format":"int32","description":"Total number of tokens used in the request (prompt + completion).","minimum":0}},"title":"CompletionUsage"}]}},"title":"CreateChatCompletionResponse"},"example":{"id":"chatcmpl-123","object":"chat.completion","created":1677652288,"model":"gpt-4o-mini","system_fingerprint":"fp_44709d6fcb","choices":[{"index":0,"message":{"role":"assistant","content":"\n\nHello there, how may I assist you today?"},"logprobs":null,"finish_reason":"stop"}],"usage":{"prompt_tokens":9,"completion_tokens":12,"total_tokens":21,"completion_tokens_details":{"reasoning_tokens":0,"accepted_prediction_tokens":0,"rejected_prediction_tokens":0}}}}}},"404":{"description":"The specified model was not found"},"500":{"description":"An internal server error occurred while processing the chat completion","content":{"application/json":{"schema":{},"example":{"error":"An internal server error occurred while processing the chat completion."}}}}}}
1{"responses":{"200":{"description":"Chat completion generated successfully","content":{"application/json":{"schema":{"type":"object","description":"Represents a chat completion response returned by model, based on the provided input.","required":["id","choices","created","model","object"],"properties":{"choices":{"type":"array","items":{"type":"object","required":["index","message"],"properties":{"finish_reason":{"oneOf":[{"type":"null"},{"description":"The reason the model stopped generating tokens. This will be `stop` if the model hit a natural stop point or a provided stop sequence,\n`length` if the maximum number of tokens specified in the request was reached,\n`content_filter` if content was omitted due to a flag from our content filters,\n`tool_calls` if the model called a tool, or `function_call` (deprecated) if the model called a function.","type":"string","enum":["stop","length","tool_calls","content_filter","function_call"],"title":"FinishReason"}]},"index":{"type":"integer","format":"int32","description":"The index of the choice in the list of choices.","minimum":0},"logprobs":{"oneOf":[{"type":"null"},{"description":"Log probability information for the choice.","type":"object","properties":{"content":{"type":["array","null"],"items":{"type":"object","required":["token","logprob","top_logprobs"],"properties":{"bytes":{"type":["array","null"],"items":{"type":"integer","format":"int32","minimum":0},"description":"A list of integers representing the UTF-8 bytes representation of the token. Useful in instances where characters are represented by multiple tokens and their byte representations must be combined to generate the correct text representation. Can be `null` if there is no bytes representation for the token."},"logprob":{"type":"number","format":"float","description":"The log probability of this token, if it is within the top 20 most likely tokens. Otherwise, the value `-9999.0` is used to signify that the token is very unlikely."},"token":{"type":"string","description":"The token."},"top_logprobs":{"type":"array","items":{"type":"object","required":["token","logprob"],"properties":{"bytes":{"type":["array","null"],"items":{"type":"integer","format":"int32","minimum":0},"description":"A list of integers representing the UTF-8 bytes representation of the token. Useful in instances where characters are represented by multiple tokens and their byte representations must be combined to generate the correct text representation. Can be `null` if there is no bytes representation for the token."},"logprob":{"type":"number","format":"float","description":"The log probability of this token."},"token":{"type":"string","description":"The token."}},"title":"TopLogprobs"},"description":"List of the most likely tokens and their log probability, at this token position. In rare cases, there may be fewer than the number of requested `top_logprobs` returned."}},"title":"ChatCompletionTokenLogprob"},"description":"A list of message content tokens with log probability information."},"refusal":{"type":["array","null"],"items":{"type":"object","required":["token","logprob","top_logprobs"],"properties":{"bytes":{"type":["array","null"],"items":{"type":"integer","format":"int32","minimum":0},"description":"A list of integers representing the UTF-8 bytes representation of the token. Useful in instances where characters are represented by multiple tokens and their byte representations must be combined to generate the correct text representation. Can be `null` if there is no bytes representation for the token."},"logprob":{"type":"number","format":"float","description":"The log probability of this token, if it is within the top 20 most likely tokens. Otherwise, the value `-9999.0` is used to signify that the token is very unlikely."},"token":{"type":"string","description":"The token."},"top_logprobs":{"type":"array","items":{"type":"object","required":["token","logprob"],"properties":{"bytes":{"type":["array","null"],"items":{"type":"integer","format":"int32","minimum":0},"description":"A list of integers representing the UTF-8 bytes representation of the token. Useful in instances where characters are represented by multiple tokens and their byte representations must be combined to generate the correct text representation. Can be `null` if there is no bytes representation for the token."},"logprob":{"type":"number","format":"float","description":"The log probability of this token."},"token":{"type":"string","description":"The token."}},"title":"TopLogprobs"},"description":"List of the most likely tokens and their log probability, at this token position. In rare cases, there may be fewer than the number of requested `top_logprobs` returned."}},"title":"ChatCompletionTokenLogprob"}}},"title":"ChatChoiceLogprobs"}]},"message":{"type":"object","description":"A chat completion message generated by the model.","required":["role"],"properties":{"annotations":{"type":["array","null"],"items":{"oneOf":[{"type":"object","required":["url_citation","type"],"properties":{"type":{"type":"string","enum":["url_citation"]},"url_citation":{"type":"object","required":["end_index","start_index","title","url"],"properties":{"end_index":{"type":"integer","format":"int32","description":"The index of the last character of the URL citation in the message.","minimum":0},"start_index":{"type":"integer","format":"int32","description":"The index of the first character of the URL citation in the message.","minimum":0},"title":{"type":"string","description":"The title of the web resource."},"url":{"type":"string","description":"The URL of the web resource."}},"title":"UrlCitation"}}}],"title":"ChatCompletionResponseMessageAnnotation"}},"audio":{"oneOf":[{"type":"null"},{"description":"If the audio output modality is requested, this object contains data about the audio response from the model. [Learn more](https://platform.openai.com/docs/guides/audio).","type":"object","required":["id","expires_at","data","transcript"],"properties":{"data":{"type":"string","description":"Base64 encoded audio bytes generated by the model, in the format specified in the request."},"expires_at":{"type":"integer","format":"int64","description":"The Unix timestamp (in seconds) for when this audio response will no longer be accessible on the server for use in multi-turn conversations.","minimum":0},"id":{"type":"string","description":"Unique identifier for this audio response."},"transcript":{"type":"string","description":"Transcript of the audio generated by the model."}},"title":"ChatCompletionResponseMessageAudio"}]},"content":{"type":["string","null"],"description":"The contents of the message."},"function_call":{"oneOf":[{"type":"null"},{"description":"Deprecated and replaced by `tool_calls`.\nThe name and arguments of a function that should be called, as generated by the model.","type":"object","required":["name","arguments"],"properties":{"arguments":{"type":"string","description":"The arguments to call the function with, as generated by the model in JSON format. Note that the model does not always generate valid JSON, and may hallucinate parameters not defined by your function schema. Validate the arguments in your code before calling your function."},"name":{"type":"string","description":"The name of the function to call."}},"title":"FunctionCall"}]},"refusal":{"type":["string","null"],"description":"The refusal message generated by the model."},"role":{"description":"The role of the author of this message.","type":"string","enum":["user","assistant","system","developer"],"title":"Role"},"tool_calls":{"type":["array","null"],"items":{"oneOf":[{"allOf":[{"type":"object","required":["id","function"],"properties":{"function":{"description":"The function that the model called.","type":"object","required":["name","arguments"],"properties":{"arguments":{"type":"string","description":"The arguments to call the function with, as generated by the model in JSON format. Note that the model does not always generate valid JSON, and may hallucinate parameters not defined by your function schema. Validate the arguments in your code before calling your function."},"name":{"type":"string","description":"The name of the function to call."}},"title":"FunctionCall"},"id":{"type":"string","description":"The ID of the tool call."}},"title":"ChatCompletionMessageToolCall"},{"type":"object","required":["type"],"properties":{"type":{"type":"string","enum":["function"]}}}]},{"allOf":[{"type":"object","required":["id","custom_tool"],"properties":{"custom_tool":{"description":"The custom tool that the model called.","type":"object","required":["name","input"],"properties":{"input":{"type":"string","description":"The input for the custom tool call generated by the model."},"name":{"type":"string","description":"The name of the custom tool to call."}},"title":"CustomTool"},"id":{"type":"string","description":"The ID of the tool call."}},"title":"ChatCompletionMessageCustomToolCall"},{"type":"object","required":["type"],"properties":{"type":{"type":"string","enum":["custom"]}}}]}],"title":"ChatCompletionMessageToolCalls"},"description":"The tool calls generated by the model, such as function calls."}},"title":"ChatCompletionResponseMessage"}},"title":"ChatChoice"},"description":"A list of chat completion choices. Can be more than one if `n` is greater than 1."},"created":{"type":"integer","format":"int32","description":"The Unix timestamp (in seconds) of when the chat completion was created.","minimum":0},"id":{"type":"string","description":"A unique identifier for the chat completion."},"model":{"type":"string","description":"The model used for the chat completion."},"object":{"type":"string","description":"The object type, which is always `chat.completion`."},"service_tier":{"oneOf":[{"type":"null"},{"description":"The service tier used for processing the request. This field is only included if the `service_tier` parameter is specified in the request.","type":"string","enum":["auto","default","flex","scale","priority"],"title":"ServiceTier"}]},"system_fingerprint":{"type":["string","null"],"description":"This fingerprint represents the backend configuration that the model runs with.\n\nCan be used in conjunction with the `seed` request parameter to understand when backend changes have been made that might impact determinism.","deprecated":true},"usage":{"oneOf":[{"type":"null"},{"type":"object","description":"Usage statistics for the completion request.","required":["prompt_tokens","completion_tokens","total_tokens"],"properties":{"completion_tokens":{"type":"integer","format":"int32","description":"Number of tokens in the generated completion.","minimum":0},"completion_tokens_details":{"oneOf":[{"type":"null"},{"description":"Breakdown of tokens used in a completion.","type":"object","properties":{"accepted_prediction_tokens":{"type":["integer","null"],"format":"int32","minimum":0},"audio_tokens":{"type":["integer","null"],"format":"int32","description":"Audio input tokens generated by the model.","minimum":0},"reasoning_tokens":{"type":["integer","null"],"format":"int32","description":"Tokens generated by the model for reasoning.","minimum":0},"rejected_prediction_tokens":{"type":["integer","null"],"format":"int32","description":" When using Predicted Outputs, the number of tokens in the\nprediction that did not appear in the completion. However, like\nreasoning tokens, these tokens are still counted in the total\ncompletion tokens for purposes of billing, output, and context\nwindow limits.","minimum":0}},"title":"CompletionTokensDetails"}]},"prompt_tokens":{"type":"integer","format":"int32","description":"Number of tokens in the prompt.","minimum":0},"prompt_tokens_details":{"oneOf":[{"type":"null"},{"description":"Breakdown of tokens used in the prompt.","type":"object","properties":{"audio_tokens":{"type":["integer","null"],"format":"int32","description":"Audio input tokens present in the prompt.","minimum":0},"cached_tokens":{"type":["integer","null"],"format":"int32","description":"Cached tokens present in the prompt.","minimum":0}},"title":"PromptTokensDetails"}]},"total_tokens":{"type":"integer","format":"int32","description":"Total number of tokens used in the request (prompt + completion).","minimum":0}},"title":"CompletionUsage"}]}},"title":"CreateChatCompletionResponse"},"example":{"id":"chatcmpl-123","object":"chat.completion","created":1677652288,"model":"gpt-4o-mini","system_fingerprint":"fp_44709d6fcb","choices":[{"index":0,"message":{"role":"assistant","content":"\n\nHello there, how may I assist you today?"},"logprobs":null,"finish_reason":"stop"}],"usage":{"prompt_tokens":9,"completion_tokens":12,"total_tokens":21,"completion_tokens_details":{"reasoning_tokens":0,"accepted_prediction_tokens":0,"rejected_prediction_tokens":0}}}}}},"404":{"description":"The specified model was not found"},"500":{"description":"An internal server error occurred while processing the chat completion","content":{"application/json":{"schema":{},"example":{"error":"An internal server error occurred while processing the chat completion."}}}}}}
