Quickstart (5 Minutes)

UnifiedAPI is 100% compatible with the official OpenAI SDK. Point your base_url to our gateway, use your sk-uf-... API key, and pass model="smart" or any specific model slug.

  • Create an account and top up at least $1 USD by card.
  • Generate an API key in Dashboard โ†’ API Keys (copy it immediately; it is shown only once).
  • Set model="smart" to let our router select the best model & server, or pass a model slug like "llama-3.3-70b".
  • Every response includes x-unified-model, x-unified-server, token usage, USD cost, and fallback status.
from openai import OpenAI

client = OpenAI(
    base_url="https://api.unifiedllm.io/v1",
    api_key="sk-uf-your-key"
)

res = client.chat.completions.create(
    model="smart",
    messages=[{"role": "user", "content": "Hello!"}]
)
print(res.choices[0].message.content)