Skip to main content

Base URL

Quick setup

Do not use your OpenAI API key. The gateway authenticates with MetrixLLM keys (sk-metrix-* prefix), then uses its own provider keys (or your BYOK keys) to call OpenAI.

Request Headers

Every request supports these headers for authentication, tracing, and metadata: Session Tracing Custom Properties Attach up to 10 custom metadata properties per request: Example: metrix-property-team: engineering, metrix-property-environment: production IP Detection

Supported models

Routing mode

Control how the gateway authenticates with OpenAI using the mode parameter:
When mode is omitted (or "auto"), the gateway prefers your BYOK key if one is configured. If your workspace has insufficient credits and you have a BYOK key, the gateway automatically uses it instead of failing with a payment error.

Web search mode (default)

Add "web_search": true to your request. The gateway performs a web search, generates optimized search queries, and injects the results into your system prompt.
Parameters:

Native mode

Set "web_search": "native" to use OpenAI’s built-in web search. The gateway automatically converts your Chat Completions request into the Responses API format and adds the { "type": "web_search" } tool.
Native-specific parameters:
In native mode, the gateway converts your request from Chat Completions format to OpenAI’s Responses API format. The response comes back in Responses API format — your code may need to handle both formats.

Streaming

Prompt management

Reference a stored prompt template by ID:

Custom properties

Attach metadata for analytics and rate limit targeting:

Response headers

Every response includes these headers: On cache HIT responses, only Content-Type and X-Metrix-Cache-Status: HIT are returned. On rate limited responses (429 Too Many Requests):