Skip to main content

Cerebras

Route your Cerebras API calls through AI SpendOps for automatic usage tracking and cost attribution.

Configuration

SettingValue
Route/v1/cerebras/*
Upstreamhttps://api.cerebras.ai
Auth headerAuthorization: Bearer ...
Streaming usageAuto-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

FieldDescription
prompt_tokensInput tokens
completion_tokensOutput 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:

FieldMeaning
started_at_msProxy received your request
first_byte_at_msFirst byte of the upstream response
ended_at_msResponse 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

FieldPopulated
cache_read_tokensNo. Cerebras does not expose prompt caching
cache_write_tokensNo
reasoning_tokensOnly where the model returns completion_tokens_details
provider_costNo. 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.