> ## 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.

# Together AI

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

Together AI hosts a large catalog of open-source 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 Together AI and wrap it:

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

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

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

## What is reported

Together 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 Together AI's API, see Together AI's [OpenAI compatibility docs](https://docs.together.ai/docs/inference/openai-compatibility).


## Related topics

- [Supported providers and gateways](/documentation/ai-agents/llm-wrappers/supported-providers.md)
- [AI Terminal](/api-and-sdks/ai-terminal.md)
- [OpenAI-compatible endpoints](/documentation/ai-agents/llm-wrappers/providers/openai-compatible.md)
- [TypeSafe](/documentation/ai-agents/llm-wrappers/providers/typesafe.md)
- [Set budgets for AI agents](/guides/ai-agents/set-budgets-for-ai-agents.md)


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