API Documentation
OpenAI-compatible. Call any model in 3 steps.
Call any model with one Base URL
Point your OpenAI-compatible client or SDK directly at this gateway. Use the unified Base URL below with an API key generated from this dashboard to securely proxy LLM requests.
https://your-domain.com/v1Authorization: Bearer YOUR_API_KEYQuick Start Guide
Get from zero to your first request in three steps.
Create a token in the API Keys tab. Treat this key like a password — it allows authorization for all downstream models.
Choose from the enabled models in your group. Clicking a model tag updates the snippets below automatically.
Chat Completions
/v1/chat/completionsReplace $YOUR_API_KEY with the token you generated, select a language tab, and execute the call.
curl https://your-domain.com/v1/chat/completions \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $YOUR_API_KEY" \
-d '{
"model": "gpt-4o-mini",
"messages": [
{"role": "system", "content": "You are a helpful assistant."},
{"role": "user", "content": "Hello!"}
]
}'Streaming responses
Set "stream": true in the payload request to stream token completions instantly using Server-Sent Events (SSE).
curl https://your-domain.com/v1/chat/completions \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $YOUR_API_KEY" \
-d '{
"model": "gpt-4o-mini",
"stream": true,
"messages": [
{"role": "user", "content": "Stream a short greeting."}
]
}'Embeddings
/v1/embeddingsCalculate embedding vectors for text inputs using standard compatible formats.
curl https://your-domain.com/v1/embeddings \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $YOUR_API_KEY" \
-d '{
"model": "text-embedding-3-small",
"input": "The quick brown fox"
}'Tạo hình ảnh
/v1/images/generationsGenerate images from text descriptions using the DALL-E compatible endpoint.
curl https://your-domain.com/v1/images/generations \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $YOUR_API_KEY" \
-d '{
"model": "gpt-image-1",
"prompt": "a cat reading a book, watercolor",
"size": "1024x1024"
}'Submit standard JSON parameters including size, response format, and model fields to customize generation output.
Common Errors
Errors match the standard OpenAI error format, allowing integrations with existing SDKs to handle exceptions smoothly.
| Trạng thái | Meaning | How to fix |
|---|---|---|
| 401 | Invalid API key | Check the Authorization header format and confirm key is active. |
| 402 | Insufficient balance | Top up your wallet balance or check active credit limits. |
| 404 | Không tìm thấy mô hình | Ensure model name is correct, active, and accessible to your user group. |
| 429 | Rate limited | Slow down requests rate, or contact the admin to request high limits. |
| 5xx | Upstream error | The provider/upstream service is down. Retry with exponential backoff. |
IDE & CLI Integrations
Point your coding agent at this gateway. Pick a tool for step-by-step setup.
