AIPass Hub Docs
Global AI API Access Platform
Global AI API Gateway

AIPass Hub API Documentation

AIPass Hub provides a unified AI API access platform for developers, teams, businesses, and partners. You can connect to multiple AI models through one API gateway, manage keys, track usage, and control balance from a single dashboard.

Base API URL: https://api.aipasshub.cloud/v1

OpenAI-CompatibleAnthropic-CompatibleImage GenerationVideo GenerationDeveloper Tools

1. API Overview

This document is a ready-to-publish English API guide for AIPass Hub. It covers common usage flows including chat completions, Anthropic-style messages, image generation, video generation, CLI tools, error handling, rate limits, and support contacts.

OpenAI-Compatible API

Use OpenAI SDKs and apps by setting the base URL to AIPass Hub.

/v1/chat/completions
Anthropic-Compatible API

Use Claude-style tools and messages with compatible endpoints.

/v1/messages
Image API

Create images and visual content with supported image models.

/v1/images/generations
Video API

Generate short videos where supported by your account and model channels.

/v1/video/generations

2. Quick Start

  1. Create an AIPass Hub account.
  2. Recharge your account or request activation from support.
  3. Generate an API key from the dashboard.
  4. Choose the model and API format you want to use.
  5. Send a test request and check your usage logs.

cURL Test

curl https://api.aipasshub.cloud/v1/chat/completions \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -d '{
    "model": "gpt-5",
    "messages": [
      {"role": "user", "content": "Hello, AIPass Hub!"}
    ],
    "stream": false
  }'

Python Example

from openai import OpenAI

client = OpenAI(
    api_key="YOUR_API_KEY",
    base_url="https://api.aipasshub.cloud/v1"
)

response = client.chat.completions.create(
    model="gpt-5",
    messages=[
        {"role": "system", "content": "You are a helpful AI assistant."},
        {"role": "user", "content": "Write a short introduction to AIPass Hub."}
    ]
)

print(response.choices[0].message.content)

Node.js Example

import OpenAI from "openai";

const client = new OpenAI({
  apiKey: "YOUR_API_KEY",
  baseURL: "https://api.aipasshub.cloud/v1"
});

const response = await client.chat.completions.create({
  model: "gpt-5",
  messages: [
    { role: "user", content: "Hello from Node.js!" }
  ]
});

console.log(response.choices[0].message.content);

3. Authentication

All requests require an API key. Use the Authorization header for OpenAI-compatible calls:

Authorization: Bearer YOUR_API_KEY

For Anthropic-compatible calls, many SDKs use the x-api-key header:

x-api-key: YOUR_API_KEY
Security reminder: Never expose API keys in public GitHub repositories, frontend code, screenshots, browser apps, or shared logs.

4. Billing and Usage

Usage may be charged by tokens, requests, images, videos, model type, routing channel, or other rules shown in your AIPass Hub dashboard.

ItemDescription
BalanceYour available account balance or credits.
Usage LogsDetailed request records, model names, token usage, and charge records.
Model PricingDifferent models may have different price multipliers or billing rules.
RechargeContact support for recharge, business cooperation, or reseller setup.

5. OpenAI-Compatible Chat API

Use this format for GPT-style chat models, OpenAI SDKs, AI SaaS products, automation tools, and applications that support custom OpenAI-compatible base URLs.

Endpoint

POST https://api.aipasshub.cloud/v1/chat/completions

Request Example

curl https://api.aipasshub.cloud/v1/chat/completions \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -d '{
    "model": "gpt-5",
    "messages": [
      {"role": "system", "content": "You are a helpful AI assistant."},
      {"role": "user", "content": "Write a Python quicksort function."}
    ],
    "temperature": 0.7,
    "max_tokens": 2000,
    "stream": true
  }'

Common Parameters

ParameterTypeRequiredDescription
modelstringYesThe model name available in your account.
messagesarrayYesConversation messages.
streambooleanNoWhether to return streaming output.
temperaturenumberNoSampling temperature.
max_tokensintegerNoMaximum output tokens.
top_pnumberNoNucleus sampling value.
stopstring / arrayNoStop sequence.

Response Example

{
  "id": "chatcmpl-123",
  "object": "chat.completion",
  "created": 1713772800,
  "model": "gpt-5",
  "choices": [
    {
      "index": 0,
      "message": {
        "role": "assistant",
        "content": "This is the AI response."
      },
      "finish_reason": "stop"
    }
  ],
  "usage": {
    "prompt_tokens": 56,
    "completion_tokens": 31,
    "total_tokens": 87
  }
}

6. Anthropic-Compatible Messages API

Use this format for Claude-style models, Anthropic SDKs, Claude Code workflows, and tools that support custom Anthropic-compatible endpoints.

Endpoint

POST https://api.aipasshub.cloud/v1/messages

Request Example

curl https://api.aipasshub.cloud/v1/messages \
  -H "content-type: application/json" \
  -H "x-api-key: YOUR_API_KEY" \
  -d '{
    "model": "claude-sonnet-4-6",
    "max_tokens": 1024,
    "messages": [
      {"role": "user", "content": "Write a binary search function in Python."}
    ]
  }'

Python SDK Example

from anthropic import Anthropic

client = Anthropic(
    api_key="YOUR_API_KEY",
    base_url="https://api.aipasshub.cloud/v1"
)

message = client.messages.create(
    model="claude-sonnet-4-6",
    max_tokens=1024,
    messages=[
        {"role": "user", "content": "Write a Python decorator."}
    ]
)

