đ AIbun.xyz Documentation
Everything you need to set up and use the AIbun.xyz AI Gateway. Access 20+ AI models through a single API key.
đ Quick Start
Get started in 3 simple steps:
Step 1 â Get your API Key
Choose a plan (or start with the free tier), and get your API key. All keys start with the toc- prefix.
Step 2 â Choose the right Base URL
Depending on your tool, use one of these endpoints:
| Compatibility | Base URL |
|---|---|
| OpenAI compatible | https://api.aibun.xyz/v1 |
| Anthropic compatible | https://api.aibun.xyz |
Step 3 â Configure your tool
Set the Base URL and API key as environment variables, or use the one-line installer for Claude Code:
curl -fsSL "https://api.aibun.xyz/claude-install.sh?key=YOUR_KEY" | sh
For specific tools, see the Agent Setup guides below.
đ Endpoints
| Endpoint | URL | Use for |
|---|---|---|
| Chat Completions (OpenAI) | https://api.aibun.xyz/v1/chat/completions |
GPT, Gemini models |
| Messages (Anthropic) | https://api.aibun.xyz/v1/messages |
Claude models |
đ Authentication
Your API key (starting with toc-) can be sent in two ways:
Authorization: Bearer toc-your-api-key-here
X-API-Key: toc-your-api-key-here
đ¤ Claude Code Recommended
Option A: One-line installer
curl -fsSL "https://api.aibun.xyz/claude-install.sh?key=YOUR_KEY" | sh
Option B: Manual setup
Set these environment variables:
export ANTHROPIC_BASE_URL="https://api.aibun.xyz" export ANTHROPIC_API_KEY="toc-your-api-key-here"
For Windows (PowerShell):
$env:ANTHROPIC_BASE_URL = "https://api.aibun.xyz" $env:ANTHROPIC_API_KEY = "toc-your-api-key-here"
claude in your terminal and it will use the AIbun.xyz gateway automatically.
đ Cursor
Open Cursor settings and configure:
- Go to Settings → Models → OpenAI API Key
- Set API key:
toc-your-api-key-here - Set Base URL:
https://api.aibun.xyz/v1 - Select your preferred model and start coding
/v1 in the Base URL.
đ Windsurf
Configure Windsurf with environment variables:
export OPENAI_BASE_URL="https://api.aibun.xyz/v1" export OPENAI_API_KEY="toc-your-api-key-here"
đ Cline
In VS Code with Cline extension:
- Open Cline settings
- Select API Provider: OpenAI Compatible or Anthropic
- Set Base URL:
https://api.aibun.xyz/v1(OpenAI) orhttps://api.aibun.xyz(Anthropic) - Set API key:
toc-your-api-key-here
đ OpenCode
export OPENAI_BASE_URL="https://api.aibun.xyz/v1" export OPENAI_API_KEY="toc-your-api-key-here"
⥠Other Agents
For any tool that supports OpenAI or Anthropic compatible APIs:
| Tool | Config |
|---|---|
| Continue | Set OPENAI_BASE_URL + OPENAI_API_KEY |
| Aider | Set OPENAI_BASE_URL + OPENAI_API_KEY |
| Amp Code | Set ANTHROPIC_BASE_URL + ANTHROPIC_API_KEY |
| Roo Code | Set OPENAI_BASE_URL + OPENAI_API_KEY |
| Codex CLI | Set OPENAI_BASE_URL + OPENAI_API_KEY |
| Gemini CLI | Set OPENAI_BASE_URL + OPENAI_API_KEY |
https://api.aibun.xyz. If it uses OpenAI SDK â use https://api.aibun.xyz/v1.
đĄ API Reference
Chat Completions (OpenAI compatible)
curl https://api.aibun.xyz/v1/chat/completions \
-H "Authorization: Bearer toc-your-api-key" \
-H "Content-Type: application/json" \
-d '{
"model": "gpt-4o",
"messages": [{"role": "user", "content": "Hello!"}]
}'
Messages (Anthropic compatible)
curl https://api.aibun.xyz/v1/messages \
-H "x-api-key: toc-your-api-key" \
-H "anthropic-version: 2023-06-01" \
-H "Content-Type: application/json" \
-d '{
"model": "claude-sonnet-4-20250514",
"max_tokens": 1024,
"messages": [{"role": "user", "content": "Hello!"}]
}'
đ§ Supported Models
20+ models available through the gateway:
| Provider | Models |
|---|---|
| Anthropic | Claude Opus 4, Claude Sonnet 4, Claude Haiku 3.5, Claude Sonnet 3.5 |
| OpenAI | GPT-4o, GPT-4o-mini, GPT-4 Turbo, o1, o1-mini, o3-mini |
| Gemini 2.5 Pro, Gemini 2.5 Flash, Gemini 2.0 Flash |
đ° Pricing & Limits
| Plan | Price ($AIBUN) | Reset Cycle | Best for |
|---|---|---|---|
| Free | 0 | 24 hours | Testing, 1/5 of trial quota |
| Lite | 150K | 5 hours | Learning & light tasks |
| Plus | 310K | 2 hours | Daily coding |
| Pro â | 550K | 2 hours | Active builders |
| Max | 1.1M | 2 hours | High-volume usage |
Rolling Window: Instead of one big quota dump, your limit refreshes on a rolling cycle (2h or 5h). This prevents burning all quota in one session.
đ¤ Telegram Bot
Try AI models instantly without any setup:
- Open @AIBUN_xyz_bot on Telegram
- Send a message â Claude, GPT, and Gemini are integrated
- No API key needed, no wallet needed
- Great for quick tests and casual AI conversations
đ§ Troubleshooting
Error: 401 Unauthorized
Your API key is invalid or missing. Make sure:
- API key starts with
toc- - Key is set in the correct env var (
ANTHROPIC_API_KEYorOPENAI_API_KEY) - No extra spaces or line breaks in the key
Error: 429 Rate Limited
You've hit your plan's quota limit. Options:
- Wait for the Rolling Window to reset (2h or 5h)
- Upgrade to a higher plan
- Purchase top-up credits
Error: Connection refused / timeout
- Check your internet connection
- Verify the Base URL is correct (with or without
/v1) - Make sure there's no proxy/VPN blocking the request
Model not found
Make sure you're using the correct model ID. Check the Supported Models section for available models.
â FAQ
Can I use multiple tools at the same time?
Yes! Your API key works across all tools simultaneously. The quota is shared across all requests.
Do top-up credits expire?
No. Top-up credits are permanent and carry over across billing cycles.
Can I switch plans?
Yes, you can upgrade or downgrade at any time. The change takes effect immediately.
Is the gateway down for maintenance?
The gateway runs 24/7 with 99.9% uptime. Check our Telegram group for status updates.