GET
/v1/schemas/cohere/chat/v1/generate
Accept:
| field | recorded source |
|---|---|
| schema | Source linked above. upstream-spec Source tracee567cbddb2cc3cbd6a156ba9d74213895fc4e6df55d489d401327ed177ab803b{
"fetchedAt": 1786771957,
"extractorVersion": "1",
"verifiedAt": null
} |
Request body
17 properties · 1 required · 0 $defs| property | type | description | constraints |
|---|---|---|---|
| prompt* | string | The input text that serves as the starting point for generating the response. Note: The prompt will be pre-processed and modified before reaching the model. | |
| model | string | The identifier of the model to generate with. Currently available models are `command` (default), `command-nightly` (experimental), `command-light`, and `command-light-nightly` (experimental). Smaller, "light" models are faster, while larger models will perfor… | |
| num_generations | integer | The maximum number of generations that will be returned. Defaults to `1`, min value of `1`, max value of `5`. | |
| stream | boolean | When `true`, the response will be a JSON stream of events. Streaming is beneficial for user interfaces that render the contents of the response piece by piece, as it gets generated. | |
| 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. | |
| truncate | enum | One of `NONE|START|END` to specify how the API will handle inputs longer than the maximum token length. | NONE | START | END · default: "END" |
| temperature | number | A non-negative float that tunes the degree of randomness in generation. Lower temperatures mean less random generations. See [Temperature](/temperature-wiki) for more details. Defaults to `0.75`, min value of `0.0`, max value of `5.0`. | |
| 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. Compatible Deployments: Cohere… | 0 ≤ n ≤ 18446744073709552000 |
| preset | string | Identifier of a custom preset. A preset is a combination of parameters, such as prompt, temperature etc. You can create presets in the [playground](https://dashboard.cohere.com/playground/generate). When a preset is specified, the `prompt` parameter becomes op… | |
| end_sequences | string[] | The generated text will be cut at the beginning of the earliest occurrence of an end sequence. The sequence will be excluded from the text. | |
| stop_sequences | string[] | The generated text will be cut at the end of the earliest occurrence of a stop sequence. The sequence will be included the text. | |
| 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`. | |
| 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`. | |
| frequency_penalty | number | 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 prompt or prior generation. | |
| presence_penalty | number | Defaults to `0.0`, min value of `0.0`, max value of `1.0`. | |
| return_likelihoods | enum | One of `GENERATION|NONE` to specify how and if the token likelihoods are returned with the response. Defaults to `NONE`. | GENERATION | ALL | NONE · default: "NONE" |
| raw_prompting | boolean | When enabled, the user's prompt will be sent to the model without any pre-processing. |
Validate a payload
before you spend tokensshell
$ curl -X POST https://modelschemas.com/v1/validate \
-d '{"provider":"cohere","endpointId":"v1/generate","payload":{…}}'
→ {"valid": false, "errors": [{"path": "#", "keyword": "required", …}]}