API Overview
Review Base URLs, authentication, registered endpoints, request conventions, and response handling.
APIQIK is a model gateway. Client requests pass API key authentication and model routing first, then the matching provider adapter returns a compatible-protocol response. Model names, available capabilities, and prices are deployment-side dynamic data and should not be hard-coded in clients.
Current capability surface
By capability, the current catalog provides models in three categories:
| Capability | Endpoint |
|---|---|
| Chat / text | POST /v1/chat/completions and compatible aliases (including vision and reasoning subclasses) |
| Image generation and editing | POST /v1/images/generations, /v1/images/edits |
| Video generation | POST /v1/videos and other asynchronous task entries |
For the models actually available, use your billing page or GET /v1/models.
Base URL
Use the Base URL configured for the deployment and append the protocol prefix. <BASE_URL> below represents the deployment address.
| Protocol | Base path | Authentication |
|---|---|---|
| OpenAI-compatible | <BASE_URL>/v1 | Authorization: Bearer <API_KEY> |
| Gemini-compatible | <BASE_URL>/v1beta | x-goog-api-key, ?key=, or Bearer |
| Anthropic-compatible | <BASE_URL>/v1 | x-api-key or Bearer |
Use Content-Type: application/json for JSON request bodies. Image editing accepts both multipart/form-data and application/json. Bodyless queries and WebSocket handshakes do not require the header. Character encoding is UTF-8.
Main registered endpoints
| Capability | Method and path | Response |
|---|---|---|
| OpenAI/Anthropic/Gemini model list | GET /v1/models | Requires a valid API key; headers or query parameters select the protocol format, never the platform envelope |
| Gemini model list | GET /v1beta/models | Requires a valid API key; always returns Gemini format |
| Model-square catalog | GET /v1/public/models | Requires neither login nor an API key; returns the platform envelope (success + data.models) |
| Chat Completions | POST /v1/chat/completions, /v2/chat/completions, /api/v3/chat/completions | JSON or SSE |
| Responses | POST /v1/responses, /api/v3/responses | JSON or SSE |
| Responses WebSocket | GET /v1/responses | WebSocket JSON messages |
| Image generation | POST /v1/images/generations, /api/v3/images/generations | JSON or image stream events |
| Image editing | POST /v1/images/edits | JSON |
| Video generation | POST /v1/videos, /v1/videos/generations, /v1/video/generations | Asynchronous task JSON |
| Video status and content | GET /v1/videos/{video_id}, GET /v1/videos/{video_id}/content | JSON or redirect |
| Anthropic Messages | POST /v1/messages | JSON or SSE |
| Gemini content generation | POST /v1/models/{model}:generateContent, /v1/models/{model}:streamGenerateContent, /v1beta/models/{model}:generateContent, /v1beta/models/{model}:streamGenerateContent | JSON or SSE |
| Gemini Interactions | POST /v1beta/interactions | JSON or streaming response |
| MiniMax music and lyrics | POST /v1/music_generation, /v1/lyrics_generation | JSON |
| Generic asynchronous tasks | POST /v1/tasks, GET /v1/tasks, GET /v1/tasks/{id}, POST /v1/tasks/{id}/cancel | Asynchronous task JSON |
| DashScope native tasks | POST /api/v1/services/aigc/{service}/{operation}, GET /api/v1/tasks/{task_id} | JSON or asynchronous task JSON |
| Volcano Ark native video tasks | POST /api/v3/contents/generations/tasks, GET /api/v3/contents/generations/tasks/{task_id} | Asynchronous task JSON |
Whether some of these routes are registered depends on whether the deployment injects the corresponding task, storage, and idempotency dependencies; they cannot be called when disabled. Video routes require the provider-task publisher; generic asynchronous tasks, DashScope, and Volcano Ark tasks require their respective business dependencies.
OpenAI-compatible aliases use the corresponding protocol request body format, although native routes may adapt the response format by path. Baidu Qianfan V2 uses /v2/chat/completions. The Volcano Ark OpenAI-compatible entry points use /api/v3/chat/completions, /api/v3/responses, and /api/v3/images/generations. The three video paths use the same asynchronous submission handler.
Common request headers
| Header | Required | Description |
|---|---|---|
Authorization | Depends on the endpoint | Bearer-protected endpoints use Bearer <API_KEY>. The gateway also accepts a bare sk-... credential where Bearer authentication is used. |
Content-Type | Depends on the request body | Use application/json for JSON requests; image editing accepts both formats. Query endpoints and the WebSocket handshake normally have no request body. |
X-Request-Id | No | A valid value is propagated. If it is missing or invalid, the gateway generates one and returns it in the response. |
Protocol-specific authentication rules are:
- OpenAI-compatible routes normally use
Authorization: Bearer <API_KEY>. - Anthropic-compatible routes accept
x-api-keyorAuthorization: Bearer <API_KEY>. ForGET /v1/models, a non-emptyanthropic-versionheader or the presence of anx-api-keyheader selects the Anthropic response format. - Gemini-compatible routes accept the
keyquery parameter,x-goog-api-key, orAuthorization: Bearer <API_KEY>.
GET /v1/models and GET /v1beta/models return 401 for missing or invalid API keys. The public model-square list uses /v1/public/models; credential presence does not switch routes.
Never expose API keys in browsers, mobile apps, or public repositories.
Request and response principles
- Use model IDs from the corresponding protocol's model-list endpoint or the current console catalog.
- Optional parameters for chat, images, and other endpoints depend on the target model; the gateway does not guarantee identical support across models.
- Tolerate added response fields and branch on HTTP status and structured error fields rather than error-message text.
- Parse HTTP streams as SSE events, not TCP packets, and WebSocket responses by message boundaries.
- Retain the HTTP status, response
X-Request-Id, model ID, and request time for diagnostics.
Where to call from
Send requests from a trusted backend. Keep API keys, prompts that contain sensitive data, and provider credentials out of browser code and diagnostic logs.
Unregistered endpoints
The current route table does not register OpenAI-style /v1/files or /v1/batches. Their pages describe planning boundaries, not callable endpoints.