Skip to main content
Groq serves open-weight models on its own inference hardware.

Set up

Wrap either Groq’s own client, Groq from groq-sdk, or an OpenAI client whose baseURL points at Groq. The SDK recognizes both from the api.groq.com address and selects the Groq recipe automatically.
  • Streamed calls are metered without extra options. Groq sends the usage of a streamed call on its last chunk, and the SDK reads it from there.
  • A Groq address the SDK does not recognize, such as a proxy in front of Groq, is metered with the OpenAI recipe and reported under openai.*. To report it as Groq, pass the recipe yourself: stigg.wrap(client, { recipe: groqRecipe }).
Earlier versions of the SDK reported Groq calls under openai.chat.completions.create. They are now reported under groq.chat.completions.create. If a meter in Stigg filters on the old event name for Groq traffic, add the new name to it, or pass recipe: openAIRecipe to wrap() to keep the old name.

What is reported

Groq returns a usage object in OpenAI’s format with the number of tokens each call consumed. The wrapper reads it and reports it to Stigg as the metrics below. For details, see Groq’s API reference. Groq has no Responses API, so it has a single event name. Groq does not return a price, so there is no cost metric. Cached tokens are counted inside prompt_tokens, so price the input or the cached tokens, not both. total_tokens includes all the token counts above, so price the total or the parts, never both. For Groq’s compound systems, which run several models in one request, the request’s total usage is reported. The per-model breakdown Groq also returns is not reported. Every usage field the vendor returns is also included, with a raw. prefix. See How usage is reported.