print(message.content[0].text)
Anthropic-compatible conversations usually use user and assistant roles. Put system instructions in the system field when supported.

7. Image Generation API

Use the image generation endpoint for supported image models. Availability, sizes, quality levels, and pricing depend on enabled channels and account configuration.

Endpoint

POST https://api.aipasshub.cloud/v1/images/generations

Request Example

curl https://api.aipasshub.cloud/v1/images/generations \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -d '{
    "model": "gpt-image-2",
    "prompt": "Create a modern technology logo for an AI API platform.",
    "size": "1536x1024",
    "quality": "high",
    "n": 1
  }'
ParameterTypeDescription
modelstringImage model name.
promptstringImage generation prompt.
sizestringOutput size supported by the selected model.
qualitystringQuality level where supported.
nintegerNumber of images.

8. Gemini Image Workflows

Gemini-style image generation or multimodal workflows may be available through native or OpenAI-compatible formats depending on your enabled channel.

Native Gemini-Style

For tools requiring Gemini-compatible paths or formats.

https://api.aipasshub.cloud/v1beta
OpenAI-Compatible

For tools that support OpenAI-compatible image generation endpoints.

https://api.aipasshub.cloud/v1
Check your dashboard model list and channel settings before using Gemini image workflows.

9. Video Generation API

AIPass Hub may support text-to-video and image-to-video workflows where enabled. Video generation may take longer than text or image generation.

Example Request

curl https://api.aipasshub.cloud/v1/video/generations \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -d '{
    "model": "seedance-2.0",
    "prompt": "A futuristic city with flying vehicles at sunset.",
    "duration": 5,
    "ratio": "16:9",
    "resolution": "1080p"
  }'
Video model availability, pricing, duration, resolution, and output format vary by provider and channel. Confirm your account access before production use.

10. Install Node.js

Many developer tools require Node.js. We recommend using the latest LTS version.

# Ubuntu / Debian
sudo apt update
sudo apt install -y nodejs npm
node -v
npm -v

# macOS with Homebrew
brew install node

11. Claude Code Setup

Claude Code users can configure AIPass Hub as a compatible endpoint where custom Anthropic-compatible endpoints are supported.

export ANTHROPIC_BASE_URL="https://api.aipasshub.cloud/v1"
export ANTHROPIC_AUTH_TOKEN="YOUR_API_KEY"

claude "Write a simple Python HTTP server."

12. Codex / OpenAI-Compatible Tools

For coding tools that support OpenAI-compatible base URLs, set your API key and base URL.

export OPENAI_API_KEY="YOUR_API_KEY"
export OPENAI_BASE_URL="https://api.aipasshub.cloud/v1"

Common use cases include code generation, refactoring, documentation generation, code review, and terminal coding assistants.

13. Gemini CLI

Gemini CLI or Gemini-style tools may require native Gemini-compatible configuration. Use the endpoint and model format required by your tool.

API_BASE_URL=https://api.aipasshub.cloud/v1
API_KEY=YOUR_API_KEY
MODEL=gemini-2.5-pro

14. OpenClaw Setup

OpenClaw can use AIPass Hub as an OpenAI-compatible or Anthropic-compatible provider depending on your agent configuration.

OpenAI-Compatible

OPENAI_BASE_URL=https://api.aipasshub.cloud/v1
OPENAI_API_KEY=YOUR_API_KEY

Anthropic-Compatible

ANTHROPIC_BASE_URL=https://api.aipasshub.cloud/v1
ANTHROPIC_AUTH_TOKEN=YOUR_API_KEY

15. Error Codes

StatusError TypeDescription
400bad_requestInvalid request format or missing parameter.
401invalid_api_keyAPI key is missing, invalid, or disabled.
403permission_deniedYour account does not have access to this model or feature.
404not_foundEndpoint, resource, or model was not found.
429rate_limit_exceededToo many requests or token throughput exceeded.
500server_errorInternal server error.
503service_unavailableProvider, channel, or model is temporarily unavailable.

16. Rate Limits

Rate limits may vary by account group, model type, route, provider channel, and business agreement.

Limit TypeDescription
Requests per minuteMaximum number of requests allowed per minute.
Concurrent requestsMaximum number of active requests at the same time.
Token throughputMaximum input/output token volume over a period.
Model accessSome models require permission or account upgrade.

17. Best Practices

  • Keep API keys private and rotate them when needed.
  • Use server-side requests instead of exposing keys in frontend code.
  • Set reasonable timeouts and retry logic for production systems.
  • Monitor usage logs and balance regularly.
  • Use streaming for long responses to improve user experience.
  • Validate AI outputs before using them in high-stakes scenarios.
  • Follow applicable laws, provider terms, and platform usage policies.

18. FAQ

What is AIPass Hub?

AIPass Hub is a unified AI API access platform that helps users connect to multiple AI models through one API gateway.

Is AIPass Hub OpenAI-compatible?

Yes. Many workflows can use the OpenAI-compatible API format with a custom base URL.

Can I use Anthropic SDK?

Yes, if your target model and channel support Anthropic-compatible messages.

Why does my request fail?

Common reasons include invalid API key, insufficient balance, wrong model name, missing permissions, provider outage, or rate limit.

Can I use AIPass Hub for business or reseller scenarios?

Yes. Contact support for account setup, recharge, reseller cooperation, or business access.

Contact Support

For account setup, recharge support, model access, API integration, or business cooperation, contact us: