GET
/v1/schemas/meta/chat/v1%2Fchat%2Fcompletions
Accept:
Request body
26 properties · 2 required · 33 $defs| property | type | description | constraints |
|---|---|---|---|
| messages* | chat-completion-request-message[] | An ordered list of the messages in the conversation. Each message has a role and content, and the model reads them in sequence to produce its reply. (minItems: 1) | items ≥ 1 |
| model* | string | ID of the model used to generate the response. | |
| metadata | object | nullable | |
| top_logprobs | integer | An integer between 0 and 20 giving the number of top alternative tokens to return at each position, each with its log probability. Requires logprobs: true. (minimum: 0, maximum: 20) | 0 ≤ n ≤ 20 |
| 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. We generally recommend altering this or top_p but not both. (minimum: 0, maximum: 2, default: 1) | nullable |
| top_p | number | Nucleus sampling: only tokens whose cumulative probability is at most this value are considered. Must be greater than 0; values <= 0 return HTTP 400. Set this or temperature, not both. (minimum: 0, maximum: 1, default: 1) | nullable |
| user | string | Deprecated. Being replaced by safety_identifier and prompt_cache_key; use prompt_cache_key to retain caching benefits. A stable end-user identifier used to improve cache hit rates and help detect abuse. | |
| safety_identifier | string | A stable identifier that helps detect users who may be violating usage policies. Use a string that uniquely identifies each user, up to 64 characters; hash a username or email so you do not send identifying information. (maxLength: 64) | length ≤ 64 |
| prompt_cache_key | string | Groups similar requests to improve cache hit rates. Replaces the user field. | |
| service_tier | enum | auto | default | flex | scale | priority · nullable | |
| prompt_cache_retention | enum | The retention policy for the prompt cache. | in_memory | 24h · nullable |
| modalities | enum[] | nullable | |
| reasoning_effort | enum | none | minimal | low | medium | high | xhigh · +1 more · nullable | |
| max_completion_tokens | integer | Upper bound on the tokens the model may generate for a completion, counting both visible output and reasoning tokens. | |
| response_format | object | object | object | Constrains the format of the model's output. Use { "type": "json_schema", ... } for Structured Outputs, which forces the response to match your JSON schema, or { "type": "json_object" } for the older JSON mode, which only guarantees valid JSON. Prefer json_sch… | |
| store | boolean | Whether or not to store the output of this chat completion request for use in our model distillation or evals products. Supports text and image inputs. Note: image inputs over 8MB will be dropped. (default: false) | default: false |
| stream | boolean | When true, the response is streamed incrementally as server-sent events(opens in new tab) rather than returned in a single payload. (default: false) | default: false |
| stop | string | string[] | ||
| logprobs | boolean | When true, returns the log probability of each token in the message content. (default: false) | default: false |
| max_tokens | integer | Deprecated. The maximum number of tokens that can be generated in the chat completion. Deprecated in favor of max_completion_tokens. | |
| n | integer | Number of completions to generate for the input. Only n=1 is supported. (minimum: 1, maximum: 128, default: 1) | 1 ≤ n ≤ 128 · default: 1 |
| seed | integer | Deprecated. If set, the system makes a best-effort attempt to sample deterministically, so repeated requests with the same seed and parameters return similar results. Determinism is not guaranteed. (minimum: -9223372036854776000, maximum: 9223372036854776000) | -9223372036854776000 ≤ n ≤ 9223372036854776000 |
| stream_options | object | nullable | |
| tools | chat-completion-tool[] | A list of tools the model may call. You can provide either custom tools or function tools. | |
| tool_choice | enum | auto | |
| parallel_tool_calls | boolean |
Validate a payload
before you spend tokensshell
$ curl -X POST https://modelschemas.com/v1/validate \
-d '{"provider":"meta","endpointId":"v1/chat/completions","payload":{…}}'
→ {"valid": false, "errors": [{"path": "#", "keyword": "required", …}]}