APAI for Pros

API reference

Three endpoints. OpenAI-compatible JSON.

OpenAPI JSON
POST/v1/chat/completions

Create a streaming or non-streaming chat completion.

POST/v1/images/generations

Generate an image with an enabled model.

GET/v1/models

List the models available to the current key.

Error object

Every gateway error contains a message, type, and stable code.

{
  "error": {
    "message": "The concurrent request limit was reached.",
    "type": "gateway_error",
    "code": "concurrency_limit_exceeded"
  }
}