GET
/v1/schemas/cohere/chat/v2%2Fchat
Accept:
Request body
21 properties · 2 required · 28 $defs| property | type | description | constraints |
|---|---|---|---|
| model* | string | The name of a compatible [Cohere model](https://docs.cohere.com/v2/docs/models). | |
| messages* | ChatMessageV2[] | A list of chat messages in chronological order, representing a conversation between the user and the model. | |
| stream | boolean | Defaults to `false`. | |
| tools | ToolV2[] | A list of tools (functions) available to the model. The model response may contain 'tool_calls' to the specified tools. | |
| strict_tools | boolean | When set to `true`, tool calls in the Assistant message will be forced to follow the tool definition strictly. Learn more in the [Structured Outputs (Tools) guide](https://docs.cohere.com/docs/structured-outputs-json#structured-outputs-tools). | |
| documents | string | Document[] | A list of relevant documents that the model can cite to generate a more accurate reply. Each document is either a string or document object with content and metadata. | |
| citation_options | CitationOptions | Options for controlling citation generation. | |
| response_format | object | object | Configuration for forcing the model output to adhere to the specified format. Supported on [Command R](https://docs.cohere.com/v2/docs/command-r), [Command R+](https://docs.cohere.com/v2/docs/command-r-plus) and newer models. | |
| safety_mode | enum | Used to select the [safety instruction](https://docs.cohere.com/v2/docs/safety-modes) inserted into the prompt. Defaults to `CONTEXTUAL`. When `OFF` is specified, the safety instruction will be omitted. | CONTEXTUAL | STRICT | OFF |
| max_tokens | integer | The maximum number of output tokens the model will generate in the response. If not set, `max_tokens` defaults to the model's maximum output token limit. You can find the maximum output token limits for each model in the [model documentation](https://docs.cohe… | |
| stop_sequences | string[] | A list of up to 5 strings that the model will use to stop generation. If the model generates a string that matches any of the strings in the list, it will stop generating tokens and return the generated text up to that point not including the stop sequence. | |
| temperature | number | Defaults to `0.3`. | 0 ≤ n ≤ 1 · format: float |
| seed | integer | If specified, the backend will make a best effort to sample tokens deterministically, such that repeated requests with the same seed and parameters should return the same result. However, determinism cannot be totally guaranteed. | 0 ≤ n ≤ 18446744073709552000 |
| frequency_penalty | number | Defaults to `0.0`, min value of `0.0`, max value of `1.0`. Used to reduce repetitiveness of generated tokens. The higher the value, the stronger a penalty is applied to previously present tokens, proportional to how many times they have already appeared in the… | format: float |
| presence_penalty | number | Defaults to `0.0`, min value of `0.0`, max value of `1.0`. Used to reduce repetitiveness of generated tokens. Similar to `frequency_penalty`, except that this penalty is applied equally to all tokens that have already appeared, regardless of their exact freque… | format: float |
| k | integer | Ensures that only the top `k` most likely tokens are considered for generation at each step. When `k` is set to `0`, k-sampling is disabled. Defaults to `0`, min value of `0`, max value of `500`. | 0 ≤ n ≤ 500 · default: 0 |
| p | number | Ensures that only the most likely tokens, with total probability mass of `p`, are considered for generation at each step. If both `k` and `p` are enabled, `p` acts after `k`. Defaults to `0.75`. min value of `0.01`, max value of `0.99`. | 0.01 ≤ n ≤ 0.99 · format: float · default: 0.75 |
| logprobs | boolean | Defaults to `false`. When set to `true`, the log probabilities of the generated tokens will be included in the response. | |
| tool_choice | enum | Used to control whether or not the model will be forced to use a tool when answering. When `REQUIRED` is specified, the model will be forced to use at least one of the user-defined tools, and the `tools` parameter must be passed in the request. When `NONE` is … | REQUIRED | NONE |
| thinking | Thinking | Configuration for [reasoning features](https://docs.cohere.com/docs/reasoning). | |
| priority | integer | Controls how early the request is handled. Lower numbers indicate higher priority (default: 0, the highest). When the system is under load, higher-priority requests are processed first and are the least likely to be dropped. | 0 ≤ n ≤ 999 · default: 0 |
Validate a payload
before you spend tokensshell
$ curl -X POST https://modelschemas.com/v1/validate \
-d '{"provider":"cohere","endpointId":"v2/chat","payload":{…}}'
→ {"valid": false, "errors": [{"path": "#", "keyword": "required", …}]}