⚡ Using API & Playground
Experience and test AI models online with the Playground, and make seamless API calls via OpenAI / Anthropic / Gemini standard-compatible endpoints.
Playground
The Playground provides a lightweight online debugging and testing environment, allowing you to engage in multi-turn conversations directly with models and verify results without writing any code.
- Select Group and Model: Select the channel group and the specific model to test at the bottom right of the input box.
- Configure Generation Parameters: Click the parameters button to adjust Temperature, Top P, Frequency Penalty, and Max Tokens as needed.
- Enter Conversation Prompts: Type your test question or System Prompt in the bottom input box.
- Send and Debug: Click "Send" to submit the request and view streaming responses, token consumption, and response latency in real time.
API URL & Authentication
The platform's standard-compatible Base URL is:
https://api.openrely.ai/v1Pass your API key as a Bearer Token in the HTTP request header:
Authorization: Bearer sk-your-api-keyTaking Chat Completions as an example:
curl 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"}]}'SDK Code Examples
Python (OpenAI SDK)
from openai import OpenAI
client = OpenAI(
api_key="sk-your-api-key",
base_url="https://api.openrely.ai/v1",
)
response = client.chat.completions.create(
model="gpt",
messages=[{"role": "user", "content": "Hello"}],
)
print(response.choices[0].message.content)Claude Native Messages Protocol
curl https://api.openrely.ai/v1/messages \
-H "x-api-key: sk-your-api-key" \
-H "anthropic-version: 2023-06-01" \
-H "content-type: application/json" \
-d '{
"model": "claude",
"max_tokens": 1024,
"messages": [{"role": "user", "content": "Hello"}]
}'Gemini Native Format
curl "https://api.openrely.ai/v1beta/models/gemini:generateContent?key=sk-your-api-key" \
-H "Content-Type: application/json" \
-d '{"contents": [{"parts": [{"text": "Hello"}]}]}'Supported Endpoints Overview
The platform is fully compatible with mainstream LLM protocol specifications. The primary supported endpoints are as follows:
| Category | Endpoint | Protocol & Description |
|---|---|---|
| Chat Completions | POST /v1/chat/completions | OpenAI Chat Completions compatible endpoint, supporting full streaming (SSE), Function Calling, and multimodal inputs. |
| Playground Chat | POST /pg/chat/completions | Dedicated endpoint for the console web playground, reusing unified routing, protocol conversion, billing, and retry pipelines. |
| Claude Messages | POST /v1/messages | Anthropic Claude native compatible endpoint, supporting seamless direct connection for official Claude SDKs and native clients. |
| Gemini Native Call | POST /v1beta/models/{model}:{action} | Google Gemini native format endpoint, supporting operations like generateContent, streamGenerateContent, etc. |
| Gemini Compatible Call | POST /v1/models/{model}:{action} | Handles Gemini-style model operation requests with a /v1 prefix, automatically performing protocol parsing and conversion. |
| Embeddings | POST /v1/embeddings | Batch vectorization of text, automatically adapted to upstream Embeddings channels. |
| Rerank | POST /v1/rerank | Reranks candidate documents based on query relevance, suitable for RAG-enhanced retrieval. |
| Image Generation | POST /v1/images/generations | Text-to-image endpoint, supporting generative models such as DALL·E, FLUX, Midjourney, etc. |
| Image Editing | POST /v1/images/edits | Image editing and inpainting, supporting JSON and multipart/form-data upload requests. |
| Audio Transcription | POST /v1/audio/transcriptions | Whisper speech recognition, transcribing audio to text. |
| Text to Speech | POST /v1/audio/speech | TTS speech synthesis, rendering text into high-quality audio streams. |
| Moderation | POST /v1/moderations | Sensitive content filtering and compliance detection. |
| Responses API | POST /v1/responses | OpenAI Responses format endpoint, supporting context compression and advanced event handling. |
| Realtime | GET /v1/realtime (WebSocket) | OpenAI Realtime-style full-duplex, low-latency voice/text streaming endpoint. |
| Model List | GET /v1/models | Lists currently available models, supporting adaptive response formats based on OpenAI, Anthropic, and Gemini request headers. |
| Model Details | GET /v1/models/{model} | Retrieves configuration and capability details for a specific model. |
Was this page helpful?