In short
- The OpenAI SDK works unchanged: set base_url to the new endpoint and pick an open model by name.
- Prices are set per model by competing hosts, and you pay exactly the listed price, with no markup.
- Failed requests cost £0, and a request that fails before any reply goes to the next-best host automatically.
- Per-key budgets, spend caps and a per-request price ceiling stop surprise bills.
- The trade-off is trust: prompts are processed on independent hosts' machines, so it's not for confidential data.
Plenty of apps were built on the OpenAI API before open models got good. Today, for summarising, extraction, classification, RAG answers and a lot of chat, a Qwen, Gemma, Llama or gpt-oss model does the job. The question is how to switch without rewriting anything. This post covers an OpenAI API alternative for open models, how the pricing works, and the checks worth doing first.
The one-line switch
If your code uses the OpenAI SDK, change the base URL and the key:
from openai import OpenAI
client = OpenAI(base_url="https://inpherio.co.uk/v1", api_key="YOUR_KEY")
r = client.chat.completions.create(
model="gpt-oss-20b-Q4_K_M",
messages=[{"role": "user", "content": "Summarise this ticket in one line: ..."}],
stream=True,
)
for chunk in r:
print(chunk.choices[0].delta.content or "", end="")
The same goes for /v1/embeddings, /v1/audio/speech and /v1/audio/transcriptions. If your code speaks Anthropic's Messages format or Ollama's /api/chat, those are accepted too. GET /v1/models lists every model live right now; the API reference has every parameter, header and error.
How the pricing works
Instead of one provider setting one price, independent hosts list the same open models and set their own prices: per million input and output tokens for text, per million tokens for embeddings, per hour of audio for speech. You pay exactly the listed price. The platform's fee comes out of the host's share, never added to your bill.
- Prepaid, in pounds. Top up from £10 to £1,000 by card; the card fee is covered, so £10 buys £10 of credit.
- Failed requests cost £0.
- No subscription, no minimum and no per-request base fee.
- Itemised. Every request shows its model, tokens and charge in your dashboard, and the response headers say what you were charged.
The marketplace shows every model with its hosts, live prices and measured speed, and the pricing page has the complete fee list.
Routing and failover
For each request, every host serving that model is scored: currently 35% on whether the model is already loaded, 25% on health, 20% on price and 20% on measured speed. You can steer it:
X-Inpherio-Budget-Per-1M-Tokenssets a price ceiling for a request.X-Inpherio-Min-Reliabilitysets a minimum host health from 0 to 100.- Warm-only routing sends requests only to hosts with the model already loaded.
If a host fails before any of the reply has reached you, the request goes to the next-best host and you pay once. If a stream breaks part-way, it ends with a node_failed_mid_stream error and isn't charged, never silently replayed.
What to check before you switch
- Quality on your task. Run your own test set against two or three open models. A 30B mixture-of-experts model like Qwen3 30B often matches older closed models on structured tasks. Our best LLM right now post is a good shortlist.
- Context length. Each model page shows the context the host actually serves, which can be lower than the model's maximum.
- Tool calls and JSON. Check that the model you pick handles your function-calling or structured-output pattern.
- Data sensitivity. Prompts are processed on independent hosts' machines in plaintext. Hosts are forbidden from storing or inspecting them, but it isn't a secure enclave. Keep confidential or regulated data off the open marketplace; the security page is upfront about this.
- Availability. A model is available while a host serves it. If you need one machine to yourself, rent a node by the hour.
Mapping OpenAI models to open models
There's no exact one-to-one match, but these pairings are a good place to start your tests:
| If you use | Try first | Why |
|---|---|---|
| A small, cheap chat model for classification and extraction | Qwen3 8B, Gemma 3 12B | Fast, good at following short instructions |
| A mid-size model for general chat and summaries | Qwen3 30B-A3B, gpt-oss 20B | Mixture-of-experts: strong quality at low cost per token |
| A large model for harder reasoning | gpt-oss 120B, Qwen3 Next 80B | The biggest open models served on the marketplace |
| text-embedding models | bge-m3, nomic-embed-text, Qwen3 Embedding | Strong open embedders, billed on input only |
| Whisper and TTS | Whisper large-v3, Kokoro | The same open models many paid APIs use |
Treat the table as a shortlist, not a verdict. The only test that counts is your own prompts and your own scoring.
Migrating step by step
- Pick one feature, not the whole app. Summaries, tagging or search are good first candidates.
- Build a small test set: 50 to 200 real inputs with the outputs you'd accept.
- Run it on two open models and your current model, and score them side by side.
- Switch the base URL for that feature only, behind a flag, and log the
X-Inpherio-Charged-GBPheader to see cost per request. - Watch quality for a week, then move the next feature.
Because the API shape is the same, rolling back is changing the base URL back. Most teams end up with a mix: open models for the high-volume work, and a frontier model kept for the few prompts that need it.
Spend controls
Per-key budgets, daily and monthly spend caps and a maximum price per request mean a bug in a loop can't empty your balance. Caps return HTTP 429 when they're reached, and a balance that can't cover a whole reply caps the reply rather than putting you into debt.
When to stay where you are
If you need a contractual SLA, a frontier closed model for hard reasoning, image generation or invoicing, an open-model marketplace in beta isn't the right fit today. For everything open models already do well, switching is one line, and you can test it on free models first. Developers new to running models can also compare engines in our vLLM vs Ollama guide.
Questions people ask
Is it really compatible with the OpenAI SDK?
Yes. Chat completions (streaming and not), embeddings, text-to-speech and transcription use OpenAI's request and response shapes, so the official SDKs and most tools work with a changed base URL and key.
Is it cheaper than OpenAI?
Often, for tasks an open model handles well, because hosts compete on price per model. Compare the live prices on the marketplace against what you pay today for the same job.
What happens if a host goes offline mid-request?
If it fails before any reply reached you, the request moves to the next-best host and you pay once. If a stream breaks part-way, it ends with an error and that request isn't charged.
Can I use it for sensitive data?
Not on the open marketplace: hosts process prompts in plaintext on their own machines. For sensitive work, run models on your own hardware through self-serve.
Models in this post — live on Inpherio
Have a GPU, a Mac or a spare PC?
Let it earn while you sleep.
Run open models for people who need them. You set the price and keep everything but the 15% fee.
Become a hostBuilding with AI?
Every open model, one API.
OpenAI-compatible. Priced by the people who run the hardware.
Start free See the marketplaceRead “An OpenAI API alternative for open models: switch with one line” at https://inpherio.co.uk/blog/openai-api-alternative-open-models