Make a request

Relixr is OpenAI-compatible — point your SDK at our gateway base URL and nothing else changes.

Relixr's gateway speaks the same wire format as the OpenAI API. If you already use the openai SDK (or any OpenAI-compatible client), you only need to change the base URL and the key.

from openai import OpenAI

client = OpenAI(
  api_key="nf_live_your_key_here",
  base_url="https://gateway.relixr.com/v1",
)

response = client.chat.completions.create(
  model="gpt-4o-mini",
  messages=[{"role": "user", "content": "Hello!"}],
)
print(response.choices[0].message.content)
print(response.model_extra.get("relixr", {}))  # routing metadata

Successful responses include a relixr extension alongside the standard OpenAI fields, with the routing decision and a full cost breakdown. Refer to Model routing for the full schema.

Tip:

Keep your existing retry and timeout logic. Relixr's response shape and status codes match the OpenAI API, so error handling you've already written keeps working.

Test From a Terminal

This is the whole request, ready to paste:

zsh
$ curl https://gateway.relixr.com/v1/chat/completions -H "Authorization: Bearer $RELIXR_API_KEY" -d '{"model":"gpt-4o-mini","messages":[{"role":"user","content":"Hello!"}]}'
{"id":"chatcmpl-…","choices":[{"message":{"content":"Hello! How can I help?"}}],"relixr":{"cost":{"final_usd":0.00004}}}

Test Without Writing Code

Go to Playground in the dashboard to send a message against any model, using any of your keys, without writing a client.

Playground preview · model: gpt-4o-mini
You: Hello!
Sign in to run this request live and see the response, routing decision, and cost breakdown.
Try it live — sign in →
Next steps
Supported models
Every provider and model ID you can call.
Model routing
Read the cost and routing metadata on each response.
Create your first API keySupported models