Skip to main content

Set up

Any provider that exposes an OpenAI-compatible API and returns an OpenAI-shaped usage block can be wrapped through the OpenAI client. Point baseURL at the provider and wrap it:
Each of these has its own page with the base URL to use and anything specific to that provider:

Together AI

A large catalog of open-source models

Fireworks AI

Open-source and fine-tuned models

DeepSeek

DeepSeek’s own models

xAI

Grok models

Perplexity

Models with built-in web search

vLLM

Self-hosted model server
Any other provider with an OpenAI-compatible API works the same way. Some providers have their own recipe, which the SDK selects instead of the OpenAI recipe, so their calls are reported under their own event names: OpenRouter, LiteLLM Proxy and Groq. Mistral and Ollama also serve an OpenAI-compatible API: through the OpenAI client they are metered as described on this page, and through their own clients with their own recipes.
Many compatible providers only include usage in a stream when stream_options: { include_usage: true } is set. Check one streamed call in Stigg before relying on it.

What is reported

An OpenAI-compatible provider returns responses in OpenAI’s format, including a usage object with the number of tokens the call consumed. Not every provider fills in every field, so check the provider’s own API docs for what its usage object contains, and OpenAI’s Chat Completions reference for the format itself. These providers are wrapped through the OpenAI client, so usage is reported with the OpenAI recipe: the openai.chat.completions.create and openai.responses.create event names, and the same metrics as OpenAI. Which of those metrics are filled in depends on what the provider returns in its usage block. To tell providers apart in Stigg, add a dimension such as provider to the stiggContext. Every usage field the vendor returns is also included, with a raw. prefix. See How usage is reported.