Chat Completions
Create chat answers with streaming, tools and image input.
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.
The samples use this site's real API address. Replace YOUR_API_KEY with a key you create in your panel.
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);
The main endpoints use OpenAI's request and response format. The full list of endpoints and parameters is in the documentation.
Create chat answers with streaming, tools and image input.
Create text vectors for semantic search and RAG systems.
GET /models returns the public catalog without a key, and only the models that key may use when you send one.
POST /cost/estimate returns the most a request could cost, without calling the model and without charging your wallet.
Text to speech, speech to text and video generation through separate endpoints.
Errors come back in an error object with message, type and code, so clients can handle them easily.
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.
Point your client's base address at this site's API address.
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.
Copy the ID of the model you want from the models page and use it as the model parameter.
Instead of managing a separate key and account for every provider, you work with one base URL and one wallet.
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.
Set spend limit, expiry, allowed IPs, allowed models and rate limit separately for every key.
Tokens, cost, latency and status are recorded so you always know where your balance went.
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.
Yes, the chat endpoint supports streaming, tools and image input. Whether a feature is available also depends on the model itself.
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.
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.
Yes. Every key has its own spend limit, expiry date, allowed IPs, allowed models and rate limit.
Your panel records the model, tokens, cost, duration and status of every request, and reports are available with charts and filters.
Create a key, change the base URL and send your first request.