Move to ZephAI without a rewrite
Three migration paths, in order of effort: base-URL swap, gateway adapter, or full multi-vendor consolidation.
Choose a path
Base-URL swap
You already use an OpenAI-compatible SDK. Change two values and keep everything else.
- OpenAI SDKs
- LangChain, LlamaIndex, Vercel AI SDK
- Any client that accepts a base URL
Gateway adapter
You have provider-specific features (vision formats, logprobs, beta headers). Map them once behind a thin adapter.
- 2–3 provider quirks to map
- Typed errors & retries preserved
- Shadow traffic first
Consolidate vendors
You're integrating N vendors directly. Collapse them into one key, one invoice and failover across listings.
- Per-vendor SDKs removed
- Single invoice & telemetry
- Run with solutions engineering
From the OpenAI SDK
Two values change: the base URL and the API key. Model IDs are ZephAI listing IDs.
# before client = OpenAI(api_key=os.environ["OPENAI_API_KEY"]) resp = client.chat.completions.create(model="gpt-4o-mini", messages=msgs) # after client = OpenAI( api_key=os.environ["ZEPHAI_KEY"], base_url="https://api.zephai.dev/v1", ) resp = client.chat.completions.create(model="zeph-nexus-4", messages=msgs)
// before const client = new OpenAI({ apiKey: process.env.OPENAI_API_KEY }); // after const client = new OpenAI({ apiKey: process.env.ZEPHAI_KEY, baseURL: "https://api.zephai.dev/v1", }); const res = await client.chat.completions.create({ model: "zeph-nexus-4", messages, });
Works unchanged
- Chat completions, streaming, tool-calling
- Embeddings & rerank
- Images (generation + edit)
- Audio transcriptions
- Files, batches, structured outputs
Map these
- Model IDs → listing IDs (use
GET /v1/models) - Org header → not needed, use workspace keys
- Legacy
/v1/usage_reports→/v1/usage
From other gateways
Most gateways expose an OpenAI-compatible surface, so path 1 applies. What usually needs attention:
| Concept | Elsewhere | ZephAI |
|---|---|---|
| Auth | Bearer key | Bearer key (zph_live_ / zph_test_) |
| Model routing | route / provider field | model: "auto" + fallbacks[] |
| Spend limits | workspace credits | per-key spend caps (enforced) |
| Usage export | /usage endpoint | /v1/usage + scheduled CSV |
| Failover | automatic, hidden | explicit fallbacks[] + 250 ms budget |
| Vendor attribution | rarely exposed | every response has vendor_id |
metadata tags, then compare cost and latency per feature in the ZephAI console.From direct vendor APIs
This is the migration with the biggest payoff: N SDKs, N keys, N invoices and N incident channels become one of each.
- 1
Inventory your calls
List every model you call today, its traffic share and any provider-specific features you rely on.
- 2
Map to listings
Find equivalents in the catalog; where none exists, keep the vendor's own key as a bring-your-own credential.
- 3
Shadow traffic
Mirror production requests to ZephAI with
metadata.mode: "shadow"and compare responses. - 4
Cut over by service
Percentage rollout with rollback thresholds; retire vendor SDKs as each service lands.
Compatibility gaps
Things that are deliberately different — plus the rare ones that need code.
| Feature | Support | Notes |
|---|---|---|
| logprobs | Partial | Top-5 only, chat models |
| Assistants API (threads) | Not yet | Use /responses with store:false |
| Fine-tuning | Beta | LoRA on selected listings |
| Predicted outputs | Not yet | Q1 2027 |
| Realtime / WebSocket | Beta | SSTT + TTS preview |
| Prompt caching | Yes | Automatic, savings passed through |
| Structured outputs | Yes | JSON schema enforced at gateway |
v1 → v2 (breaking)
Gateway v2 shipped September 22, 2026. If you're still on v1, three things changed:
- One endpoint for all listings.
/v1/providers/{vendor}/…collapsed into/v1/…withmodelselecting the listing. - Failover became explicit. Automatic silent retries are replaced by the
fallbacksarray — you control the budget. - Usage API moved.
/v1/usage_reports→/v1/usage, removed December 30, 2026.
# v1 curl https://api.zephai.dev/v1/providers/novalabs/chat/completions \ -H "Authorization: Bearer $KEY" -d '{"model":"mix-70b", …}' # v2 curl https://api.zephai.dev/v1/chat/completions \ -H "Authorization: Bearer $KEY" \ -d '{"model":"novalab-mix-70b","fallbacks":["zeph-small-2"], …}'