Skip to content

curl

Call HopBase compatible endpoints with HTTP and curl.

Model typeProtocol and endpointAuthentication
GPT / Gemini / GLMPOST https://api.hop-base.com/v1/chat/completionsAuthorization: Bearer
ClaudePOST https://api.hop-base.com/v1/messagesx-api-key
ImagesPOST https://api.hop-base.com/v1/images/generationsAuthorization: Bearer

Authentication and common limits

ItemRuleWhen it is not met
Key headerAuthorization: Bearer sk-… or x-api-key: sk-…, accepted on every endpoint; x-goog-api-key and the ?key= URL parameter are not supported401 missing_api_key / invalid_api_key
Endpoint and groupEach request must use the endpoint of its model's protocol (for example, Claude models can only be called through /v1/messages)404 "This API path is not supported by the current platform"
ModelMust be a model in one of the current key's groups404 model_not_found
Request body sizeThe whole body ≤ 60 MB413
GET /v1/modelsReturns the model IDs available to the current key; not billed—

Use a model ID returned by GET /v1/models for the current plan key. A key can call only the models of the groups it includes.

Set max_tokens explicitly for Claude.

On Claude requests, omitting max_tokens does not error — it is filled in as 4096, so long output stops at 4096 tokens (stop_reason: "max_tokens"). Set it explicitly.

OpenAI protocol (GPT models)

curl https://api.hop-base.com/v1/chat/completions \
  -H "Authorization: Bearer sk-your-key" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "gpt-5.6-sol",
    "messages": [{"role": "user", "content": "Hello"}]
  }'

Anthropic protocol (Claude models)

curl https://api.hop-base.com/v1/messages \
  -H "x-api-key: sk-your-key" \
  -H "anthropic-version: 2023-06-01" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "claude-sonnet-5",
    "max_tokens": 1024,
    "messages": [{"role": "user", "content": "Hello"}]
  }'

Streaming (add "stream": true)

curl https://api.hop-base.com/v1/chat/completions \
  -H "Authorization: Bearer sk-your-key" \
  -H "Content-Type: application/json" \
  -d '{"model": "gpt-5.6-sol", "stream": true,
    "messages": [{"role": "user", "content": "Hello"}]}'

Next steps