GET
/v1/schemas/openai/chat/completions
Accept:
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](/docs/api-reference/models/list) API to see all of your available models, or see our [Model overview](/docs/models) for descriptions of them. | |
| 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. | default: "<|endoftext|>" |
| best_of | integer | 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 | boolean | Echo back the prompt in addition to the completion | default: false |
| frequency_penalty | number | 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 | object | Modify the likelihood of specified tokens appearing in the completion. | default: null |
| logprobs | integer | 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 | integer | The maximum number of [tokens](/tokenizer) that can be generated in the completion. | n ≥ 0 · default: 16 |
| n | integer | How many completions to generate for each prompt. | 1 ≤ n ≤ 128 · default: 1 |
| presence_penalty | number | 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 | integer | 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`. | default: null |
| stream | boolean | 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`. | default: null · nullable |
| suffix | string | The suffix that comes after a completion of inserted text. | default: null |
| temperature | number | 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 | number | 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](/docs/guides/safety-best-practices#end-user-ids). |
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", …}]}