Unified LLM API: One Key for Multiple Models
What is a unified LLM API? It is a single HTTP contract—usually OpenAI Chat Completions—plus one API key that can address many model ids. The gateway translates each request to the upstream provider that currently serves that id, then meters usage in one account.
What problem does one key solve?
Without a unified API, each model family tends to ship its own base URL, auth header, and error shape. Agent tools and SDKs already know OpenAI’s schema. A gateway that speaks that schema lets you change models by changing the model field, not the integration.
How do you call ZBStream’s unified API?
Set the OpenAI SDK (or curl) to the ZBStream base URL and a key created in the console. Use a model id from the public catalog or GET /v1/models.
from openai import OpenAI
client = OpenAI(
api_key="your_zbstream_key",
base_url="https://api.bewarezone.com/v1",
)
response = client.chat.completions.create(
model="deepseek-v4-pro",
messages=[{"role": "user", "content": "Hello"}],
)
Copy-paste samples for curl, Python, and Node are on First call. Field-level notes are on API reference.
What stays unified, and what does not?
- Unified: bearer auth, chat messages, streaming flag, usage logged against one credit balance.
- Still model-specific: context length, vision or audio support, thinking-mode parameters, and upstream rate limits.
Failover and channel selection are documented under model routing. Credits and token math are under pricing and token usage.
How is this different from calling a vendor directly?
Direct vendor APIs are the right choice when you need a feature the gateway does not forward, or a private endpoint the gateway cannot reach. A unified API is the right choice when you expect to swap models, add a backup channel, or centralize spend—without rewriting clients.
FAQ
Does one API key work for every model?
The key works for models the operator has enabled for that application. If a model is missing, call GET /v1/models or open the catalog.
Is the API OpenAI-compatible?
The public chat path is designed for OpenAI SDK base_url usage. Vendor-only fields are not a compatibility promise; see the capability notes in the API docs.
Where do I see cost?
Successful requests settle credits from input, cache-hit, and output tokens. The console usage views show the same ledger the gateway writes.