OneMux/Docs/Protocol Support

Protocol Support

OneMux supports four protocol formats: OpenAI, Anthropic, Gemini, and Responses API. Developers can choose the optimal protocol for each model's capabilities and switch without modifying existing code. This page lists the endpoints, authentication methods, and use cases for each protocol.

Supported Protocols

ProtocolEndpointSupported ModelsAuthentication
OpenAI-compatible/v1/chat/completionsAll modelsAuthorization: Bearer sk-xxx
Native Anthropic/v1/messagesClaude modelsx-api-key: sk-xxx
OpenAI Responses/v1/responsesGPT modelsAuthorization: Bearer sk-xxx
Native Gemini/v1beta/models/{model}:generateContentGemini modelsAuthorization: Bearer sk-xxx

Why Are There Multiple Protocols?

  • Easy migration: Keep your existing code and change only the Base URL
  • Full native feature support: Supports features such as Anthropic Prompt Caching, Claude Extended Thinking, and Gemini 2M context
  • Optimal performance: Claude is 20-30% faster with the Anthropic protocol than with the OpenAI format

Recommended Usage

ModelRecommended ProtocolReason
Claude modelsNative AnthropicSupports Prompt Caching, reducing costs by 90%
GPT modelsOpenAI-compatibleStandard format with the broadest compatibility
Gemini modelsNative GeminiSupports 2M context for processing very long documents

OpenAI-Compatible Format

curl https://api.onemux.net/v1/chat/completions \
  -H "Authorization: Bearer sk-xxx" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "claude-opus-5-5",
    "messages": [{"role": "user", "content": "Hello"}]
  }'

Native Anthropic Format (Recommended for Claude)

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

Native Gemini Format

curl https://api.onemux.net/v1beta/models/gemini-4-argon:generateContent \
  -H "Authorization: Bearer sk-xxx" \
  -H "Content-Type: application/json" \
  -d '{
    "contents": [{
      "role": "user",
      "parts": [{"text": "Hello"}]
    }]
  }'