Skip to content
Documentation menu

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

MethodPathPurpose
POST/chat/completionsChat completion, with optional streaming
GET/modelsRouting modes and model ids available in your region

Main request fields

FieldNotes
modelauto (default), auto:cost, auto:quality, or a model id
messagesRequired. Roles: system, developer, user, assistant, tool
streamServer-sent events. Use it for long answers
toolsFunction tools with a JSON Schema parameters
response_format{"type": "json_object"} or {"type": "json_schema", ...}
nOnly 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

HeaderMeaning
x-request-idRequest id. Quote it to support
x-acg-modelThe model that answered
x-acg-strategyrouted (gateway chose) or pinned (you named the model)
x-acg-modecost, balanced or quality
x-acg-catalog-versionModel catalog version used for the choice

Limits

LimitValue
Time to first byte, and between bytes60 seconds. Stream long answers
Longest streaming request15 minutes
Key and subscription changesApply within 60 seconds

Common errors

Errors use the OpenAI error envelope, so SDKs raise their usual exceptions. Match on code.

StatuscodeFix
400no_eligible_modelTrim the input, or enable more models
401invalid_api_keyKey wrong or revoked. Create a new one
403subscription_inactiveSubscription pending, cancelled or expired
403bedrock_not_connectedConnect your AWS account
403bedrock_model_not_enabledEnable the named models
403budget_exceededA monthly budget is reached
404model_not_foundUse an id from GET /models
429bedrock_throttledRetry with backoff, or raise your Bedrock quotas
502bedrock_errorRetry
503budget_unavailableRetry. Your budget could not be checked

Full guide, with every field and error code: api-reference.md on GitHub