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

# Fireworks

> Use Fireworks AI models with Agno agents.

Fireworks is a platform for providing endpoints for Large Language models.

## Authentication

Set your `FIREWORKS_API_KEY` environment variable. Get your key from [here](https://fireworks.ai/account/api-keys).

<CodeGroup>
  ```bash Mac theme={null}
  export FIREWORKS_API_KEY=***
  ```

  ```bash Windows theme={null}
  setx FIREWORKS_API_KEY ***
  ```
</CodeGroup>

## Prompt caching

Prompt caching will happen automatically using our `Fireworks` model. You can read more about how Fireworks handle caching in [their docs](https://docs.fireworks.ai/guides/prompt-caching#using-prompt-caching).

## Example

Use `Fireworks` with your `Agent`:

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

  agent = Agent(
      model=Fireworks(id="accounts/fireworks/models/firefunction-v2"),
      markdown=True
  )

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

  ```
</CodeGroup>

<Note> View more examples [here](/models/providers/gateways/fireworks/usage/basic). </Note>

## Parameters

| Parameter  | Type            | Default                                                | Description                                                         |
| ---------- | --------------- | ------------------------------------------------------ | ------------------------------------------------------------------- |
| `id`       | `str`           | `"accounts/fireworks/models/llama-v3p1-405b-instruct"` | 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](/models/providers/native/openai/completion/overview).
