GET
/v1/schemas/openai/chat/completions
Accept:
| field | recorded source |
|---|---|
| schema | Source linked above. upstream-spec Source trace75476afd3f30a35ee8c98993f3570afc9d55be9fa8a3c2ba7b68b8b747fa7949{
"fetchedAt": 1791349881,
"extractorVersion": "1",
"verifiedAt": null
} |
Request body
18 properties · 2 required · 2 $defs| property | type | description | constraints |
|---|---|---|---|
| model* | string | enum | ID of the model to use. You can use the [List models](https://developers.openai.com/api/reference/resources/models/methods/list) API to see all of your available models, or see our [Model overview](https://developers.openai.com/api/docs/models) for description… | |
| prompt* | string | string[] | integer[] | … | The prompt(s) to generate completions for, encoded as a string, array of strings, array of tokens, or array of token arrays. | nullable |
| best_of | any | Generates `best_of` completions server-side and returns the "best" (the one with the highest log probability per token). Results cannot be streamed. | 0 ≤ n ≤ 20 · default: 1 |
| echo | any | Echo back the prompt in addition to the completion | default: false |
| frequency_penalty | any | 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. | -2 ≤ n ≤ 2 · default: 0 |
| logit_bias | any | Modify the likelihood of specified tokens appearing in the completion. | default: null |
| logprobs | any | 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 the… | 0 ≤ n ≤ 5 · default: null |
| max_tokens | any | The maximum number of [tokens](https://platform.openai.com/tokenizer) that can be generated in the completion. | n ≥ 0 · default: 16 |
| n | any | How many completions to generate for each prompt. | 1 ≤ n ≤ 128 · default: 1 |
| presence_penalty | any | 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. | -2 ≤ n ≤ 2 · default: 0 |
| seed | any | 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. | format: int64 |
| stop | string | string[] | Not supported with latest reasoning models `o3` and `o4-mini`. | nullable · default: null |
| stream | any | 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 t… | default: false |
| stream_options | object | Options for streaming response. Only set this when you set `stream: true`. | nullable |
| suffix | any | The suffix that comes after a completion of inserted text. | default: null |
| temperature | any | 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. | 0 ≤ n ≤ 2 · default: 1 |
| top_p | any | 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. | 0 ≤ n ≤ 1 · default: 1 |
| user | string | A unique identifier representing your end-user, which can help OpenAI to monitor and detect abuse. [Learn more](https://developers.openai.com/api/docs/guides/safety-best-practices#implement-safety-identifiers). |
Types
2 $defsChatCompletionStreamOptionsobject
Options for streaming response. Only set this when you set `stream: true`.
| include_usage | boolean | If set, an additional chunk will be streamed before the `data: [DONE]` message. The `usage` field on this chunk shows the token usage statistics for the entire request, and the `choices` field will always be an empty array. | |
| include_obfuscation | boolean | 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 de… |
StopConfigurationstring | string[]
Not supported with latest reasoning models `o3` and `o4-mini`.
nullable · default: null
Validate a payload
before you spend tokensshell
$ curl -X POST https://modelschemas.com/v1/validate \
-d '{"provider":"openai","endpointId":"completions","payload":{…}}'
→ {"valid": false, "errors": [{"path": "#", "keyword": "required", …}]}