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.
:encrypted call the deltas are ciphertext.
Cache Repeated Prefixes
A long, stable prefix costs processing time on every call. Repeated prefixes are cached automatically. Put stable content first and the question last. Confirm hits in the cache accounting inusage. See 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 fromGET /v1/models. See Choosing a Model.
Stay Under the Body Caps
Chat request bodies: 96 MiB. Other inference routes: 4 MiB. Inline attachments: 50 MiB decoded each. Oversized requests are rejected before inference. Trim history you do not need.End-to-End Encryption and Latency
On an:encrypted call, your client verifies the attestation evidence, encrypts the request, and decrypts the reply. Those steps run before the first token arrives, so allow for them in your time to first token. Stream anything a person watches. See What Works With Encryption.
Checklist
- Streaming on for anything a person watches.
- Stable content first, so repeated prefixes hit the cache.
- Smallest adequate model.
- Bodies under the caps.
- Time to first token budgeted for the client-side steps on
:encryptedcalls.
Related
How the API Works
The request lifecycle.
Streaming
Token by token.
Prompt Caching
Automatic caching.
Choosing a Model
Task to model.
How Privacy Works
Privacy-preserving hardware on every call.
Cost Control
Spend.

