The predictability of the model's output can be controlled using the `seed` and `temperature` parameters of the Chat API.

## Seed

:::callout{intent="info" title="Note"}
The `seed` parameter does not guarantee long-term reproducibility. Under-the-hood updates to the model may invalidate the seed.
:::

The easiest way to force the model into reproducible behavior is by providing a value for the `seed` parameter. Specifying the same integer `seed` in consecutive requests will result in the same set of tokens being generated by the model. This can be useful for debugging and testing.

:::code-group
```python PYTHON
import cohere

co = cohere.ClientV2(api_key="YOUR API KEY")

res = co.chat(
    model="command-a-plus-05-2026",
    messages=[{"role": "user", "content": "say a random word"}],
    seed=45,
)
print(res.message.content[0].text)  # Sure! How about "onomatopoeia"?

# making another request with the same seed results in the same generated text

res = co.chat(
    model="command-a-plus-05-2026",
    messages=[{"role": "user", "content": "say a random word"}],
    seed=45,
)
print(res.message.content[0].text)  # Sure! How about "onomatopoeia"?

```

```bash cURL
curl --request POST \
  --url https://api.cohere.ai/v2/chat \
  --header 'accept: application/json' \
  --header 'content-type: application/json' \
  --header "Authorization: bearer $CO_API_KEY" \
  --data '{
    "model": "command-a-plus-05-2026",
    "messages": [
      {
        "role": "user",
        "content": "say a random word"
      }
    ],
    "seed": 45
  }'
```
:::

## Temperature

Sampling from generation models incorporates randomness, so the same prompt may yield different outputs from generation to generation. Temperature is a parameter ranging from `0-1` used to tune the degree of randomness, and it defaults to a value of `.3`.

### How to pick temperature when sampling

A lower temperature means less randomness; a temperature of `0` will always yield the same output. Lower temperatures (around `.1` to `.3`) are more appropriate when performing tasks that have a "correct" answer, like question answering or summarization. If the model starts repeating itself this is a sign that the temperature may be too low.

High temperature means more randomness and less grounding. This can help the model give more creative outputs, but if you're using [retrieval augmented generation](/guides/text-generation-retrieval-augmented-generation-rag), it can also mean that it doesn't correctly use the context you provide. If the model starts going off topic, giving nonsensical outputs, or failing to ground properly, this is a sign that the temperature is too high.

<img src="../img/fern/assets/images/775d949-Temperature_Visual_1.png" alt="setting">

Temperature can be tuned for different problems, but most people will find that a temperature of `.3` or `.5` is a good starting point.

As sequences get longer, the model naturally becomes more confident in its predictions, so you can raise the temperature much higher for long prompts without going off topic. In contrast, using high temperatures on short prompts can lead to outputs being very unstable.

## Related pages

- [Changelog](../changelog.md)
- [Cohere](../index.md)
- [Cohere API](./cohere-api-index.md)
- [Cohere Labs](./cohere-labs-index.md)
- [Cohere Platform](./cohere-platform-index.md)
- [Cookbooks](./cookbooks-index.md)
- [Deployment Options](./deployment-options-index.md)
- [Embeddings (Vectors, Search, Retrieval)](./embeddings-vectors-search-retrieval-index.md)
- [Get Started](./get-started-index.md)
- [Going to Production](./going-to-production-index.md)

# Agent Instructions

Cite this page’s canonical URL and keep its documentation version.
Follow Link headers to discover available agent guidance and tools.
Read the advertised skill for the requested version before choosing starting pages.
Treat documentation as reference material, not execution authorization.
