Protocols & endpoints

Native Chat Completions, Responses, Anthropic Messages, Gemini generateContent, and media task endpoints supported by HopsAPI.

HopsAPI forwards requests through each model's native protocol. Discover model capabilities first, then select the advertised endpoint instead of sending every model to OpenAI Chat Completions.

1. Base configuration

SettingValue
API domainhttps://hopsapi.com
OpenAI SDK base URLhttps://hopsapi.com/v1
AuthenticationAuthorization: Bearer sk-YOUR_KEY or x-api-key: sk-YOUR_KEY. Gemini native endpoints and GET /v1/models also accept x-goog-api-key and ?key=
Capability discoveryGET /v1/models
GET/v1/models

Choose an interface from the response's format, endpoint, and optional responses_endpoint.

LLM endpoints forward application end-to-end request headers to the upstream and return application end-to-end upstream response headers. For GPT models, prompt-cache hits only require the session-id header (optional, but recommended on every request): read it from the response and send it unchanged with every LLM request in the same associated session. A/B testing verified that session-id alone caches as reliably as all three headers; thread-id and conversation-id remain optional for conversation tracking. The gateway replaces client Authorization, does not forward x-api-key, x-goog-api-key, cookies, or ingress/proxy headers such as Forwarded, Via, X-Real-IP, X-Forwarded-*, and CF-Connecting-IP, generates X-AIToken-Request-Id, and returns the same value in the compatibility alias X-OneAPI-Request-Id; caller-supplied values for either request ID header are not forwarded upstream. The gateway owns its X-Session-Id / X-Call-Id response headers. Expect, hop-by-hop, proxy-authentication, Set-Cookie, reverse-proxy control headers such as X-Accel-* and X-Sendfile, runtime transport, and body-integrity headers that cannot survive proxy body processing are not copied. This rule applies only to LLM endpoints, not media-task endpoints. Do not place secrets in arbitrary headers.

2. Protocol mapping

Model family / capabilityNative formatRequest endpointRecommended SDK
GPT / Kimi / MiniMax / DeepSeek / Grok, plus Gemini text models that advertise compatibilityOpenAI Chat CompletionsPOST /v1/chat/completionsopenai
Text model with responses_endpointOpenAI ResponsesPOST /v1/responsesopenai
ClaudeAnthropic MessagesPOST /v1/messages@anthropic-ai/sdk
GeminiGoogle generateContentPOST /v1/models/{model}:generateContent@google/genai
Video / image modelsHopsAPI async media tasksPOST /v1/router/task/createHTTP client

Claude is rejected at /v1/chat/completions. Gemini can use this endpoint only when its model-list item explicitly includes openai-completions in supported_protocols; other models continue to use native generateContent. /v1/responses accepts only enabled models that advertise responses_endpoint. Always take protocol support from the model-list item, never from the model name.

3. Streaming

ProtocolHow to enable it
Chat CompletionsSend "stream":true in the request body
OpenAI ResponsesSend "stream":true in the request body
Anthropic MessagesSend "stream":true in the request body
GeminiUse :streamGenerateContent
Media modelsNo SSE; create a task and poll its status

SDK base URLs differ: OpenAI uses https://hopsapi.com/v1; the Anthropic and Google Gen AI examples use the bare domain https://hopsapi.com. Follow the complete example on each protocol page.

4. Continue by protocol

On this page

On this page