Use the OpenAI and Anthropic SDKs with the Omni API

Published · Updated · Radiant Crest Inc.

Switch an existing OpenAI or Anthropic integration to the Omni API by changing two settings, then call GPT, Claude and Gemini models with one key.

What changes

Only the base URL and the API key. The Omni API accepts the OpenAI Chat Completions and Responses formats and the Anthropic Messages format, so request and response shapes stay the same.

SettingValue
Base URL (OpenAI SDKs)https://omni-api.rcinc.app/v1
Base URL (Anthropic SDK)https://omni-api.rcinc.app
API keyYour full key from the dashboard, starting with omni_live_

Python, OpenAI SDK

from openai import OpenAI

client = OpenAI(api_key="omni_live_…", base_url="https://omni-api.rcinc.app/v1")
reply = client.chat.completions.create(
    model="gpt-6.1-sol",
    messages=[{"role": "user", "content": "Write a haiku about rate limits."}],
)
print(reply.choices[0].message.content)

Node.js, OpenAI SDK with streaming

import OpenAI from "openai";

const client = new OpenAI({ apiKey: process.env.OMNI_KEY, baseURL: "https://omni-api.rcinc.app/v1" });
const stream = await client.chat.completions.create({
  model: "claude-sonnet-5",
  messages: [{ role: "user", content: "Summarise this changelog in three bullets." }],
  stream: true,
});
for await (const chunk of stream) process.stdout.write(chunk.choices[0]?.delta?.content ?? "");

Python, Anthropic SDK

import anthropic

client = anthropic.Anthropic(api_key="omni_live_…", base_url="https://omni-api.rcinc.app")
message = client.messages.create(
    model="claude-opus-5.5", max_tokens=512,
    messages=[{"role": "user", "content": "Hello"}],
)
print(message.content[0].text)

Choosing a model

Use any id from GET https://omni-api.rcinc.app/v1/models, for example gpt-6.1-sol, gpt-6-luna, claude-opus-5.5, claude-sonnet-5 or gemini-3.8-flash. The list includes each model's current price.

Seeing what each call cost

Non-streaming responses include omni.charged_usd, and every response has an x-omni-charged-usd header. The dashboard lists every deduction.

Things to check after switching

  • Keep the key on your server; never ship it in a browser or mobile app.
  • Handle status 429 with code rate_limited by waiting for the retry-after seconds.
  • If you used vendor-only beta parameters, test them; unusual options may need the raw passthrough endpoint described in the docs.

Follow along with $5 of credit.

Get your API key →