canonical: https://jentic.com/apis/cerebras.ai/cerebras

# Cerebras Inference API

Jentic publishes the only available OpenAPI specification for Cerebras Inference API, keeping it validated and agent-ready. The Cerebras Inference API delivers low-latency chat completions backed by Cerebras's wafer-scale inference hardware, and exposes an OpenAI-compatible request and response shape so existing OpenAI client code can be repointed with only a base URL and key change. The catalogue covers chat completions, model listing, and per-model metadata retrieval.

## For AI agents

Run fast chat completions on hosted open-weight models such as Llama variants using an OpenAI-compatible request shape, and list which models are currently served.

## Scope

Does not handle image generation, embeddings, fine-tuning, or audio transcription - use for chat completion inference on Cerebras-hosted text models only.

## Capabilities

- Generate chat completions with streaming or non-streaming responses against Cerebras-hosted models
- List the open-weight models currently available on the Cerebras inference fleet
- Retrieve metadata for a specific model including ownership and creation timestamp
- Reuse OpenAI-compatible client code by pointing it at api.cerebras.ai/v1
- Pass standard sampling controls including temperature, top_p, max_tokens, and stop sequences

## Use cases

### Low-Latency Chat Completion

Generate chat completions where end-to-end latency matters more than maximum context window or tool-use breadth. The `/chat/completions` endpoint returns assistant messages from Cerebras-hosted open-weight models at significantly higher tokens per second than commodity GPU inference, which is useful for live agents, voice front ends, and interactive coding assistants. The request shape mirrors OpenAI's chat completions, so messages, temperature, and max_tokens carry over unchanged.

Example prompt: Call POST `/chat/completions` with model llama3.1-8b and a system+user message pair, max_tokens 256, and return the assistant content

### Model Discovery

Discover which open-weight models are currently served by Cerebras before sending traffic, since the catalogue changes over time as new model families are added. GET /models returns the full list, and GET `/models/{model_id}` returns ownership and creation metadata for a single entry. Useful when an agent needs to pick the largest available model that fits a latency budget.

Example prompt: Call GET /models and return the list of model ids whose id field contains 'llama'

### Drop-in OpenAI Client Replacement

Swap an existing OpenAI Python or JavaScript client over to Cerebras for chat workloads by changing only the base URL to https://api.cerebras.ai/v1 and the API key. Because the request and response schemas of `/chat/completions` match OpenAI's, the rest of the application code, including streaming handlers and token counting, can stay the same. This is useful for cost or latency-driven migrations on production traffic.

Example prompt: Configure an OpenAI Python client with base_url https://api.cerebras.ai/v1, send a chat.completions.create call, and confirm the response object has the standard choices[0].message.content shape

### AI Agent Inference Routing via Jentic

An agent framework that routes requests across multiple inference backends needs to call Cerebras alongside OpenAI, Groq, and Anthropic. Through Jentic, the agent searches for a 'fast chat completion' operation, loads the Cerebras input schema, and executes the call with a key drawn from your Jentic One instance. The agent can switch backends per turn without rewriting auth code or response parsing.

Example prompt: Use Jentic to search 'generate a chat completion', load the Cerebras chat operation, and execute it with the messages array from the agent's current turn

## Key endpoints

| Method | Path | Description |
| --- | --- | --- |
| POST | `/chat/completions` | Create a chat completion against a Cerebras-hosted model |
| GET | `/models` | List available models |
| GET | `/models/{model_id}` | Retrieve a single model's metadata |

## Key resources

- **Chat Completions** — Submit message arrays to a Cerebras-hosted model and receive an assistant response, optionally streamed
- **Models** — List the catalogue of currently served open-weight models and retrieve per-model metadata

## Why Jentic

- **Setup:** Wiring the Cerebras Inference API by hand means handling bearer token auth and building the chat completion request body against its hosted text models yourself. Through Jentic you install once, import Cerebras Inference from the API Directory, store the token once, and your agent calls it.
- **Permission scoping:** Cerebras carries the messages payload in the request body rather than a resource path, so scope your agent to the operations it needs, such as chat completions and listing models, and leave the rest out. Every operation you credit it with is one you have added to the allowed set.
- **Credential handling:** Your Cerebras API key is stored once, encrypted, by your own Jentic One instance and injected at execution time. It never enters the agent's prompt, logs, or context.
- **Discovery method:** Agents search Jentic by intent such as 'generate a fast chat completion' or 'list available models', and Jentic returns the matching Cerebras operation with its input schema so the agent calls `/chat/completions` with a typed messages array without browsing the reference docs.

## Related APIs

- **Groq API** — Another low-latency inference provider serving open-weight models with an OpenAI-compatible API
- **OpenAI API** — Frontier closed-weight models with the broadest tool, vision, and multimodal coverage
- **Anthropic Messages API** — Claude family chat API for high-context, careful reasoning workloads

## FAQ

### Why is there no official OpenAPI spec for Cerebras Inference API?

Cerebras does not publish an OpenAPI specification. Jentic generates and maintains this spec so that AI agents and developers can call Cerebras Inference API via structured tooling. It is validated against the live API and kept up to date. Get started with Jentic One, the self-hosted execution layer.

### What authentication does the Cerebras Inference API use?

The API uses bearer token authentication with an API key issued from the Cerebras cloud console, sent as Authorization: Bearer <key>. Through Jentic, the key is held in your Jentic One instance and injected at execution time so it never reaches the agent's prompt or context window.

### Can I use the Cerebras Inference API as a drop-in replacement for OpenAI?

For chat completions, yes. POST `/chat/completions` accepts the same messages array, model id, temperature, top_p, max_tokens, and stop fields as OpenAI's chat completions, and returns the same choices[0].message.content shape. Repoint an OpenAI client at base URL https://api.cerebras.ai/v1, pass a Cerebras key, and choose a Cerebras-served model id.

### What are the rate limits for the Cerebras Inference API?

Rate limits are enforced per API key as requests per minute and tokens per minute, with the exact ceilings tied to the plan attached to the key. Cerebras returns 429 with a Retry-After header when limits are hit, so agents should respect that header rather than hard-coding a fixed throttle.

### How do I generate a chat completion with the Cerebras Inference API through Jentic?

Search Jentic for 'generate a chat completion with cerebras', load the operation backed by POST `/chat/completions`, and execute it with a messages array and a model id returned by GET /models. Jentic handles the bearer header so the agent only sees a typed input and output.

### Which models are available on the Cerebras Inference API?

The catalogue is dynamic and exposed through GET /models. Call that endpoint to get the current list of model ids and pass one of them as the model field on `/chat/completions.` Use GET `/models/{model_id}` to read per-model metadata such as ownership and creation timestamp.

### Can I limit what my agent is allowed to do with the Cerebras Inference API?

Yes. Because you run Jentic One yourself and your own rules decide which operations and credentials the agent may use, you scope the agent to only the Cerebras operations it needs. This API exposes just three: creating a chat completion via POST `/chat/completions`, listing models via GET /models, and reading a single model's metadata via GET `/models/{model_id}`, and you credit the agent with only the ones its task requires. Since the messages payload travels in the request body rather than a resource path, every operation you add is an explicit entry in the allowed set, and anything you leave out stays out of reach.
