Documentation
Get started in 5 minutes.
AIAgenHub speaks both the OpenAI /v1/chat/completions API and the Anthropic /v1/messages API. Point your existing SDK at us, paste your API key, and you're live — or configure Claude Code, Codex, OpenCode, and more in one command.
Step 1 — Get an API key
Create an account and head to Dashboard → API Keys. Click Create key, copy it, and store it safely. Keys start with sk-agen- and are shown only once.
Step 2 — Top up with USDC
Open Dashboard → Deposit. Each account gets a unique Solana address. Send USDC from any wallet — no memo required. After finalized commitment (~13 seconds) your balance is credited. Settlement is on Solana mainnet — send real USDC and double-check the address and network.
Step 3 — Make your first request
OpenAI Python
from openai import OpenAI
client = OpenAI(
base_url="https://api.aiagenku.app/v1",
api_key="sk-agen-...",
)
resp = client.chat.completions.create(
model="ocg/glm-5.3",
messages=[{"role": "user", "content": "Hello!"}],
)
print(resp.choices[0].message.content)Anthropic Python / Claude Code
from anthropic import Anthropic
# Anthropic clients append /v1 themselves.
# Use the API root, NOT ".../v1" (that becomes /v1/v1/messages).
client = Anthropic(
base_url="https://api.aiagenku.app",
api_key="sk-agen-...",
)
resp = client.messages.create(
model="zai/glm-5.3",
max_tokens=1024,
messages=[{"role": "user", "content": "Hello!"}],
)
print(resp.content[0].text)curl (chat completions)
curl https://api.aiagenku.app/v1/chat/completions \
-H "Authorization: Bearer sk-agen-..." \
-H "Content-Type: application/json" \
-d '{
"model": "ocg/glm-5.3",
"messages": [{"role": "user", "content": "Hello!"}]
}'curl (with bid headers)
# Attach a bid: route only to providers at/under your per-Mtoken ceiling
curl https://api.aiagenku.app/v1/chat/completions \
-H "Authorization: Bearer sk-agen-..." \
-H "x-max-input-price: 0.30" \
-H "x-max-output-price: 1.50" \
-H "Content-Type: application/json" \
-d '{
"model": "demo/model-x",
"messages": [{"role": "user", "content": "Hello!"}]
}'API reference
- GET /v1/models — list every model addressable as <prefix>/<model-id>.
- POST /v1/chat/completions — OpenAI-compatible. Streaming + tool calling.
- POST /v1/messages — Anthropic-compatible. Same key, native SSE.
- GET /api/me — balance, tier, Solana deposit address.