Cerebras
A hosted service with its own key and prices. This page lists the addresses it answers, the facts its documentation states, and the setup of each harness.
Addresses and facts
- OpenAI Chat Completions:
https://api.cerebras.ai/v1provider documentation, read
- Authentication
- Authorization: Bearer, with the key in
CEREBRAS_API_KEYprovider documentation, read - Structured output
- provider documentation, read
- Tool calling
- provider documentation, read
- Rate limits
- Read the page provider documentation, read
- Prices
- Read the page provider documentation, read
- Data retention
- The privacy policy says Cerebras does not retain the inputs and outputs of its inference services, as its section 6 describes. Read the page provider documentation, read
- Documentation
- Unknown
- Output limits Baltor recorded
- Unknown
Harness setup
Replace gpt-oss-120b with the model you want.
OpenCode
Put this in opencode.json in your project folder:
{
"$schema": "https://opencode.ai/config.json",
"provider": {
"cerebras": {
"npm": "@ai-sdk/openai-compatible",
"name": "Cerebras",
"options": {
"baseURL": "https://api.cerebras.ai/v1",
"apiKey": "{env:CEREBRAS_API_KEY}"
},
"models": {
"gpt-oss-120b": {
"name": "gpt-oss-120b"
}
}
}
}
}- OpenCode reads any OpenAI-compatible address through the @ai-sdk/openai-compatible package, and an address that speaks the Responses API through @ai-sdk/openai.
From OpenCode documentation, read .
Pi
Put this in ~/.pi/agent/models.json:
{
"providers": {
"cerebras": {
"baseUrl": "https://api.cerebras.ai/v1",
"api": "openai-completions",
"apiKey": "$CEREBRAS_API_KEY",
"models": [
{
"id": "gpt-oss-120b"
}
]
}
}
}- The apiKey field can name an environment variable as $NAME.
From Pi documentation, read .
Codex
Codex speaks only the Responses API, and Cerebras documents no Responses address. A gateway that offers one can sit in between.
- Codex speaks the Responses API only: responses is the one supported wire API of a custom provider. Ollama and LM Studio are built in and start with --oss.
From Codex documentation, read .
Claude Code
Claude Code sends Anthropic Messages requests, and Cerebras documents no such address. A gateway that translates to that API can sit in between.
- Claude Code sends Anthropic Messages requests to ANTHROPIC_BASE_URL. Anthropic says it does not support routing Claude Code to models other than Claude through any gateway, so some features may not work with another model.
From Claude Code documentation, read .
Models it lists
Prices in US dollars per million tokens, input and output, as models.dev, read records them.
| Model | Input | Output | Context | As of |
|---|---|---|---|---|
GPT OSS 120B gpt-oss-120b | 0.350 USD | 0.750 USD | 131,072 | older than 30 days |
Qwen3.8 27B qwen-3.8-27b | 0.990 USD | 1.49 USD | 65,536 |
Sources of this page
- inference-docs.cerebras.ai/resources/openai, read
- inference-docs.cerebras.ai/capabilities/structured-outputs, read
- inference-docs.cerebras.ai/capabilities/tool-use, read
- inference-docs.cerebras.ai/support/rate-limits, read
- www.cerebras.ai/pricing, read
- www.cerebras.ai/privacy-policy, read
- models.dev/api.json, read
Paid links
No link in this directory is a paid link or an ad, and no listing is paid for. The order and the contents of every list come from the sources named on this page.