OpenAI-compatible

OpenAI-compatible API: switch by changing the base URL

If your app works with the OpenAI SDK or any OpenAI-compatible client, connecting to GPT, Claude, Gemini and other models takes just three changes: the base URL, the API key and the model name.

  • 0Active models
  • 0Model providers
  • 0Free models

Quick start with code samples

The samples use this site's real API address. Replace YOUR_API_KEY with a key you create in your panel.

Base URL https://apiex.cloud/api/v1/
curl https://apiex.cloud/api/v1/chat/completions \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "openai/gpt-5.6-terra-pro",
    "messages": [
      { "role": "user", "content": "Hello!" }
    ]
  }'
from openai import OpenAI

client = OpenAI(
    base_url="https://apiex.cloud/api/v1/",
    api_key="YOUR_API_KEY",
)

response = client.chat.completions.create(
    model="openai/gpt-5.6-terra-pro",
    messages=[{"role": "user", "content": "Hello!"}],
)

print(response.choices[0].message.content)
import OpenAI from "openai";

const client = new OpenAI({
  baseURL: "https://apiex.cloud/api/v1/",
  apiKey: "YOUR_API_KEY",
});

const response = await client.chat.completions.create({
  model: "openai/gpt-5.6-terra-pro",
  messages: [{ role: "user", content: "Hello!" }],
});

console.log(response.choices[0].message.content);

What is supported

The main endpoints use OpenAI's request and response format. The full list of endpoints and parameters is in the documentation.

Chat Completions

Create chat answers with streaming, tools and image input.

Embeddings

Create text vectors for semantic search and RAG systems.

Model list

GET /models returns the public catalog without a key, and only the models that key may use when you send one.

Cost estimate

POST /cost/estimate returns the most a request could cost, without calling the model and without charging your wallet.

Audio and video

Text to speech, speech to text and video generation through separate endpoints.

Standard errors

Errors come back in an error object with message, type and code, so clients can handle them easily.

Connect your tools and libraries

Any tool that lets you set a custom base URL and API key connects with these same three values. The OpenAI Python and Node.js SDKs, LangChain, LlamaIndex, n8n, Open WebUI and Continue, for example, offer such a setting; field names differ slightly between tools.

Base URL https://apiex.cloud/api/v1/
API Key A key starting with apx- that you create in your panel
Model The public model ID from the models page, for example openai/gpt-5.6-terra-pro

Migrate in three steps

  1. 1

    Change the base URL

    Point your client's base address at this site's API address.

  2. 2

    Create an API key

    Create a new key in your panel under Keys. Each key can have its own spend limit, expiry, IP allow-list, model allow-list and rate limit.

  3. 3

    Choose a model

    Copy the ID of the model you want from the models page and use it as the model parameter.

Why use a single gateway

One key, many models

Instead of managing a separate key and account for every provider, you work with one base URL and one wallet.

Automatic failover

Several services can back one model. A failed request moves to the next service, and services that keep failing are set aside for a while.

Control over cost and access

Set spend limit, expiry, allowed IPs, allowed models and rate limit separately for every key.

A report for every request

Tokens, cost, latency and status are recorded so you always know where your balance went.

Frequently asked questions

Is this API exactly the same as OpenAI's?

The main endpoints (chat, embeddings, audio and video) follow OpenAI's request and response format, but not every OpenAI endpoint and parameter is supported. The exact list is in the documentation.

Are streaming and function calling supported?

Yes, the chat endpoint supports streaming, tools and image input. Whether a feature is available also depends on the model itself.

Where do I get model names?

From the models page or with GET /models. Each model's public ID is shown next to its name and can be copied with one click.

What happens if one service fails?

If several services are set up for that model, the failed request automatically moves to the next one. Errors also come back in a standard structure so your client can handle them.

Can I create a separate, limited key for each project?

Yes. Every key has its own spend limit, expiry date, allowed IPs, allowed models and rate limit.

Where can I see usage and cost?

Your panel records the model, tokens, cost, duration and status of every request, and reports are available with charts and filters.

Keep exploring

Connect to GPT, Claude and Gemini today

Create a key, change the base URL and send your first request.