Make a request

/docs/make-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="rlx_your_key_here",
  base_url="https://api.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.

Import a collection

Prefer a GUI? Import the Postman or Bruno collection from examples/http and set RELIXR_API_KEY. See also SDKs and CLI.

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://api.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.
Was this helpful?

Still stuck? Help center · Doctor