> ## Documentation Index
> Fetch the complete documentation index at: https://docs.agno.com/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>
  Agno v2.7.2 defaults `CerebrasOpenAI.id` to the retired `llama-4-scout-17b-16e-instruct` model. Set `id="gpt-oss-120b"` or another current [Cerebras model](https://inference-docs.cerebras.ai/models/overview) explicitly.
</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")                                                        | "llama-4-scout-17b-16e-instruct"                           |
| `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) | None                                                       |

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

### Examples

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