> ## Documentation Index
> Fetch the complete documentation index at: https://docs.trynito.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Finish reasons

> The four finish_reason values and how they appear in streams.

Every choice carries a `finish_reason`. There are exactly four values.

## The Values

| Value | Signals |
| - | - |
| `stop` | The model finished normally. |
| `length` | Generation hit `max_tokens` / `max_completion_tokens` or the context limit. The reply is truncated. |
| `tool_calls` | Run `message.tool_calls`, append the results as `tool` messages, and call again. See [Tool calling](/api/features/tool-calling). |
| `error` | Generation failed. In a stream it arrives with a top-level `error` object. See [Error events](/api/api-reference/streaming-format/error-events). |

## Where It Appears

Non-streaming:

```json theme={"theme":{"light":"github-light","dark":"github-dark"}}
{
  "choices": [
    { "index": 0, "message": { "role": "assistant", "content": "..." }, "finish_reason": "stop" }
  ]
}
```

Streaming: `finish_reason` is `null` on every chunk until the terminal one. See [Delta format](/api/api-reference/streaming-format/delta-format).

```json theme={"theme":{"light":"github-light","dark":"github-dark"}}
{ "choices": [ { "index": 0, "delta": {}, "finish_reason": "stop" } ] }
```

The same four values appear per participant in a [Fusion result](/api/api-reference/chat-and-text/chat-fusion) under `models[].finish_reason`.

## Related

* [Chat Completions API](/api/api-reference/chat-and-text/chat-completions)
* [Tool calling](/api/features/tool-calling)
* [Error events](/api/api-reference/streaming-format/error-events)
* [Delta format](/api/api-reference/streaming-format/delta-format)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.