Free credit to start. Top up from $5. Create a key
OSMEXOAI Model Exchange
How it works

One API key. Every major model. Same code.

OSMEXO speaks the OpenAI API. Keep the SDK and prompts you already have, point them at OSMEXO, and call GPT, Claude, Gemini, DeepSeek, Qwen, Kimi or GLM by changing one string. Each request is billed below the vendor’s list price.

  1. 01

    Create an account

    Sign up with Google or email. New accounts get free credit, so you can test before you pay.

  2. 02

    Create an API key

    In the dashboard, open API keys and create one. It starts with sk-llm- and is shown once, so store it as OSMEXO_API_KEY.

  3. 03

    Point your code at OSMEXO

    Keep the OpenAI SDK you already use. Change the base URL and the key, and write model ids as vendor/model.

  4. 04

    Call any model, see the cost

    Switch between GPT, Claude, Gemini, DeepSeek, Qwen, Kimi and GLM by changing one string. Every request shows its cost and the saving against list price.

Integration

Three lines change. Nothing else.

Requests, responses, streaming, tool calling and JSON output keep the OpenAI format, so your prompts and parsing stay as they are.

SettingBeforeOn OSMEXO
Base URLhttps://api.openai.com/v1https://api.osmexo.com/v1
API keysk-… (vendor key)sk-llm-… (OSMEXO key)
Model idgpt-5.4-miniopenai/gpt-5.4-mini

SDKs

  • OpenAI Python
  • OpenAI Node.js
  • any OpenAI-compatible client
  • plain HTTP

Frameworks

  • LangChain
  • LlamaIndex
  • Vercel AI SDK
  • LiteLLM

Coding agents

  • Cline
  • Roo Code
  • OpenCode
  • Aider
  • Continue
python · openai sdk
import os
from openai import OpenAI

client = OpenAI(
    base_url="https://api.osmexo.com/v1",
    api_key=os.environ["OSMEXO_API_KEY"],
)

# Any model: "anthropic/claude-sonnet-5", "deepseek/deepseek-v4.1-flash-1017", ...
resp = client.chat.completions.create(
    model="openai/gpt-5.4-mini",
    messages=[{"role": "user", "content": "Summarise this: ..."}],
)
print(resp.choices[0].message.content)
Model ids

Switch models by changing one string.

Every id is vendor/model. Start with one of these, or browse all models with their prices.

Credits and errors

Prepaid credits, clear errors.

Top up from $5 by PayPal or Visa/Mastercard. No subscription, credits never expire, and the dashboard shows what every request cost. Errors use the OpenAI format, so your SDK’s error handling keeps working.

HTTPMeaningWhat to do
400Invalid request (bad parameter or JSON)Fix the request
401Missing, wrong or revoked API keyCheck OSMEXO_API_KEY
402Out of credit, or a key budget or spending limit reachedTop up in the dashboard; do not retry
403The key may not use this model or call from this IPCheck the key settings
404Unknown model idCheck the id with GET /v1/models
429Rate limitedWait for Retry-After, then retry
5xxTemporary problem on our side or the model’sRetry with backoff

Failed requests are never billed.

For AI coding assistants

Let Claude, ChatGPT or Cursor do the switch.

Copy this guide and paste it into your assistant with: “Switch the LLM calls in this project to OSMEXO using this guide.” It covers the settings, code for Python, Node.js and frameworks, model ids and error handling.

Open as Markdown
Preview the guide
# OSMEXO integration guide

> For AI coding assistants (Claude, ChatGPT, Codex, Cursor and others). Task: switch this project's LLM calls to OSMEXO.

## What OSMEXO is

OSMEXO is an OpenAI-compatible API for many AI models: GPT, Claude, Gemini, DeepSeek, Qwen, Kimi, GLM and more. One API key works for all of them, and each request is billed below the model vendor's list price (prepaid credits, pay as you go). Code that uses the OpenAI SDK or any OpenAI-compatible client only needs a configuration change.

## The three things that change

| Setting | Before | After |
|---|---|---|
| Base URL | `https://api.openai.com/v1` | `https://api.osmexo.com/v1` |
| API key | `sk-…  (vendor key)` | `sk-llm-…  (OSMEXO key)` |
| Model id | `gpt-5.4-mini` | `openai/gpt-5.4-mini` |

Everything else stays the same: request and response bodies, streaming (SSE ending with `data: [DONE]`), tool calling (`tools`, `tool_choice`, `tool_calls`), `response_format` (JSON mode and JSON schema), `temperature`, `max_tokens`, `stop`, `seed`.

## Steps for the assistant

1. Find every place the project creates an OpenAI (or OpenAI-compatible) client or calls a chat/completions API.
2. Point the client at `https://api.osmexo.com/v1` and read the key from the environment variable `OSMEXO_API_KEY`. Never hard-code the key.
3. Add the vendor prefix to every model id (`gpt-5.4-mini` → `openai/gpt-5.4-mini`). Keep model ids in configuration.
4. Leave prompts, message formats, tool definitions and response parsing unchanged.
5. Treat HTTP 402 (out of credit) as "top up your OSMEXO balance": log or show it clearly and do not retry.
6. Retry 429 and 5xx with backoff, honouring the `Retry-After` header.
7. Add `OSMEXO_API_KEY=` to `.env.example` and mention it in the README.

## Python

```python
import os
from openai import OpenAI

client = OpenAI(
    base_url="https://api.osmexo.com/v1",
    api_key=os.environ["OSMEXO_API_KEY"],
)

# Any model: "anthropic/claude-sonnet-5", "deepseek/deepseek-v4.1-flash-1017", ...
resp = client.chat.completions.create(
    model="openai/gpt-5.4-mini",
    messages=[{"role": "user", "content": "Summarise this: ..."}],
)
print(resp.choices[0].message.content)
```

