OpenLLM Documentation
Enterprise AI API Platform - Unified access to 200+ AI models, standardized integration, pay-as-you-go
Quick Start
Account Recharge
First, recharge your account. Pay-as-you-go pricing, only pay for what you use.
Recharge NowCreate/Get API Key
Create a new API key on the API Keys page. The key will only be shown once, please store it safely.
Create KeyView API Key and Models
After creating an API key, click the "View Models" button on the right side of the key list to view the Base URL, API Key, and available models.
View Base URL
Usage Notes:
- Anthropic: No /v1 suffix needed
- OpenAI: Append /v1 to the Base URL
- Gemini: Append /v1beta to the Base URL
OpenAI Usage
Configure OpenClaw
Configuration Note: OpenClaw requires configuring Provider and model list. Use openai API type.
Config file path:
~/.openclaw/openclaw.jsonEdit the config file and add:
{
"models": {
"mode": "merge",
"providers": {
"openllm": {
"baseUrl": "https://openllm.shop/v1",
"apiKey": "sk-xxxxxxxxxxxxxxxx",
"api": "openai-completions",
"models": [
{
"id": "glm-5",
"name": "glm-5",
"input": ["text"],
"contextWindow": 202752,
"maxTokens": 16384
}
]
}
}
},
"agents": {
"defaults": {
"models": {
"openllm/glm-5": {}
}
}
}
}After editing, restart Gateway:
openclaw gateway restartConfigure OpenCode
Config file path: ~/.config/opencode/opencode.json. Create manually if not exists.
~/.config/opencode/opencode.json{
"provider": {
"openai": {
"options": {
"baseURL": "https://openllm.shop/v1",
"apiKey": "sk-xxxxxxxxxxxxxxxx"
},
"models": {
"gpt-5.2": {
"name": "GPT-5.2",
"limit": {
"context": 400000,
"output": 128000
},
"options": {
"store": false
},
"variants": {
"low": {},
"medium": {},
"high": {},
"xhigh": {}
}
}
}
}
},
"agent": {
"build": {
"options": {
"store": false
}
},
"plan": {
"options": {
"store": false
}
}
},
"$schema": "https://opencode.ai/config.json"
}Python Usage
Install SDK:
pip install openaifrom openai import OpenAI
client = OpenAI(
api_key="sk-xxxxxxxxxxxxxxxx",
base_url="https://openllm.shop/v1"
)
response = client.chat.completions.create(
model="glm-5",
messages=[{"role": "user", "content": "hi"}]
)
print(response.choices[0].message.content)cURL Usage
POST /v1/chat/completions
| Parameter | Type | Required | Description |
|---|---|---|---|
| model | string | Yes | Model name, e.g., glm-5, gpt-5.4 |
| messages | array | Yes | Message list with role and content |
| temperature | number | No | Temperature parameter controlling randomness |
| max_tokens | number | No | Maximum output tokens |
| stream | boolean | No | Enable streaming output |
curl -X POST "https://openllm.shop/v1/chat/completions" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer sk-xxx" \
-d '{"model": "glm-5", "messages": [{"role": "user", "content": "hi"}], "stream": false}'💡 Streaming: change "stream": false to "stream": true for SSE response
POST /v1/responses
| Parameter | Type | Required | Description |
|---|---|---|---|
| model | string | Yes | Model name, e.g., glm-5, gpt-5.4 |
| instructions | string | No | System instructions defining assistant behavior |
| input | string | Yes | User input content |
| max_output_tokens | number | No | Maximum output tokens |
curl -X POST "https://openllm.shop/v1/responses" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer sk-xxx" \
-d '{"model": "gpt-5.4", "instructions": "You are a helpful assistant.", "input": "hi"}'POST /v1/images/generations
| Parameter | Type | Required | Description |
|---|---|---|---|
| model | string | Yes | Image generation model, e.g., gpt-image-2 |
| prompt | string | Yes | Image description text |
| size | string | No | Image size, default 1024x1024 |
| n | number | No | Number of images to generate |
| quality | string | No | Image quality: standard or high |
| response_format | string | No | Response format: url or b64_json |
curl -X POST "https://openllm.shop/v1/images/generations" \
-H "Authorization: Bearer sk-xxx" \
-H "Content-Type: application/json" \
-d '{"model": "gpt-image-2", "prompt": "A cute baby sea otter", "size": "1024x1024", "n": 1, "quality": "high", "response_format": "url"}'Anthropic Usage
Configure Claude Code
Claude Code configures Base URL and API Token via environment variables.
Add the following export commands to the end of your shell config file:
~/.zshrc # macOS default
~/.bashrc # Linux defaultMethod 1: Environment Variables (Recommended)
Edit ~/.zshrc or ~/.bashrc, add the following at the end:
export ANTHROPIC_BASE_URL="https://openllm.shop"
export ANTHROPIC_AUTH_TOKEN="sk-xxxxxxxxxxxxxxxx"
export ANTHROPIC_MODEL="claude-sonnet-4-6"
export CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC=1After saving, run source to apply, then launch Claude Code:
source ~/.zshrc
claude codeMethod 2: Config File
Edit ~/.claude/settings.json and add:
{
"env": {
"ANTHROPIC_AUTH_TOKEN": "sk-xxxxxxxxxxxxxxxx",
"ANTHROPIC_BASE_URL": "https://openllm.shop",
"ANTHROPIC_MODEL": "claude-sonnet-4-6",
"ANTHROPIC_REASONING_MODEL": "claude-sonnet-4-6",
"ANTHROPIC_DEFAULT_SONNET_MODEL": "claude-sonnet-4-6",
"ANTHROPIC_DEFAULT_HAIKU_MODEL": "claude-sonnet-4-6",
"ANTHROPIC_DEFAULT_OPUS_MODEL": "claude-sonnet-4-6"
},
"includeCoAuthoredBy": false
}Configure OpenClaw
Configuration Note: Use anthropic-messages API type.
Config file path:
~/.openclaw/openclaw.jsonEdit the config file and add:
{
"models": {
"mode": "merge",
"providers": {
"openllm": {
"baseUrl": "https://openllm.shop",
"apiKey": "sk-xxxxxxxxxxxxxxxx",
"api": "anthropic-messages",
"models": [
{
"id": "claude-sonnet-4-6",
"name": "claude-sonnet-4-6",
"input": ["text", "image"],
"contextWindow": 200000,
"maxTokens": 64000
}
]
}
}
},
"agents": {
"defaults": {
"models": {
"openllm/claude-sonnet-4-6": {}
}
}
}
}After editing, restart Gateway:
openclaw gateway restartConfigure OpenCode
Config file path: ~/.config/opencode/opencode.json. Create manually if not exists.
~/.config/opencode/opencode.json{
"$schema": "https://opencode.ai/config.json",
"provider": {
"openllm_anthropic": {
"name": "OpenLLM Anthropic",
"npm": "@ai-sdk/anthropic",
"options": {
"baseURL": "https://openllm.shop/v1",
"apiKey": "sk-xxxxxxxxxxxxxxxx"
},
"models": {
"claude-opus-4-8": {
"name": "Claude Opus 4 8 (Anthropic)"
},
"claude-sonnet-4-6": {
"name": "Claude Sonnet 4 6 (Anthropic)"
}
}
}
},
"agent": {
"build": {
"options": {
"store": false
}
},
"plan": {
"options": {
"store": false
}
}
},
"model": "openllm_anthropic/claude-opus-4-8",
"small_model": "openllm_anthropic/claude-sonnet-4-6"
}Python Usage
Install SDK:
pip install anthropicfrom anthropic import Anthropic
client = Anthropic(
api_key="sk-xxxxxxxxxxxxxxxx",
base_url="https://openllm.shop"
)
response = client.messages.create(
model="claude-sonnet-4-6",
max_tokens=1024,
messages=[{"role": "user", "content": "hi"}]
)
print(response.content[0].text)cURL Usage
POST /v1/messages
Required Headers
x-api-key: sk-xxx
anthropic-version: 2023-06-01| Parameter | Type | Required | Description |
|---|---|---|---|
| model | string | Yes | Claude model name, e.g., claude-sonnet-4-6 |
| messages | array | Yes | Message list with role and content |
| max_tokens | number | Yes | Maximum output tokens |
| temperature | number | No | Temperature parameter controlling randomness |
| system | string | No | System prompt |
| stream | boolean | No | Enable streaming output |
curl -X POST "https://openllm.shop/v1/messages" \
-H "x-api-key: sk-xxx" \
-H "anthropic-version: 2023-06-01" \
-H "content-type: application/json" \
-d '{"model": "claude-sonnet-4-6", "messages": [{"role": "user", "content": "hi"}], "max_tokens": 1024, "stream": false}'💡 Streaming: change "stream": false to "stream": true for SSE response
Gmini Usage
Configure OpenClaw
Configuration Note: Use google-generative-ai API type.
Config file path:
~/.openclaw/openclaw.jsonEdit the config file and add:
{
"models": {
"mode": "merge",
"providers": {
"openllm": {
"baseUrl": "https://openllm.shop/v1beta",
"apiKey": "sk-xxxxxxxxxxxxxxxx",
"api": "google-generative-ai",
"models": [
{
"id": "gemini-2.5-flash",
"name": "gemini-2.5-flash",
"input": ["text", "image"],
"contextWindow": 1000000,
"maxTokens": 8192
}
]
}
}
},
"agents": {
"defaults": {
"models": {
"openllm/gemini-2.5-flash": {}
}
}
}
}After editing, restart Gateway:
openclaw gateway restartConfigure OpenCode
Config file path: ~/.config/opencode/opencode.json. Create manually if not exists.
~/.config/opencode/opencode.json{
"provider": {
"google": {
"options": {
"baseURL": "https://openllm.shop/v1beta",
"apiKey": "sk-xxxxxxxxxxxxxxxx"
},
"models": {
"gemini-2.5-flash": {
"name": "Gemini 2.5 Flash",
"limit": {
"context": 1000000,
"output": 8192
},
"options": {
"store": false
},
"variants": {
"low": {},
"medium": {},
"high": {},
"xhigh": {}
}
}
}
}
},
"agent": {
"build": {
"options": {
"store": false
}
},
"plan": {
"options": {
"store": false
}
}
},
"$schema": "https://opencode.ai/config.json"
}Python Usage
Install SDK:
pip install google-genaifrom google import genai
client = genai.Client(
api_key="sk-xxxxxxxxxxxxxxxx",
http_options={
'base_url': 'https://openllm.shop'
}
)
response = client.models.generate_content(
model='gemini-3.5-flash',
contents='hi'
)
print(response.text)cURL Usage
POST /v1beta/models/{model_name}:generateContent
Required Headers
x-goog-api-key: sk-xxx| Parameter | Type | Required | Description |
|---|---|---|---|
| model | string | Yes | Gemini model name (in URL path) |
| contents | array | Yes | Content array |
| contents[].parts[].text | string | Yes | Text content |
| generationConfig | object | No | Generation config (optional) |
curl -X POST "https://openllm.shop/v1beta/models/gemini-2.5-flash:generateContent" \
-H "Content-Type: application/json" \
-H "x-goog-api-key: sk-xxx" \
-d '{"contents": [{"parts": [{"text": "hi"}]}]}'💡 Streaming: append ?alt=sse to the URL for SSE response
Need help? Contact support