Integration guide
How to use LLMHub
LLMHub is a low-cost AI API with fallback routing and access to leading models through one OpenAI-compatible endpoint. Use the same key in code editors, automation tools, scripts, and production apps.
For eligible retryable failures, routing can move to another available route before response data is sent. It does not silently replace the model requested by your application.
Review the pricing methodologyDirect API request
- 01Create an API key in your dashboard
- 02Use your key as a Bearer token
- 03Set model to one of the public aliases, for example claude-sonnet-4-6
curl https://api.llm-hub.dev/v1/chat/completions \
-H "Authorization: Bearer sk-your-key" \
-H "Content-Type: application/json" \
-d '{"model":"claude-sonnet-4-6","messages":[{"role":"user","content":"Hello from my application."}]}'Cursor
- 01Add a custom OpenAI-compatible provider
- 02Base URL https://api.llm-hub.dev/v1
- 03API key sk-your-key
- 04Use model aliases claude-sonnet-4-6, claude-opus-4-7, claude-opus-4-6, and claude-haiku-4-5
Do not add upstream provider credentials in Cursor. Use only the LLMHub API key and base URL.
Antigravity
- 01Add a custom OpenAI-compatible provider
- 02Use base URL https://api.llm-hub.dev/v1
- 03Enter API key sk-your-key
- 04Try claude-sonnet-4-6, claude-opus-4-7, claude-opus-4-6, and gemini-3-pro-image-preview
Claude Code
- 01Set the verified environment variables for the LLMHub endpoint and API key
- 02Use model alias claude-sonnet-4-6or claude-opus-4-7
env -u ANTHROPIC_API_KEY \
-u ANTHROPIC_CUSTOM_MODEL_OPTION \
-u ANTHROPIC_CUSTOM_MODEL_OPTION_NAME \
ANTHROPIC_BASE_URL="https://api.llm-hub.dev" \
ANTHROPIC_AUTH_TOKEN="sk-your-key" \
ANTHROPIC_DEFAULT_SONNET_MODEL="claude-sonnet-4-6" \
ANTHROPIC_DEFAULT_OPUS_MODEL="claude-opus-4-7" \
claude --model sonnetClaude Code expects the base URL without /v1. For normal OpenAI SDK requests, keep /v1.
n8n
- 01Use POST URL https://api.llm-hub.dev/v1/chat/completions
- 02Send Bearer authorization with sk-your-key
- 03Set JSON model to claude-sonnet-4-6and add a customer message
POST https://api.llm-hub.dev/v1/chat/completions
Authorization: Bearer sk-your-key
Content-Type: application/json
{
"model": "claude-sonnet-4-6",
"messages": [{"role": "user", "content": "Reply to this customer message: How do I get started?"}]
}