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:
- OpenAI Compatible Protocol (supports
/v1/chat/completionsand/v1/responses) - Anthropic Claude Compatible Protocol (supports
/v1/messages) - 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:
The most versatile standard, supporting cross-model routing and Responses API
Anthropic native Messages format and authorization specification
Google Gemini native REST API and GenAI SDK integration
⚡ 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).
1. OpenAI Compatible Protocol (Recommended)
- 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 / Symptom | Cause | Solution |
|---|---|---|
| 401 Unauthorized | Invalid key or mismatched header | Check 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 Found | Base URL path mismatch | Some clients append paths automatically. If https://api.openrely.ai/v1 returns 404, try removing /v1 to use https://api.openrely.ai. |
| 429 Rate Limit | Insufficient balance or token limit exceeded | Check 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:
| Capability | Endpoint | Method | Protocol | Scenarios & Model Examples |
|---|---|---|---|---|
| Chat & Multimodal | /v1/chat/completions | POST | OpenAI | Universal for all models (GPT-4o, Claude 3.7, Gemini 2.5, DeepSeek, etc.) with streaming and Tool Calling |
| Responses API | /v1/responses | POST | OpenAI | Native OpenAI Responses API, ideal for modern autonomous Agent workflows |
| Claude Messages | /v1/messages | POST | Claude | Anthropic native format with Thinking depth and Prompt Caching |
| Gemini Generate | /v1beta/models/{model}:generateContent | POST | Gemini | Google GenAI native format supporting multi-turn dialogue and video reasoning |
| Embeddings | /v1/embeddings | POST | OpenAI | text-embedding-3-small / large for RAG and semantic vector search |
| Image Generation | /v1/images/generations | POST | OpenAI | DALL-E 3, Midjourney, FLUX image generation |
| Audio Transcription | /v1/audio/transcriptions | POST | OpenAI | Whisper speech-to-text recognition |
| Text-to-Speech (TTS) | /v1/audio/speech | POST | OpenAI | High-quality text synthesis into audio streams |
| List Models | /v1/models | GET | OpenAI | List all available models accessible by your account |
Tip: Check the 🏆 Model Hub & Pricing anytime for real-time rates and availability.
Was this page helpful?
Compliance and Acceptable Use Policy
Compliance Statement and Acceptable Use Policy for the New API Project
OpenAI Compatibility Protocol
Learn how to connect third-party clients, CLIs, scripts, and official SDKs to OpenRely via standard OpenAI protocols (including /v1/chat/completions and /v1/responses).