AIPower provides an OpenAI-compatible API with 16 AI models from 9 providers (OpenAI, Anthropic, Google, DeepSeek, Alibaba, Zhipu, Moonshot, ByteDance, MiniMax). Change one line of code to get started.
curl https://api.aipower.me/v1/chat/completions \
-H "Authorization: Bearer sk-aipower-demo-public" \
-H "Content-Type: application/json" \
-d '{
"model": "deepseek/deepseek-chat",
"messages": [{"role": "user", "content": "Translate good morning into Mandarin, Japanese, and Spanish. Reply in JSON."}]
}'The demo key is rate-limited to 5 calls per IP per day and only works on cheap models (DeepSeek, Qwen Turbo, GLM-4 Flash). Sign up free for 10 low-cost trial calls, then top up $5 to unlock GPT, Claude, Gemini, Kimi, MiniMax, and premium reasoning models.
1. Sign up free and copy your API key (or use sk-aipower-demo-public above for instant trial).
2. Use any OpenAI-compatible SDK with our base URL:
https://api.aipower.me/v1Use Bearer token authentication with your API key:
Authorization: Bearer YOUR_API_KEYSign up free → your API key auto-fills in all code examples. Copy & run instantly.
POST /v1/chat/completions
Creates a model response for the given chat conversation. Supports streaming.
curl https://api.aipower.me/v1/chat/completions \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "deepseek/deepseek-chat",
"messages": [
{"role": "system", "content": "You are a helpful assistant."},
{"role": "user", "content": "What is the capital of France?"}
],
"temperature": 0.7,
"max_tokens": 1000,
"stream": false
}'Sign up free → your API key auto-fills in all code examples. Copy & run instantly.
from openai import OpenAI
client = OpenAI(
base_url="https://api.aipower.me/v1",
api_key="YOUR_API_KEY",
)
# Non-streaming
response = client.chat.completions.create(
model="deepseek/deepseek-chat",
messages=[{"role": "user", "content": "Translate 'good morning' into Mandarin, Japanese, and Spanish. Reply in JSON."}],
)
print(response.choices[0].message.content)
# Streaming
stream = client.chat.completions.create(
model="deepseek/deepseek-chat",
messages=[{"role": "user", "content": "Tell me a story"}],
stream=True,
)
for chunk in stream:
if chunk.choices[0].delta.content:
print(chunk.choices[0].delta.content, end="")Sign up free → your API key auto-fills in all code examples. Copy & run instantly.
import OpenAI from 'openai';
const client = new OpenAI({
baseURL: 'https://api.aipower.me/v1',
apiKey: 'YOUR_API_KEY',
});
const response = await client.chat.completions.create({
model: 'deepseek/deepseek-chat',
messages: [{ role: 'user', content: "Translate 'good morning' into Mandarin, Japanese, and Spanish. Reply in JSON." }],
});
console.log(response.choices[0].message.content);Sign up free → your API key auto-fills in all code examples. Copy & run instantly.
package main
import (
"context"
"fmt"
openai "github.com/sashabaranov/go-openai"
)
func main() {
config := openai.DefaultConfig("YOUR_API_KEY")
config.BaseURL = "https://api.aipower.me/v1"
client := openai.NewClientWithConfig(config)
resp, _ := client.CreateChatCompletion(
context.Background(),
openai.ChatCompletionRequest{
Model: "deepseek/deepseek-chat",
Messages: []openai.ChatCompletionMessage{
{Role: "user", Content: "Translate 'good morning' into Mandarin, Japanese, and Spanish. Reply in JSON."},
},
},
)
fmt.Println(resp.Choices[0].Message.Content)
}Sign up free → your API key auto-fills in all code examples. Copy & run instantly.
| Parameter | Type | Required | Description |
|---|---|---|---|
| model | string | Yes | Model ID (e.g., deepseek/deepseek-chat). Use 'auto' for smart routing. |
| messages | array | Yes | Array of message objects with role and content |
| temperature | number | No | Sampling temperature (0-2). Default: 1 |
| max_tokens | integer | No | Maximum tokens to generate |
| stream | boolean | No | Stream response via SSE. Default: false |
| top_p | number | No | Nucleus sampling. Default: 1 |
| stop | string|array | No | Stop sequences |
Use smart model IDs to automatically route to the best model for your task:
| Parameter | Type | Required | Description |
|---|---|---|---|
| auto | model | No | Auto-select the best model based on the prompt |
| auto-cheap | model | No | Route to the cheapest available model |
| auto-best | model | No | Route to the most powerful model |
| auto-code | model | No | Route to the best coding model |
| auto-fast | model | No | Route to the fastest model |
| auto-free | model | No | Route to the cheapest (near-free) model |
response = client.chat.completions.create(
model="auto-code", # Automatically picks best coding model
messages=[{"role": "user", "content": "Write a React component"}],
)POST /v1/responses
OpenAI-compatible Responses API. Simpler interface for single-turn interactions.
curl https://api.aipower.me/v1/responses \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "deepseek/deepseek-chat",
"input": "What is the meaning of life?"
}'Sign up free → your API key auto-fills in all code examples. Copy & run instantly.
GET /v1/models — Returns all 16 available models with live pricing.
Foreign model prices include gateway access and failover. Chinese models sit close to direct-provider cost with a small aggregation fee (for WeChat Pay / Alipay / fapiao support).
| Model ID | Name | Input $/M | Output $/M | Context |
|---|---|---|---|---|
| openai/gpt-5 | GPT-5 | $3.00 | $18.00 | 272K |
| openai/gpt-4o-mini | GPT-4o Mini | $0.18 | $0.72 | 128K |
| anthropic/claude-opus | Claude Opus 4.6 | $6.00 | $30.00 | 200K |
| anthropic/claude-sonnet | Claude Sonnet 4 | $3.60 | $18.00 | 200K |
| google/gemini-2.5-pro | Gemini 2.5 Pro | $1.50 | $12.00 | 1M |
| google/gemini-2.5-flash | Gemini 2.5 Flash | $0.36 | $3.00 | 1M |
| Model ID | Name | Input $/M | Output $/M | Context |
|---|---|---|---|---|
| deepseek/deepseek-chat | DeepSeek V3 | $0.34 | $0.50 | 64K |
| deepseek/deepseek-reasoner | DeepSeek R1 | $0.34 | $0.50 | 64K |
| qwen/qwen-plus | Qwen Plus | $0.13 | $1.87 | 128K |
| qwen/qwen-turbo | Qwen Turbo | $0.08 | $0.31 | 128K |
| zhipu/glm-5.1 | GLM-5.1 | $1.25 | $4.00 | 128K |
| zhipu/glm-4-flash | GLM-4 Flash | $0.01 | $0.01 | 128K |
| moonshot/kimi-k2.5 | Kimi K2.5 | $0.24 | $1.20 | 256K |
| moonshot/moonshot-v1-8k | Moonshot v1 8K | $0.14 | $0.14 | 8K |
| doubao/doubao-pro-256k | Doubao Pro 256K | $0.07 | $0.12 | 256K |
| minimax/minimax-text-01 | MiniMax Text 01 | $0.36 | $1.44 | 1M |
| Parameter | Type | Required | Description |
|---|---|---|---|
| 400 | No | Bad request — malformed JSON or invalid parameters. Check model name, messages format. | |
| 401 | No | Invalid or missing API key. Use `Authorization: Bearer sk-aipower-xxx`. | |
| 402 | No | Insufficient credits. Top up at /dashboard/billing. | |
| 403 | No | Model not allowed on free tier. Top up $5+ to unlock premium models (Claude Opus, GPT-5, Gemini Pro, GLM-5.1). | |
| 404 | No | Model not found. List models via GET /v1/models. | |
| 429 | No | Rate limit exceeded. Back off and retry with exponential delay. | |
| 502 | No | Upstream provider error (auto-failover will try backup). Usually transient. | |
| 503 | No | Provider temporarily unavailable. Retry or route to a different model. |
AIPower uses a prepaid credits system. Add credits via Stripe (credit card, WeChat Pay, or Alipay).
Free tier: 10 low-cost trial calls on signup. No credit card required. Premium models unlock after a $5+ top-up.
First top-up bonus: any amount ≥ $5 on your first-ever top-up gets +100 free credits (one-time).
Larger top-ups earn up to 35% bonus credits:
Check your balance, top up, or set a daily spending cap at /dashboard/billing.