> ## Documentation Index
> Fetch the complete documentation index at: https://docs.keywordsai.co/llms.txt
> Use this file to discover all available pages before exploring further.

# Fireworks AI

> Route Fireworks AI model calls through Keywords AI Gateway using your own Fireworks credits.

<Note> This section is for **Keywords AI LLM gateway** users.</Note>

Use Keywords AI Gateway to call **Fireworks AI** models while keeping unified observability (logs, cost, latency, and reliability metrics) in Keywords AI — and optionally charge usage to **your own Fireworks credits**.

## Prerequisites

* A **Keywords AI API key**
* A **Fireworks API key** (BYOK credits)

<CardGroup cols={1}>
  <Card title="Get Fireworks API key" icon="key" href="https://fireworks.ai/api-keys">
    Retrieve your API key from Fireworks to begin integration.
  </Card>
</CardGroup>

## Supported SDKs / integrations

<AccordionGroup>
  <Accordion title="✅ Supported Frameworks">
    * [OpenAI SDK](/integration/development-frameworks/llm_framework/openai/openai-sdk)
    * [LangChain SDK](/integration/development-frameworks/llm_framework/langchain)
    * [Vercel/OpenAI](/integration/development-frameworks/llm_framework/vercel#openai)
    * [Vercel/Google](/integration/development-frameworks/llm_framework/vercel#google)
    * [LlamaIndex SDK](/integration/development-frameworks/llm_framework/llama-index)
    * [Google GenAI](/integration/development-frameworks/llm_framework/google_genai)
    * [Keywords native (Otel)](/get-started/quickstart/gateway)
  </Accordion>

  <Accordion title="❌ Unsupported Frameworks">
    * [Anthropic SDK](/integration/development-frameworks/llm_framework/anthropic)
    * [Vercel/Anthropic](/integration/development-frameworks/llm_framework/vercel#anthropic)
  </Accordion>
</AccordionGroup>

## Configuration

There are 2 ways to add your Fireworks credentials to your requests:

### Via UI (Global)

<Steps>
  <Step title="Navigate to Providers">
    Go to the [Providers page](https://platform.keywordsai.co/platform/api/providers). This page allows you to manage credentials for over 20+ supported providers.

    <Frame>
      <img src="https://keywordsai-static.s3.us-east-1.amazonaws.com/docs/settings/providers.jpg" alt="Keywords AI Providers Page" />
    </Frame>
  </Step>

  <Step title="Add your Fireworks API Key">
    Select Fireworks and paste your API key.

    <Frame>
      <img src="https://mintcdn.com/keywordsai/-egFtHX1IBbYpy-e/images/providers/fireworks.png?fit=max&auto=format&n=-egFtHX1IBbYpy-e&q=85&s=c374252e631c9669020162f1dc9f84c8" alt="Add Fireworks Credentials" width="1142" height="912" data-path="images/providers/fireworks.png" />
    </Frame>
  </Step>

  <Step title="Configure Load Balancing (Optional)">
    You can add multiple Fireworks API keys for redundancy. Use the `Load balancing weight` field to determine how traffic is distributed between keys.
  </Step>
</Steps>

### Via code (Per-Request)

You can pass credentials dynamically in the request body. This is useful if you need to use your users' own API keys (BYOK credits).

Add the `customer_credentials` parameter to your [Gateway request](/api-endpoints/develop/gateway/chat-completions):

```json theme={"system"}
{
  // Rest of the request body
  "customer_credentials": {
    "fireworks": {
      "api_key": "YOUR_FIREWORKS_API_KEY"
    }
  }
}
```

## Log Fireworks AI requests

If you are not using the Gateway to proxy requests, you can still log your Fireworks requests to Keywords AI asynchronously. This allows you to track cost, latency, and performance metrics for external calls.

```python Fireworks AI Python SDK theme={"system"}
import requests

url = "https://api.keywordsai.co/api/request-logs/create/"
payload = {
    "model": "accounts/fireworks/models/llama-v3p1-8b-instruct",
    "prompt_messages": [
        {
            "role": "user",
            "content": "Summarize the benefits of renewable energy"
        }
    ],
    "completion_message": {
        "role": "assistant",
        "content": "Renewable energy offers benefits like lower emissions, improved air quality, and long-term cost stability..."
    },
    "cost": 0.0003,
    "generation_time": 1.5,
    "customer_params": {
        "customer_identifier": "user_202"
    }
}
headers = {
    "Authorization": "Bearer YOUR_KEYWORDS_AI_API_KEY",
    "Content-Type": "application/json"
}

response = requests.post(url, headers=headers, json=payload)
```

<Card title="Get Started with Logging" icon="rocket" href="/documentation/products/logs/quickstart"> Learn how to set up comprehensive logging for all your LLM requests </Card>
