Quickstart
CLF AI Gateway is an OpenAI-compatible API for DeepSeek V4 (1M context), Kimi and GLM models, prepaid and billed per token. If your code already talks to the OpenAI API, the only change is the base URL and the key.
1. Create an account and an API key
Sign up (no credit card required), then create a key on the API keys page of the dashboard. Keys start with sk-gw- and are shown in full exactly once — we store only a hash. Details: Authentication.
2. Top up credits
The gateway is prepaid: requests draw from a credit balance. Top up in the dashboard — Vietnamese bank transfer via VietQR is confirmed automatically (typically within seconds), and international cards are accepted. How each request is priced: Billing.
3. Point your SDK at the gateway
Base URL for every request:
https://api.clfaigateway.dev/v1
Authenticate with the standard header Authorization: Bearer sk-gw-... and use any model id from GET /v1/models (the live list with prices is on the models page).
curl https://api.clfaigateway.dev/v1/chat/completions \
-H "Authorization: Bearer sk-gw-..." \
-H "Content-Type: application/json" \
-d '{
"model": "kimi-k2.6",
"messages": [{"role": "user", "content": "Hello!"}],
"max_tokens": 256
}'Streaming, tool calling and JSON mode work through the same endpoint — see Streaming for server-sent events and mid-stream error handling.
All endpoints
| Endpoint | Scope | What it does |
|---|---|---|
POST /v1/chat/completions | chat | OpenAI-compatible inference — streaming and non-streaming. |
GET /v1/models | any valid key | The models your key can call, with pricing and capabilities. |
GET /v1/models/{id} | any valid key | One model by id — canonical name or enabled alias. |
GET /v1/credits | usage:read | Current balance and active credit grants. |
GET /v1/generation?id= | usage:read | Cost and token detail of one request after it settles. |
GET /v1/usage | usage:read | Aggregated usage per hour or day, filterable by model. |
Every response carries x-request-id — keep it: it is the lookup key for GET /v1/generation and for support. Error handling across all endpoints uses one envelope, listed in Errors.
Model lifecycle
Model names you call (like kimi-k2.6) are our stable identifiers, decoupled from the upstream IDs behind them. Upstream models in this space are retired fast — sometimes within months. Our policy:
- Names keep working: when an upstream model is deprecated, we remap the name to the closest successor ourselves — deliberately, with pricing reviewed first, never silently inherited.
- You hear about it first: model changes and their pricing are announced on the blog and the models page before they take effect. Prices never change retroactively.
- What is answering is public: the exact upstream ID currently serving each name is listed on
GET /v1/modelsascf_model_id, and in your request log per call.