GET
/v1/schemas/cohere/chat/v1%2Fchat
Accept:
Request body
26 properties · 1 required · 13 $defs| property | type | description | constraints |
|---|---|---|---|
| message* | string | Text input for the model to respond to. | |
| model | string | The name of a compatible [Cohere model](https://docs.cohere.com/docs/models) or the ID of a [fine-tuned](https://docs.cohere.com/docs/chat-fine-tuning) model. | |
| stream | boolean | Defaults to `false`. | |
| preamble | string | When specified, the default Cohere preamble will be replaced with the provided one. Preambles are a part of the prompt used to adjust the model's overall behavior and conversation style, and use the `SYSTEM` role. | |
| chat_history | Message[] | A list of previous messages between the user and the model, giving the model conversational context for responding to the user's `message`. | items ≥ 0 |
| conversation_id | string | An alternative to `chat_history`. | |
| prompt_truncation | enum | Defaults to `AUTO` when `connectors` are specified and `OFF` in all other cases. | OFF | AUTO | AUTO_PRESERVE_ORDER |
| connectors | ChatConnector[] | Accepts `{"id": "web-search"}`, and/or the `"id"` for a custom [connector](https://docs.cohere.com/docs/connectors), if you've [created](https://docs.cohere.com/v1/docs/creating-and-deploying-a-connector) one. | items ≥ 0 · deprecated |
| search_queries_only | boolean | Defaults to `false`. | deprecated |
| documents | ChatDocument[] | A list of relevant documents that the model can cite to generate a more accurate reply. Each document is a string-string dictionary. | |
| citation_quality | enum | Defaults to `"enabled"`. Citations are enabled by default for models that support it, but can be turned off by setting `"type": "disabled"`. | ENABLED | DISABLED | FAST | ACCURATE | OFF |
| temperature | number | Defaults to `0.3`. | 0 ≤ n ≤ 1 · format: float |
| max_tokens | integer | The maximum number of tokens the model will generate as part of the response. Note: Setting a low value may result in incomplete generations. | |
| max_input_tokens | integer | The maximum number of input tokens to send to the model. If not specified, `max_input_tokens` is the model's context length limit minus a small buffer. | |
| k | integer | Ensures only the top `k` most likely tokens are considered for generation at each step. 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 · default: 0.75 |
| 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 |
| 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. | |
| frequency_penalty | number | Defaults to `0.0`, min value of `0.0`, max value of `1.0`. | |
| presence_penalty | number | Defaults to `0.0`, min value of `0.0`, max value of `1.0`. | |
| raw_prompting | boolean | When enabled, the user's prompt will be sent to the model without any pre-processing. | |
| tools | Tool[] | A list of available tools (functions) that the model may suggest invoking before producing a text response. | items ≥ 0 |
| tool_results | ToolResult[] | A list of results from invoking tools recommended by the model in the previous chat turn. Results are used to produce a text response and will be referenced in citations. When using `tool_results`, `tools` must be passed as well. Each tool_result contains info… | items ≥ 0 |
| force_single_step | boolean | Forces the chat to be single step. Defaults to `false`. | |
| response_format | Text Response | JSON Object Response | Configuration for forcing the model output to adhere to the specified format. Supported on [Command R 03-2024](https://docs.cohere.com/docs/command-r), [Command R+ 04-2024](https://docs.cohere.com/docs/command-r-plus) and newer models. | |
| safety_mode | enum | Used to select the [safety instruction](https://docs.cohere.com/docs/safety-modes) inserted into the prompt. Defaults to `CONTEXTUAL`. When `NONE` is specified, the safety instruction will be omitted. | CONTEXTUAL | STRICT | NONE |
Validate a payload
before you spend tokensshell
$ curl -X POST https://modelschemas.com/v1/validate \
-d '{"provider":"cohere","endpointId":"v1/chat","payload":{…}}'
→ {"valid": false, "errors": [{"path": "#", "keyword": "required", …}]}