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

# Fireworks AI

> Wrap Fireworks AI's OpenAI-compatible API to meter and gate calls with Stigg.

Fireworks AI hosts open-source and fine-tuned models. Its API follows OpenAI's format, so you wrap it with the `OpenAI` client and the SDK meters it with the OpenAI recipe.

## Set up

Point the `OpenAI` client's `baseURL` at Fireworks AI and wrap it:

```typescript theme={null}
import OpenAI from 'openai';

const fireworks = stigg.wrap(
  new OpenAI({ baseURL: 'https://api.fireworks.ai/inference/v1', apiKey: process.env.FIREWORKS_API_KEY }),
);

const response = await fireworks.chat.completions.create({
  model,
  messages,
  stiggContext: { customerId: 'customer-acme', entitlement: { currencyId: 'credits' } },
});
```

## What is reported

Fireworks AI returns a `usage` object in OpenAI's format with the number of tokens each call consumed. Calls are reported under the `openai.chat.completions.create` event name, with the same metrics as [OpenAI](/documentation/ai-agents/llm-wrappers/providers/openai#what-is-reported).

Every usage field the provider returns is also included, with a `raw.` prefix. See [How usage is reported](/documentation/ai-agents/llm-wrappers/supported-providers#how-usage-is-reported).

For details on Fireworks AI's API, see Fireworks AI's [OpenAI compatibility docs](https://docs.fireworks.ai/tools-sdks/openai-compatibility).


## Related topics

- [Supported providers and gateways](/documentation/ai-agents/llm-wrappers/supported-providers.md)
- [OpenAI-compatible endpoints](/documentation/ai-agents/llm-wrappers/providers/openai-compatible.md)
- [AI Terminal](/api-and-sdks/ai-terminal.md)
- [Together AI](/documentation/ai-agents/llm-wrappers/providers/together.md)
- [Get started with AI](/documentation/getting-started/get-started-with-ai.md)


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