User GuideAPI ReferenceAI Applications

Universal Protocol Overview

OpenRely API gateway natively supports OpenAI, Anthropic Claude, and Google Gemini protocols, empowering any AI client and developer workflow.

Overview

To enable developers to seamlessly integrate top AI models without refactoring their codebase, OpenRely deeply supports the three core protocol standards of the AI ecosystem:

  1. OpenAI Compatible Protocol (supports /v1/chat/completions and /v1/responses)
  2. Anthropic Claude Compatible Protocol (supports /v1/messages)
  3. Google Gemini Compatible Protocol (supports /v1beta/models/...:generateContent)

Whether your tool only supports configuring an OpenAI Base URL or strictly relies on native Anthropic/Gemini SDKs, you can connect directly.


📌 Protocol Selection Matrix

Choose the protocol guide corresponding to your client or SDK:


⚡ Core Protocol Specifications & Quickstart

To help developers test connectivity quickly, here are the core connection specifications and verification commands. Default commands use cURL, with Python and Node.js examples available via tabs:

Recommendation:

  • If your client has an "OpenAI / Custom Provider" option, prefer the OpenAI Compatible Protocol. You can use one unified configuration to call GPT, Claude, and Gemini models.
  • Only use native protocols when your client is a vendor-exclusive tool (such as a Claude-specific plugin or Google Gemini system).
  • Base URL: https://api.openrely.ai/v1
  • Auth Header: Authorization: Bearer sk-••••
  • Core Endpoint: POST /v1/chat/completions | 📖 View OpenAI Guide ➔
curl -X POST "https://api.openrely.ai/v1/chat/completions" \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer sk-your-api-key" \
  -d '{
    "model": "gpt",
    "messages": [
      { "role": "user", "content": "Hello OpenRely!" }
    ]
  }'
from openai import OpenAI

client = OpenAI(
    base_url="https://api.openrely.ai/v1",
    api_key="sk-your-api-key",
)

response = client.chat.completions.create(
    model="gpt",
    messages=[{"role": "user", "content": "Hello OpenRely!"}],
)

print(response.choices[0].message.content)
import OpenAI from 'openai';

const client = new OpenAI({
  baseURL: 'https://api.openrely.ai/v1',
  apiKey: 'sk-your-api-key',
});

const response = await client.chat.completions.create({
  model: 'gpt',
  messages: [{ role: 'user', content: 'Hello OpenRely!' }],
});

console.log(response.choices[0].message.content);

2. Anthropic Claude Compatible Protocol

  • Base URL: https://api.openrely.ai
  • Auth Header: x-api-key: sk-••••, anthropic-version: 2023-06-01
  • Core Endpoint: POST /v1/messages | 📖 View Claude Guide ➔
curl -X POST "https://api.openrely.ai/v1/messages" \
  -H "Content-Type: application/json" \
  -H "x-api-key: sk-your-api-key" \
  -H "anthropic-version: 2023-06-01" \
  -d '{
    "model": "claude",
    "max_tokens": 1024,
    "messages": [
      { "role": "user", "content": "Hello Claude!" }
    ]
  }'
from anthropic import Anthropic

client = Anthropic(
    base_url="https://api.openrely.ai",
    api_key="sk-your-api-key",
)

response = client.messages.create(
    model="claude",
    max_tokens=1024,
    messages=[{"role": "user", "content": "Hello Claude!"}],
)

print(response.content[0].text)
import Anthropic from '@anthropic-ai/sdk';

const client = new Anthropic({
  baseURL: 'https://api.openrely.ai',
  apiKey: 'sk-your-api-key',
});

const response = await client.messages.create({
  model: 'claude',
  max_tokens=1024,
  messages: [{ role: 'user', content: 'Hello Claude!' }],
});

console.log(response.content[0].text);

3. Google Gemini Compatible Protocol

  • Base URL: https://api.openrely.ai
  • Auth Header: x-goog-api-key: sk-•••• (or query param ?key=sk-...)
  • Core Endpoint: POST /v1beta/models/{model}:generateContent | 📖 View Gemini Guide ➔
curl -X POST "https://api.openrely.ai/v1beta/models/gemini:generateContent" \
  -H "Content-Type: application/json" \
  -H "x-goog-api-key: sk-your-api-key" \
  -d '{
    "contents": [
      {
        "role": "user",
        "parts": [{ "text": "Hello Gemini!" }]
      }
    ]
  }'
from google import genai
from google.genai import types

client = genai.Client(
    api_key="sk-your-api-key",
    http_options=types.HttpOptions(base_url="https://api.openrely.ai"),
)

response = client.models.generate_content(
    model="gemini",
    contents="Hello Gemini!",
)

print(response.text)
import { GoogleGenAI } from '@google/genai';

const ai = new GoogleGenAI({
  apiKey: 'sk-your-api-key',
  endpoint: 'https://api.openrely.ai',
});

const response = await ai.models.generateContent({
  model: 'gemini',
  contents: 'Hello Gemini!',
});

console.log(response.text);

Troubleshooting

Error / SymptomCauseSolution
401 UnauthorizedInvalid key or mismatched headerCheck that API key is valid (sk-...); verify correct header (Authorization: Bearer for OpenAI, x-api-key for Claude, x-goog-api-key for Gemini).
404 Not FoundBase URL path mismatchSome clients append paths automatically. If https://api.openrely.ai/v1 returns 404, try removing /v1 to use https://api.openrely.ai.
429 Rate LimitInsufficient balance or token limit exceededCheck console wallet balance and individual key token limits.

🛠️ Common Endpoints Reference

OpenRely aggregates multimodal capabilities across top AI providers. The table below lists standard endpoints, supported protocols, and scenarios:

CapabilityEndpointMethodProtocolScenarios & Model Examples
Chat & Multimodal/v1/chat/completionsPOSTOpenAIUniversal for all models (GPT-4o, Claude 3.7, Gemini 2.5, DeepSeek, etc.) with streaming and Tool Calling
Responses API/v1/responsesPOSTOpenAINative OpenAI Responses API, ideal for modern autonomous Agent workflows
Claude Messages/v1/messagesPOSTClaudeAnthropic native format with Thinking depth and Prompt Caching
Gemini Generate/v1beta/models/{model}:generateContentPOSTGeminiGoogle GenAI native format supporting multi-turn dialogue and video reasoning
Embeddings/v1/embeddingsPOSTOpenAItext-embedding-3-small / large for RAG and semantic vector search
Image Generation/v1/images/generationsPOSTOpenAIDALL-E 3, Midjourney, FLUX image generation
Audio Transcription/v1/audio/transcriptionsPOSTOpenAIWhisper speech-to-text recognition
Text-to-Speech (TTS)/v1/audio/speechPOSTOpenAIHigh-quality text synthesis into audio streams
List Models/v1/modelsGETOpenAIList all available models accessible by your account

Tip: Check the 🏆 Model Hub & Pricing anytime for real-time rates and availability.

Was this page helpful?

Universal Protocol Overview | OpenRely Docs