API reference
Base URL: https://api.aicloudgateway.com/v1. The API follows the OpenAI Chat Completions
format; fields that do not apply are ignored, not rejected. Authenticate with
Authorization: Bearer acg_... (see API keys).
Endpoints
| Method | Path | Purpose |
|---|---|---|
POST | /chat/completions | Chat completion, with optional streaming |
GET | /models | Routing modes and model ids available in your region |
Main request fields
| Field | Notes |
|---|---|
model | auto (default), auto:cost, auto:quality, or a model id |
messages | Required. Roles: system, developer, user, assistant, tool |
stream | Server-sent events. Use it for long answers |
tools | Function tools with a JSON Schema parameters |
response_format | {"type": "json_object"} or {"type": "json_schema", ...} |
n | Only 1 |
Images must be base64 data URLs (png, jpeg, gif, webp); web URLs are not fetched. The
response's model field is the model that answered.
Response headers
| Header | Meaning |
|---|---|
x-request-id | Request id. Quote it to support |
x-acg-model | The model that answered |
x-acg-strategy | routed (gateway chose) or pinned (you named the model) |
x-acg-mode | cost, balanced or quality |
x-acg-catalog-version | Model catalog version used for the choice |
Limits
| Limit | Value |
|---|---|
| Time to first byte, and between bytes | 60 seconds. Stream long answers |
| Longest streaming request | 15 minutes |
| Key and subscription changes | Apply within 60 seconds |
Common errors
Errors use the OpenAI error envelope, so SDKs raise their usual exceptions. Match on code.
| Status | code | Fix |
|---|---|---|
| 400 | no_eligible_model | Trim the input, or enable more models |
| 401 | invalid_api_key | Key wrong or revoked. Create a new one |
| 403 | subscription_inactive | Subscription pending, cancelled or expired |
| 403 | bedrock_not_connected | Connect your AWS account |
| 403 | bedrock_model_not_enabled | Enable the named models |
| 403 | budget_exceeded | A monthly budget is reached |
| 404 | model_not_found | Use an id from GET /models |
| 429 | bedrock_throttled | Retry with backoff, or raise your Bedrock quotas |
| 502 | bedrock_error | Retry |
| 503 | budget_unavailable | Retry. Your budget could not be checked |
Full guide, with every field and error code: api-reference.md on GitHub