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.

OpenAI compatibleRESTStreaming
URL cơ sở
https://your-domain.com/v1
Authorization header
Authorization: Bearer YOUR_API_KEY
System health
Live status of the gateway and upstream services.
Gateway
Checking…
Pinging base URL…
Down
Version
your-domain.com/v1
Thời gian hoạt động
Không rõ
Status endpoint
Reachable
GET /api/status

Quick Start Guide

Get from zero to your first request in three steps.

1. Get an API key

Create a token in the API Keys tab. Treat this key like a password — it allows authorization for all downstream models.

2. Pick a model

Choose from the enabled models in your group. Clicking a model tag updates the snippets below automatically.

Browse all models →

Chat Completions

POST/v1/chat/completions

Replace $YOUR_API_KEY with the token you generated, select a language tab, and execute the call.

chat-completions.sh
bash
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).

stream-completions.sh
bash
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

POST/v1/embeddings

Calculate embedding vectors for text inputs using standard compatible formats.

embeddings.sh
bash
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

POST/v1/images/generations

Generate images from text descriptions using the DALL-E compatible endpoint.

image-generation.sh
bash
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áiMeaningHow to fix
401Invalid API keyCheck the Authorization header format and confirm key is active.
402Insufficient balanceTop up your wallet balance or check active credit limits.
404Không tìm thấy mô hìnhEnsure model name is correct, active, and accessible to your user group.
429Rate limitedSlow down requests rate, or contact the admin to request high limits.
5xxUpstream errorThe 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.

Next Steps