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

# Fireworks

> Use Fireworks AI models with Agno agents.

Fireworks provides hosted, OpenAI-compatible endpoints for open large language models.

## Authentication

Create a [Fireworks API key](https://app.fireworks.ai/settings/users/api-keys), then set the `FIREWORKS_API_KEY` environment variable.

```bash Mac theme={null}
export FIREWORKS_API_KEY=***
```

```powershell Windows theme={null}
$Env:FIREWORKS_API_KEY="your_fireworks_api_key_here"
```

## Prompt caching

Prompt caching happens automatically when you use the `Fireworks` model. Read more about how Fireworks handles caching in [their docs](https://docs.fireworks.ai/guides/prompt-caching#using-prompt-caching).

## Example

Install the `openai` package:

```shell theme={null}
uv pip install -U openai agno
```

Use `Fireworks` with your `Agent`:

```python agent.py theme={null}
from agno.agent import Agent
from agno.models.fireworks import Fireworks

agent = Agent(
    model=Fireworks(id="accounts/fireworks/models/gpt-oss-120b"),
    markdown=True
)

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

> [!NOTE]
>
> See [Fireworks usage examples](https://agno-v2.mintlify.site/models/providers/gateways/fireworks/usage/basic.md).

## Parameters

| Parameter | Type | Default | Description |
| - | - | - | - |
| `id` | `str` | `"accounts/fireworks/models/gpt-oss-120b"` | The ID of the Fireworks model to use |
| `name` | `str` | `"Fireworks"` | The name of the model |
| `provider` | `str` | `"Fireworks"` | The provider of the model |
| `api_key` | `Optional[str]` | `None` | The API key for Fireworks (defaults to FIREWORKS\_API\_KEY env var) |
| `base_url` | `str` | `"https://api.fireworks.ai/inference/v1"` | The base URL for the Fireworks API |

`Fireworks` extends the OpenAI-compatible interface and supports most parameters from the [OpenAI model](https://agno-v2.mintlify.site/models/providers/native/openai/completion/overview.md).


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.