> ## Documentation Index
> Fetch the complete documentation index at: https://agno-v2-himanshu-v3-tools-models-docs.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Cerebras OpenAI

> Use Cerebras with Agno through an OpenAI-compatible interface.

## OpenAI-Compatible Integration

Cerebras also exposes an OpenAI-compatible interface, so you can use it with tools and libraries built for the OpenAI API.

<Warning>
  Cerebras deprecated `llama-4-scout-17b-16e-instruct` on 2025-11-03 — see [Cerebras's deprecation notice](https://inference-docs.cerebras.ai/support/deprecation). Agno v3.0 defaults `CerebrasOpenAI.id` to `gpt-oss-120b`; earlier Agno versions default to the deprecated model, so set `id="gpt-oss-120b"` or another current [Cerebras model](https://inference-docs.cerebras.ai/models/overview) explicitly there.
</Warning>

### Basic Usage

The `CerebrasOpenAI` class provides an OpenAI-style interface for Cerebras models. First, install the required packages:

```shell theme={null}
uv pip install openai cerebras-cloud-sdk
```

```python theme={null}
from agno.agent import Agent
from agno.models.cerebras import CerebrasOpenAI

agent = Agent(
    model=CerebrasOpenAI(
        id="gpt-oss-120b",  # Model ID to use
        # base_url="https://api.cerebras.ai/v1", # Optional: default endpoint for Cerebras
    ),
    markdown=True,
)

# Print the response in the terminal
agent.print_response("write a two sentence horror story")
```

### Configuration Options

The `CerebrasOpenAI` class accepts the following parameters:

| Parameter             | Type            | Description                                                                                                                                 | Default                                                    |
| --------------------- | --------------- | ------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------- |
| `id`                  | str             | Model identifier (for example, "gpt-oss-120b")                                                                                              | "gpt-oss-120b"                                             |
| `name`                | str             | Display name for the model                                                                                                                  | "CerebrasOpenAI"                                           |
| `provider`            | str             | Provider name                                                                                                                               | "CerebrasOpenAI"                                           |
| `api_key`             | str             | API key (falls back to CEREBRAS\_API\_KEY environment variable)                                                                             | None                                                       |
| `base_url`            | str             | URL of the Cerebras OpenAI-compatible endpoint                                                                                              | "[https://api.cerebras.ai/v1](https://api.cerebras.ai/v1)" |
| `parallel_tool_calls` | Optional\[bool] | Whether to run tool calls in parallel (set to False automatically for `llama-4-scout-17b-16e-instruct`, a model Cerebras has since retired) | None                                                       |

`CerebrasOpenAI` also supports the parameters of [OpenAI](/reference/models/openai).

### Examples

* [More examples](/models/providers/gateways/cerebras-openai/usage/basic)
