OpenLLM Documentation

Enterprise AI API Platform - Unified access to 200+ AI models, standardized integration, pay-as-you-go

Quick Start

1

Account Recharge

First, recharge your account. Pay-as-you-go pricing, only pay for what you use.

Recharge Now
2

Create/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 Key
3

View 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.

Your Credentials
Base URL:
API Key:sk-xxxxxxxxxxxxxxxx
Available Models:gpt-4o, claude-opus-4-6, gemini-2.5-flash...
4

View Base URL

Node 1 (Recommended)
Node 2

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.json

Edit 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 restart

Configure 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 openai
from 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

ParameterTypeRequiredDescription
modelstringYesModel name, e.g., glm-5, gpt-5.4
messagesarrayYesMessage list with role and content
temperaturenumberNoTemperature parameter controlling randomness
max_tokensnumberNoMaximum output tokens
streambooleanNoEnable 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

ParameterTypeRequiredDescription
modelstringYesModel name, e.g., glm-5, gpt-5.4
instructionsstringNoSystem instructions defining assistant behavior
inputstringYesUser input content
max_output_tokensnumberNoMaximum 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

ParameterTypeRequiredDescription
modelstringYesImage generation model, e.g., gpt-image-2
promptstringYesImage description text
sizestringNoImage size, default 1024x1024
nnumberNoNumber of images to generate
qualitystringNoImage quality: standard or high
response_formatstringNoResponse 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 default

Method 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=1

After saving, run source to apply, then launch Claude Code:

source ~/.zshrc
claude code

Method 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.json

Edit 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 restart

Configure 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 anthropic
from 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
ParameterTypeRequiredDescription
modelstringYesClaude model name, e.g., claude-sonnet-4-6
messagesarrayYesMessage list with role and content
max_tokensnumberYesMaximum output tokens
temperaturenumberNoTemperature parameter controlling randomness
systemstringNoSystem prompt
streambooleanNoEnable 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.json

Edit 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 restart

Configure 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-genai
from 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
ParameterTypeRequiredDescription
modelstringYesGemini model name (in URL path)
contentsarrayYesContent array
contents[].parts[].textstringYesText content
generationConfigobjectNoGeneration 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