Cerebras
Route your Cerebras API calls through AI SpendOps for automatic usage tracking and cost attribution.
Configuration
| Setting | Value |
|---|---|
| Route | /v1/cerebras/* |
| Upstream | https://api.cerebras.ai |
| Auth header | Authorization: Bearer ... |
| Streaming usage | Auto-injected (stream_options.include_usage) |
SDK base URL
https://proxy.aispendops.com/v1/cerebras/v1
Example
curl https://proxy.aispendops.com/v1/cerebras/v1/chat/completions \
-H "Authorization: Bearer your-cerebras-key" \
-H "X-ASO-API-Key: aso_k_yourkey.secret" \
-H "Content-Type: application/json" \
-d '{"model":"llama-3.3-70b","messages":[{"role":"user","content":"Hello"}]}'
Usage fields
| Field | Description |
|---|---|
prompt_tokens | Input tokens |
completion_tokens | Output tokens |
Measuring the speed advantage
Cerebras runs on wafer-scale hardware and is usually chosen for throughput rather than price, so the interesting question is normally not "what did this cost" but "was it actually faster, and was that worth the rate". Every AI SpendOps usage event carries three timestamps that let you answer that from your own traffic instead of from a vendor benchmark:
| Field | Meaning |
|---|---|
started_at_ms | Proxy received your request |
first_byte_at_ms | First byte of the upstream response |
ended_at_ms | Response finished |
first_byte_at_ms - started_at_ms is time to first token, and
completion_tokens / (ended_at_ms - first_byte_at_ms) gives output tokens per
second. Because those fields are recorded identically for all providers, you can
run the same model family through Cerebras and through another host, tag each
with a dimension, and compare cost against real
measured throughput on your own prompts.
Note that these timings are measured at the proxy edge, not in your application, so they exclude your own network hop to AI SpendOps.
What AI SpendOps records
| Field | Populated |
|---|---|
cache_read_tokens | No. Cerebras does not expose prompt caching |
cache_write_tokens | No |
reasoning_tokens | Only where the model returns completion_tokens_details |
provider_cost | No. Cost is calculated from token counts and the current Cerebras rate card |
Notes
- Cerebras hosts a deliberately small catalogue of open-weight models. If a model is missing from AI SpendOps pricing it is flagged automatically and priced once the rate card is updated, so usage is never silently dropped.
- The proxy injects
stream_options: { include_usage: true }on streaming requests. See Streaming. - Full field definitions are in the usage event field reference.