Skip to main content
Use Metrion as a proxy for xAI’s Grok models. Grok exposes an OpenAI-compatible API, so you can use the standard OpenAI SDK — only the baseURL changes.

Prerequisites

  • A Metrion account with your sk-metrion-xxx token (find it on the Integrate page)
  • An xAI API key saved in Metrion’s Integrate page

Setup

Direct HTTP

Supported models

Pass-through mode

To use your own xAI key without storing it in Metrion, pass it in Authorization: Bearer and identify your Metrion account with the x-metrion-token header:
In pass-through mode, your xAI key is forwarded directly to xAI’s API and is never stored by Metrion.

Track requests by user or service

Add the optional x-metrion-user header to tag individual requests. These labels appear in your Metrion logs and dashboards.
Use x-metrion-user to break down costs by team member, bot, or application — for example "x-metrion-user": "search-agent" or "x-metrion-user": "user-55".