Skip to main content

Entry points

Use the base URL for your SDK or client. Do not add paths from another API format.
Use caseBase URLCommon endpoint
OpenAI SDK / OpenAI-compatible toolshttps://api.aiohub.org/v1POST /chat/completions
Codex CLIhttps://api.aiohub.org/v1POST /responses
Anthropic SDK / Claude Codehttps://api.aiohub.orgPOST /v1/messages
Gemini CLIhttps://api.aiohub.orgPOST /v1beta/models/{model}:generateContent
Gemini REST / Google SDKhttps://api.aiohub.org/v1betaPOST /models/{model}:generateContent
Console dashboardhttps://api.aiohub.org/consoleAccount overview
API key managementhttps://api.aiohub.org/console/tokenCreate and manage API keys
Wallet managementhttps://api.aiohub.org/console/topupBalance, add funds, and payment history
Usage logshttps://api.aiohub.org/console/logUsage records and costs

Supported API formats

FormatEndpointUse case
OpenAI compatiblePOST /v1/chat/completionsDefault for most SDKs and tools
OpenAI ResponsesPOST /v1/responsesCodex CLI and clients using the Responses API
Claude MessagesPOST /v1/messagesClaude Code and Anthropic SDK
Gemini APIPOST /v1beta/models/{model}:generateContentGemini CLI and Google SDK
If you are unsure which format to use, start with OpenAI Chat Completions for a basic chat request. Codex CLI uses Responses, not Chat Completions.

Authentication

AIOHub API keys start with sk-. Different clients use different headers with the same API key value:
MethodHeaderClient
Bearer authAuthorization: Bearer sk-xxxOpenAI SDK, Codex CLI, most tools
Anthropic API Keyx-api-key: sk-xxxAnthropic SDK
Anthropic bearer authAuthorization: Bearer sk-xxxClaude Code (ANTHROPIC_AUTH_TOKEN)
Google API Keyx-goog-api-key: sk-xxx or key=sk-xxxGemini CLI, Google SDK
See Authentication for examples.

Request example

curl https://api.aiohub.org/v1/chat/completions \
  -H "Authorization: Bearer sk-your-api-key" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "gpt-4o",
    "messages": [{"role": "user", "content": "Hello!"}]
  }'

Response shape

Successful responses follow the selected compatible API format. For example, an OpenAI Chat Completions response looks like:
{
  "id": "chatcmpl-xxx",
  "object": "chat.completion",
  "model": "gpt-4o",
  "choices": [
    {
      "index": 0,
      "message": {
        "role": "assistant",
        "content": "Hello! How can I help you?"
      },
      "finish_reason": "stop"
    }
  ],
  "usage": {
    "prompt_tokens": 10,
    "completion_tokens": 12,
    "total_tokens": 22
  }
}

Streaming responses

Chat Completions supports SSE streaming. Set "stream": true:
curl https://api.aiohub.org/v1/chat/completions \
  -H "Authorization: Bearer sk-your-api-key" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "gpt-4o",
    "messages": [{"role": "user", "content": "Hello!"}],
    "stream": true
  }'

Error responses

Error responses include an HTTP status code and a JSON error body:
{
  "error": {
    "message": "Incorrect API key provided",
    "type": "authentication_error",
    "code": "invalid_api_key"
  }
}
See HTTP status codes for common status codes and retry guidance.

Public endpoint scope

The API reference navigation lists the main user-facing endpoints. Available models, groups assigned to your API key, and endpoints depend on /v1/models, the console pricing page, and the current service state. Unlisted compatibility routes are not officially supported.