Tương thích OpenAI SDK & Anthropic Messages API. Hoạt động với Claude Code, Cursor, Cline, Continue, Aider...
https://shibiai.dev/api/v1/chat/completionshttps://shibiai.dev/v1/messagesAuthorization: Bearer shi-... hoặc x-api-key: shi-...Chọn công cụ bạn đang dùng để xem cấu hình copy-paste.
Anthropic native — chuẩn nhất với Claude
Claude Code là CLI chính thức của Anthropic. Nó đọc settings từ ~/.claude/settings.json (Linux/macOS) hoặc %USERPROFILE%\.claude\settings.json (Windows).
ANTHROPIC_BASE_URL phải là https://shibiai.dev (KHÔNG có /api/v1 hay /v1 ở cuối). Anthropic SDK tự động append /v1/messages nội bộ.{
"env": {
"ANTHROPIC_BASE_URL": "https://shibiai.dev",
"ANTHROPIC_AUTH_TOKEN": "shi-your-api-key",
"ANTHROPIC_DEFAULT_OPUS_MODEL": "claude-opus-4-6",
"ANTHROPIC_DEFAULT_SONNET_MODEL": "claude-sonnet-5",
"ANTHROPIC_DEFAULT_HAIKU_MODEL": "claude-haiku-4-5",
"PYTHONIOENCODING": "utf-8",
"PYTHONUTF8": "1",
"LANG": "en_US.UTF-8",
"LC_ALL": "en_US.UTF-8",
"CHCP": "65001"
},
"permissions": {
"allow": ["Bash(*)"],
"additionalDirectories": []
}
}ANTHROPIC_AUTH_TOKEN: API key của bạn, lấy tại /dashboard/keys.
ANTHROPIC_DEFAULT_*_MODEL: chọn model khi gõ claude (sonnet) hoặc claude --opus / --haiku. Có thể đổi thành bất kỳ model id nào trong bảng Models bên dưới.
3 dòng PYTHONIOENCODING, LANG, CHCP là tuỳ chọn — chỉ cần khi terminal Windows hiển thị lỗi UTF-8.
additionalDirectories: thư mục Claude được phép đọc/ghi ngoài project hiện tại (vd C:\\Users\\you\\Pentest). Để trống nếu không cần.
# cài đặt
npm install -g @anthropic-ai/claude-code
# vào project
cd ~/code/my-project
claude
# hoặc gọi trực tiếp model cụ thể:
claude --opus # dùng claude-opus-4-6
claude --haiku # dùng claude-haiku-4-5Nếu bạn tự code thay vì dùng IDE, đây là 3 cách phổ biến nhất.
curl https://shibiai.dev/api/v1/chat/completions \
-H "Authorization: Bearer shi-your-api-key" \
-H "Content-Type: application/json" \
-d '{"model":"claude-sonnet-5","messages":[{"role":"user","content":"Hello!"}],"stream":true}'from openai import OpenAI
client = OpenAI(
api_key="shi-your-api-key",
base_url="https://shibiai.dev/api/v1"
)
response = client.chat.completions.create(
model="claude-sonnet-5",
messages=[{"role": "user", "content": "Hello!"}],
stream=True
)
for chunk in response:
print(chunk.choices[0].delta.content or "", end="")import Anthropic from "@anthropic-ai/sdk";
const client = new Anthropic({
apiKey: "shi-your-api-key",
baseURL: "https://shibiai.dev", // ← Anthropic SDK auto-appends /v1/messages
});
const msg = await client.messages.create({
model: "claude-sonnet-5",
max_tokens: 1024,
messages: [{ role: "user", content: "Hello!" }],
});
console.log(msg.content);| ID | CTX | IN $/M | OUT $/M | Ghi chú |
|---|---|---|---|---|
| claude-opus-4-7 | 1M | $5.00 | $25.00 | Most capable |
| claude-opus-4-6 | 1M | $5.00 | $25.00 | Coding agent |
| claude-sonnet-5 | 1M | $2.00 | $10.00 | Best for coding |
| claude-sonnet-4-6 | 1M | $3.00 | $15.00 | Best for coding |
| claude-haiku-4-5 | 200K | $1.00 | $5.00 | Fastest |
| minimax-m2.5 | 200K | $0.50 | $2.00 | Agentic coding |
| glm-5 | 200K | $1.00 | $5.00 | Reasoning + vision |
| qwen3-codex | 256K | $0.10 | $0.50 | Budget |
/api/v1/chat/completions— OpenAI format (stream + non-stream, tools, vision)/api/v1/messages— Anthropic Messages API (Claude Code dùng cái này)/api/v1/models— Liệt kê model + giáTất cả model Claude hỗ trợ cache_control: { type: "ephemeral" } theo chuẩn Anthropic.
Khi cache hit, gateway giảm 45% giá input cho phần cache_read (multiplier 0.55). Cache_write tính theo giá Anthropic gốc (+25%).
Claude Code & Cline tự động dùng caching cho system prompt + tools — không cần config thêm.
• 1 Credit = 5,000 VND (≈ $0.20 USD)
• Tài khoản mới được tặng 1 credit miễn phí
• Pay-as-you-go: trừ theo token thực tế từ usage upstream
• Nạp tối thiểu 100.000đ · bonus tới +25% ở gói 2.000.000đ
• VietQR · cộng credit tự động qua webhook SePay