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
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.
Use OpenAI SDKs and apps by setting the base URL to AIPass Hub.
/v1/chat/completionsUse Claude-style tools and messages with compatible endpoints.
/v1/messagesCreate images and visual content with supported image models.
/v1/images/generationsGenerate short videos where supported by your account and model channels.
/v1/video/generations2. Quick Start
- Create an AIPass Hub account.
- Recharge your account or request activation from support.
- Generate an API key from the dashboard.
- Choose the model and API format you want to use.
- 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_KEYFor Anthropic-compatible calls, many SDKs use the x-api-key header:
x-api-key: YOUR_API_KEY4. 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.
| Item | Description |
|---|---|
| Balance | Your available account balance or credits. |
| Usage Logs | Detailed request records, model names, token usage, and charge records. |
| Model Pricing | Different models may have different price multipliers or billing rules. |
| Recharge | Contact 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/completionsRequest 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
| Parameter | Type | Required | Description |
|---|---|---|---|
| model | string | Yes | The model name available in your account. |
| messages | array | Yes | Conversation messages. |
| stream | boolean | No | Whether to return streaming output. |
| temperature | number | No | Sampling temperature. |
| max_tokens | integer | No | Maximum output tokens. |
| top_p | number | No | Nucleus sampling value. |
| stop | string / array | No | Stop 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/messagesRequest 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)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/generationsRequest 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
}'| Parameter | Type | Description |
|---|---|---|
| model | string | Image model name. |
| prompt | string | Image generation prompt. |
| size | string | Output size supported by the selected model. |
| quality | string | Quality level where supported. |
| n | integer | Number 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.
For tools requiring Gemini-compatible paths or formats.
https://api.aipasshub.cloud/v1betaFor tools that support OpenAI-compatible image generation endpoints.
https://api.aipasshub.cloud/v19. 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"
}'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 node11. 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-pro14. 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_KEYAnthropic-Compatible
ANTHROPIC_BASE_URL=https://api.aipasshub.cloud/v1
ANTHROPIC_AUTH_TOKEN=YOUR_API_KEY15. Error Codes
| Status | Error Type | Description |
|---|---|---|
| 400 | bad_request | Invalid request format or missing parameter. |
| 401 | invalid_api_key | API key is missing, invalid, or disabled. |
| 403 | permission_denied | Your account does not have access to this model or feature. |
| 404 | not_found | Endpoint, resource, or model was not found. |
| 429 | rate_limit_exceeded | Too many requests or token throughput exceeded. |
| 500 | server_error | Internal server error. |
| 503 | service_unavailable | Provider, 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 Type | Description |
|---|---|
| Requests per minute | Maximum number of requests allowed per minute. |
| Concurrent requests | Maximum number of active requests at the same time. |
| Token throughput | Maximum input/output token volume over a period. |
| Model access | Some 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: