OpenAI-compatible API
Works with the Chat Completions API and any OpenAI SDK — point the base URL at apixly.ai and use your apixly key. Requires a key bound to an OpenAI group.
Environment variables
Most OpenAI SDKs and tools pick these up automatically:
export OPENAI_BASE_URL="https://apixly.ai/v1"
export OPENAI_API_KEY="YOUR_API_KEY"Chat completions
| Field | Meaning |
|---|---|
| choices[0].message.content | The assistant's reply text |
| finish_reason | stop = finished normally; length = truncated by the max_tokens limit |
| usage | Prompt / completion token counts — the basis for billing |
curl https://apixly.ai/v1/chat/completions \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "gpt-5.5",
"messages": [{"role": "user", "content": "Hello"}]
}'{
"choices": [
{
"message": { "role": "assistant", "content": "Hello! How can I help?" },
"finish_reason": "stop"
}
],
"usage": {
"prompt_tokens": 9,
"completion_tokens": 12,
"total_tokens": 21
}
}Add "stream": true to receive server-sent events, exactly like the official API.
Official SDK
Only the base_url changes — everything else is standard OpenAI SDK usage:
from openai import OpenAI
client = OpenAI(
base_url="https://apixly.ai/v1",
api_key="YOUR_API_KEY",
)
resp = client.chat.completions.create(
model="gpt-5.5",
messages=[{"role": "user", "content": "Hello"}],
)
print(resp.choices[0].message.content)Image generation
POST to the Images API; the result comes back as base64 image data under data[].b64_json.
curl https://apixly.ai/v1/images/generations \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "gpt-image-2",
"prompt": "A cat astronaut floating in space, digital art",
"size": "1024x1024"
}'{
"created": 1782500000,
"data": [{ "b64_json": "<BASE64_IMAGE_DATA>" }]
}Image editing
Edit an existing image: POST multipart/form-data with the source image and a text prompt.
curl https://apixly.ai/v1/images/edits \
-H "Authorization: Bearer YOUR_API_KEY" \
-F model="gpt-image-2" \
-F image="@photo.png" \
-F prompt="Add a wizard hat and a soft magical glow" \
-F size="1024x1024"{
"created": 1782500000,
"data": [{ "b64_json": "<BASE64_IMAGE_DATA>" }]
}Responses API
POST /v1/responses: model, input and optional instructions; stream=true uses SSE. Use a model/group with Responses support. Chat Completions support alone does not guarantee Responses support. GET /v1/responses is a WebSocket upgrade route, not a stored-response listing.
POST /v1/responses/compact and POST /v1/responses/input_tokens are upstream-dependent Responses extensions. The gateway forwards only safe /v1/responses/*subpath segments; path registration does not guarantee the upstream implements that operation. Use final response usage for billing.
curl https://apixly.ai/v1/responses \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"model":"YOUR_RESPONSES_MODEL","instructions":"Answer briefly.","input":"Hello","stream":true}'
# Read SSE through a terminal response event, including usage.Model-specific request contracts
Discover available IDs with GET /v1/models using your key. The public price catalog is not a guarantee of current routing. Existing valid requests need no changes; optional fields are model-specific.
POST /v1/chat/completions: model + messages; stream=true uses SSE. Tools, JSON schema, image/PDF inputs and reasoning support depend on the selected model and route; text availability alone does not enable them.
gpt-6.1-sol: Responses reasoning.effort (Chat: reasoning_effort) accepts low/medium/high/xhigh/max/ultra. none/minimal and thinking.type=disabled are rejected before upstream execution. temperature/top_p are removed for this model; do not use them as sampling controls. Other GPT models have their own supported effort set.
| Model | Request contract |
|---|---|
| MiniMax-M2.7 · deepseek-v4-flash · deepseek-v4-pro · deepseek-v4.1-flash · glm-4.5-flash · glm-5.1 · glm-5.2 · glm-5.3 · glm-5.3-flash · gpt-5.4 · gpt-5.4-mini · gpt-5.5 · gpt-5.6-sol · gpt-5.6-terra · gpt-6-astra · gpt-6-sol · gpt-6.1-sol · grok-4.5 · grok-4.6 · grok-4.7 · kimi-k2.7-code · kimi-k3 · minimax-m3 · qwen3.7-max · qwen3.7-plus · qwen3.8-flash · qwen3.8-max | POST /v1/chat/completions · model/messages · GET /v1/models |