## TypeScript / Node.js

```typescript
import OpenAI from "openai";

const client = new OpenAI({
  baseURL: "https://api.osmexo.com/v1",
  apiKey: process.env.OSMEXO_API_KEY,
});

const resp = await client.chat.completions.create({
  model: "openai/gpt-5.4-mini",
  messages: [{ role: "user", content: "Hello" }],
});
console.log(resp.choices[0].message.content);
```

## Streaming (Python)

```python
stream = client.chat.completions.create(
    model="deepseek/deepseek-v4.1-flash-1017",
    messages=[{"role": "user", "content": "Write a haiku about budgets."}],
    stream=True,
)
for chunk in stream:
    print(chunk.choices[0].delta.content or "", end="")
```

## curl

```bash
curl https://api.osmexo.com/v1/chat/completions \
  -H "Authorization: Bearer $OSMEXO_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"model":"openai/gpt-5.4-mini","messages":[{"role":"user","content":"Hello"}]}'
```

## Without changing code

```bash
# Most OpenAI SDKs read these, so no code change is needed
# (only add the vendor/ prefix to your model ids)
export OPENAI_BASE_URL="https://api.osmexo.com/v1"
export OPENAI_API_KEY="sk-llm-..."
```

## Frameworks

LangChain, LlamaIndex, Vercel AI SDK, LiteLLM and similar: use their OpenAI or "OpenAI-compatible" provider with the base URL and key above. LangChain example:

```python
from langchain_openai import ChatOpenAI
llm = ChatOpenAI(base_url="https://api.osmexo.com/v1", api_key=os.environ["OSMEXO_API_KEY"], model="openai/gpt-5.4-mini")
```

## Coding agents

```text
# Cline, Roo Code, OpenCode, Aider, Continue:
# choose the "OpenAI compatible" provider and set
Base URL:  https://api.osmexo.com/v1
API key:   your OSMEXO key (sk-llm-...)
Model:     deepseek/deepseek-v4.1-flash-1017   # or anthropic/claude-sonnet-5
```

## Model ids

Ids are `vendor/model`. Examples:

| Use | Model ids |
|---|---|
| Fast, cheap everyday tasks: summaries, extraction, classification | `openai/gpt-5.4-mini`, `google/gemini-3-5-flash-lite`, `deepseek/deepseek-v4.1-flash-1017` |
| Strong general reasoning | `openai/gpt-5.5`, `anthropic/claude-sonnet-5`, `google/gemini-3.1-pro` |
| The hardest problems | `anthropic/claude-opus-5.5` |
| Coding and agents | `deepseek/deepseek-v4.1-flash-1017`, `z-ai/glm-5.3`, `qwen/qwen3-coder-next` |

All models and prices: https://osmexo.com/models. List for your key: `curl https://api.osmexo.com/v1/models -H "Authorization: Bearer $OSMEXO_API_KEY"`

## Errors

Errors use the OpenAI error shape, so OpenAI SDK error classes work as usual:

```json
{ "error": { "type": "quota_error", "code": "insufficient_credits", "message": "...", "request_id": "req_..." } }
```

| HTTP | Meaning | What to do |
|---|---|---|
| 400 | Invalid request (bad parameter or JSON) | Fix the request |
| 401 | Missing, wrong or revoked API key | Check OSMEXO_API_KEY |
| 402 | Out of credit, or a key budget or spending limit reached | Top up in the dashboard; do not retry |
| 403 | The key may not use this model or call from this IP | Check the key settings |
| 404 | Unknown model id | Check the id with GET /v1/models |
| 429 | Rate limited | Wait for Retry-After, then retry |
| 5xx | Temporary problem on our side or the model’s | Retry with backoff |

Failed requests are never billed. Quote `request_id` (also in the `X-Request-Id` header) when contacting support.

## Account and billing

- Sign up and create a key: https://dashboard.osmexo.com/signup (new accounts get free credit).
- Prepaid credits from $5 by PayPal or Visa/Mastercard; no subscription; credits never expire.
- The dashboard shows every request with its cost and the saving against the vendor's list price.
- Documentation: https://docs.osmexo.com
- This guide as a web page: https://osmexo.com/how-it-works
FAQ

Questions developers ask.

Do I need to rewrite my code?

No. If you use the OpenAI SDK or any OpenAI-compatible client, you change the base URL, the API key and the model ids. Prompts, messages, tools and response parsing stay the same.

Which features work?

Chat completions, streaming, tool calling, JSON mode and JSON schema output, images, speech and transcription, using the same request and response format as OpenAI.

How do I find the model ids?

Every id is vendor/model, for example openai/gpt-5.4-mini or anthropic/claude-sonnet-5. The models page lists them all with prices, and GET https://api.osmexo.com/v1/models returns the list for your key.

How do I pay?

Prepaid credits, no subscription. Top up from $5 by PayPal or Visa/Mastercard. Credits never expire, and the dashboard shows the cost of every request.

What happens when my credit runs out?

Requests return HTTP 402 with the code insufficient_credits. Top up in the dashboard and the same key works again right away. Failed requests are never billed.

Can my AI coding assistant set this up?

Yes. Copy the guide on this page (or give it the link to /how-it-works.md) and ask Claude, ChatGPT, Codex or Cursor to switch your project’s LLM calls to OSMEXO.

Start in five minutes

Same models. Same code. Smaller bill.

Create a key, change the base URL, and see on the very first response what you saved.

  • Free credit to start
  • Top up from $5
  • No subscription