Point the OpenAI SDK at https://api.uplinkswitch.com/v1 with an UplinkSwitch key and your existing calls keep working, with GPT, Claude, Gemini and Grok on that same key. Each model in the chat catalog speaks the OpenAI Chat Completions format, so moving between families is a one-string change. GPT models are priced under OpenAI's list: gpt-6.1-sol costs $0.582 / $2.91 per million tokens here, against $2.00 / $10.00.
What changes besides the base URL
| Before | After | |
|---|---|---|
| Base URL | OpenAI's | https://api.uplinkswitch.com/v1 |
| Key | Your OpenAI key | sk-uplink-live-… (or sk-uplink-test-… for a test environment) |
| Auth header | Authorization: Bearer | Authorization: Bearer or x-api-key; a key in the URL is refused |
| Model names | OpenAI's list | Catalog ids. GET /v1/models with your key lists exactly what that key can call |
| Usage on streams | Only if you set stream_options.include_usage | Added for you, so streamed calls are always metered |
| Cost per call | Usage dashboard | x-uplink-charge, x-uplink-list-cost and x-uplink-saved headers on non-streamed responses |
| Out of money | Account-level billing errors | 402 with a code: insufficient_balance (account) or monthly_limit_reached (that key) |
Agent tools that send a Responses-API-shaped body to the Chat Completions path, as Cursor's Agent mode does for GPT models, are read correctly and answered in Chat Completions format, at the normal price.
One key, four model families (Python)
import os
from openai import OpenAI
client = OpenAI(base_url="https://api.uplinkswitch.com/v1",
api_key=os.environ["UPLINKSWITCH_API_KEY"])
for model in ["gpt-6.1-sol", "claude-sonnet-5-5", "gemini-4-argon", "grok-4.7"]:
r = client.chat.completions.create(
model=model,
messages=[{"role": "user", "content": "Explain a race condition to a junior developer in two sentences."}],
)
print(f"--- {model}\n{r.choices[0].message.content}\n")Price a prompt on every candidate before you switch (TypeScript)
POST /v1/estimate prices a request on several models without sending it to any of them. It's public, or uses your own prices and price lock when you add a key:
const res = await fetch("https://api.uplinkswitch.com/v1/estimate", {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({
messages: [{ role: "user", content: "Summarise this support ticket and suggest a reply: ..." }],
output_tokens: 400,
models: ["gpt-6.1-sol", "claude-sonnet-5-5", "gemini-4-argon", "grok-4.7"],
}),
});
console.log(JSON.stringify(await res.json(), null, 2));Input is estimated at about four characters per token unless you pass input_tokens, and the response says when it estimated.
Which OpenAI endpoints have an equivalent
| You call | On this key |
|---|---|
| Chat Completions | Every chat model, any family |
Responses API (/v1/responses) | Its own route, streaming included |
| Responses-shaped bodies at Chat Completions | Accepted for GPT models |
Batch (/v1/files + /v1/batches) | JSONL upload, every line run within 24 hours at the catalog price less a 50% batch discount |
| Moderations, speech, image edits | /v1/moderations, /v1/audio/speech, /v1/images/edits |
Embeddings (/v1/embeddings) | 8 embedding models in the catalog |
Image generation (/v1/images/generations) | Image models, with size and quality mapped per model |
Audio transcription (/v1/audio/transcriptions) | A Whisper model in the catalog |
Model list (/v1/models) | Yes, filtered to what your key may call, with your aliases |
| Realtime, Assistants (threads), fine-tuning | No equivalent route; the OpenAPI document at api.uplinkswitch.com/openapi.json lists every route there is. Keep those calls on OpenAI |
Controls you get with the switch
- Prepaid balance, no subscription, topped up from $10 with no fee.
- A monthly spend limit per key, plus per-key request-rate and concurrency limits (429 with
retry-after). - Paying only for valid JSON: a request that asks for JSON or a schema pays only for an answer that matches; a miss is retried once and isn't billed.
The prepaid LLM API page (/prepaid-llm-api) walks through balances, per-key caps and each 402 code in detail.
Migration checklist
- List every model string in code and config, and map each to a catalog id (
GET /v1/catalogneeds no key). - Create one key per service and set each one's monthly limit before the first deploy.
- Swap the base URL and key through environment variables, so a rollback is a config change.
- Run your real requests (tools, JSON mode, streaming) on the exact models you'll use, and check the cost headers.
- Handle the two 402 codes separately in your error path, and back off on 429 using
retry-after. - Leave fine-tunes, Assistants threads and Realtime sessions on OpenAI; move batch jobs over, where they run at half the catalog price.
What GPT, Claude, Gemini and Grok cost on this key
| Model id | Price per 1M (in / out) | Developer list |
|---|---|---|
gpt-6.1-sol | $0.582 / $2.91 | $2.00 / $10.00 |
claude-sonnet-5-5 | $1.164 / $2.91 | $2.00 / $10.00 |
gemini-4-argon | $0.582 / $2.91 | $2.00 / $10.00 |
grok-4.7 | $0.60 / $1.80 | $2.00 / $6.00 |
The full list, as JSON and CSV too, is on the pricing index (/pricing-index).
Decide which calls move together
| Part of the integration | Migration decision |
|---|---|
| Supported chat call | Keep the SDK interface, then validate its request and response |
| Model selection | Map the configured name to a current catalog entry |
| Tools, JSON and streaming | Test each behavior on the chosen model |
| Realtime, Assistants or fine-tuning | Retain a separate original-provider client for those workflows |
| Images or speech | Consult media discovery independently of the chat shortlist |
Compatibility describes a supported interface. It does not make every provider feature or model option interchangeable; the OpenAI-compatible API page lists what each route accepts.
Roll out one application path at a time
Preserve the old client configuration before introducing a second configuration with the UplinkSwitch base, https://api.uplinkswitch.com/v1. Move a small, representative path first. Compare the response fields, stream handling, tool outcomes and billing record that your application relies on, then increase traffic only after those checks pass.
Keep rollback as an explicit configuration choice. Avoid changing model selection and application behavior in the same experiment, because that makes a regression harder to attribute. Fund the second configuration from a prepaid balance with its own key cap, and read the LLM gateway page for what sits between that key and the model routes.
For route errors, distinguish a last-route server failure, HTTP 502 with upstream_error, from exhausted routing, HTTP 503 with upstream_unavailable. Respect the returned retry guidance instead of assuming both are a model-name error.