> ## 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.

# Latency and Performance

> Perceived speed, real work, and the privacy trade-off.

## Stream

`stream: true` returns tokens as they are produced. Total generation time is unchanged; time to first visible token drops, which is what people feel.

```shellscript wrap theme={"theme":{"light":"github-light","dark":"github-dark"}}
curl https://app.trynito.ai/v1/chat/completions \
  -H "Authorization: Bearer $NITO_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"model":"moonshotai/kimi-k3","stream":true,"messages":[{"role":"user","content":"..."}]}'
```

Available at every level; at [Encrypted](/api/api-reference/chat-and-text/encrypted) the deltas are ciphertext.

## Cache Repeated Prefixes

A long, stable prefix costs processing time on every call. Mark it with `cache_control` and a supporting provider serves it from cache. Stable content first, the question last. Confirm hits in the cache accounting in `usage`. See [Prompt Caching](/api/features/prompt-caching).

## Right-Size the Model

A smaller model that is good enough responds faster. Compact models for classification, extraction, and short replies; heavyweight models for hard reasoning. Select from `GET /v1/models`. See [Choosing a Model](/models/choosing-a-model).

## Stay Under the Body Caps

Chat request bodies: 64 MiB. Other inference routes: 4 MiB. Inline attachments: 1 MiB decoded. Oversized requests are rejected before inference. Trim history you do not need and supply large documents by URL.

## The Privacy Trade-Off

Confidential variants run only where the model has an attested build, which can mean higher latency or lower availability. Reserve stronger levels for work that needs them.

## Checklist

* Streaming on for anything a person watches.
* Caching on for repeated prefixes.
* Smallest adequate model.
* Bodies under the caps; large documents by URL.
* Stronger privacy levels where they earn their keep.

## Related

<CardGroup cols={3}>
  <Card title="How the API Works" icon="gears" href="/api/get-started/how-nito-works">
    The request lifecycle.
  </Card>

  <Card title="Streaming" icon="signal-stream" href="/api/features/streaming">
    Token by token.
  </Card>

  <Card title="Prompt Caching" icon="file-contract" href="/api/features/prompt-caching">
    Cache markers.
  </Card>

  <Card title="Choosing a Model" icon="cubes-stacked" href="/models/choosing-a-model">
    Task to model.
  </Card>

  <Card title="Privacy Levels" icon="file-shield" href="/privacy/levels">
    The four levels.
  </Card>

  <Card title="Cost Control" icon="money-bill-wave" href="/api/features/best-practices/cost-control">
    Spend.
  </Card>
</CardGroup>


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