AICraft API Documentation

OpenAI-compatible API for 40+ AI models. One endpoint, every frontier model.

Base URL https://api.aicraftapi.com/v1

Introduction

AICraft aggregates DeepSeek, Qwen, GLM, MiniMax, Doubao, OpenRouter and more into a single OpenAI-compatible API. Use any OpenAI SDK — just change the base URL.

Key Features

FeatureDescription
Auto RouterAI automatically selects the best model for each task — saves up to 93% vs GPT-4
40+ ModelsFrom DeepSeek to GPT-4o, from Qwen to Claude — one API key
7 ProvidersAutomatic failover — if one provider goes down, traffic routes to backup
OpenAI CompatibleDrop-in replacement. Works with any existing OpenAI SDK code

Quick Start

Python

# Install
pip install openai

# Initialize
from openai import OpenAI
client = OpenAI(
    api_key="sk-your-key",
    base_url="https://api.aicraftapi.com/v1"
)

# Chat — with Auto Router
response = client.chat.completions.create(
    model="auto",
    messages=[{"role": "user", "content": "Hello!"}]
)
print(response.choices[0].message.content)

Node.js

// Install: npm install openai
import OpenAI from "openai";

const client = new OpenAI({
  apiKey: "sk-your-key",
  baseURL: "https://api.aicraftapi.com/v1",
});

const response = await client.chat.completions.create({
  model: "auto",
  messages: [{ role: "user", content: "Hello!" }],
});

cURL

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

Authentication

All API requests require an API key. Include it in the Authorization header:

Authorization: Bearer sk-your-key

Get your API key from the AICraft Dashboard.

Chat Completions

POST /v1/chat/completions

Create a chat completion. Compatible with OpenAI's chat completions API.

Request Body

ParameterTypeRequiredDescription
modelstringModel name or "auto" for intelligent routing
messagesarrayArray of message objects with role and content
max_tokensintegerNoMaximum tokens to generate
temperaturefloatNoSampling temperature (0-2)
streambooleanNoEnable streaming responses
aicraft_budgetstringNo"save" / "quality" / "auto" — Auto Router mode

Response Headers

X-AICraft-Routed-To: deepseek-chat
X-AICraft-Tier: primary
X-AICraft-Fallback: false
X-AICraft-Savings: 93% vs GPT-4

Auto Router

POST /v1/chat/completions with model="auto"

Set model to "auto" and AICraft intelligently routes your request to the best model:

TaskRouted ModelSavings vs GPT-4
💻 CodingDeepSeek V3-93%
🌐 TranslationDeepSeek V4-Flash-99%
🇨🇳 ChineseQwen-Max-88%
🧠 ReasoningGLM-5-83%
✍️ CreativeMiniMax M2.5-91%
💬 ConversationDoubao Pro-91%

Router tiers: aicraft_budget: "save" uses cheapest model, "quality" uses best model, "auto" balances based on message complexity.

List Models

GET /v1/models

Returns all available models.

curl https://api.aicraftapi.com/v1/models \
  -H "Authorization: Bearer sk-your-key"

Available Models

ProviderModelsInput Price/M
DeepSeekV3, V4-Flash, R1$0.003 - $0.55
AlibabaQwen-Max, Plus, Turbo$0.03 - $0.35
ZhipuGLM-5, GLM-5-Flash$0.10 - $0.70
MiniMaxM2.5, M3$0.10 - $0.15
ByteDanceDoubao Pro, Lite$0.008 - $0.06
OpenRouterGPT-4o, Claude, Gemini, Mistral, Llama$0.08 - $15.00

Pricing

PlanPriceTokens/MonthModels
Free$0/mo5MChinese
Starter$12/mo50MAll Chinese
Pro$39/mo200MAll Chinese + Priority
Global$89/mo300MChinese + International
Enterprise$299/mo2BCustom SLA

Rate Limits

PlanRate Limit
Free5 requests/minute
Starter / Pro / GlobalUnlimited (fair use)
EnterpriseCustom SLA

Error Codes

CodeMeaning
200Success
401Invalid API key
429Rate limit exceeded
500Server error — auto-retry recommended
502Upstream model unavailable — Auto Router will use fallback

AICraft · Shenzhen AICreatrix Technology Co., Ltd. · aicraftapi.com