User GuideAPI ReferenceAI Applications

⚡ 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.

  1. Select Group and Model: Select the channel group and the specific model to test at the bottom right of the input box.
  2. Configure Generation Parameters: Click the parameters button to adjust Temperature, Top P, Frequency Penalty, and Max Tokens as needed.
  3. Enter Conversation Prompts: Type your test question or System Prompt in the bottom input box.
  4. 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/v1

Pass your API key as a Bearer Token in the HTTP request header:

Authorization: Bearer sk-your-api-key

Taking 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:

CategoryEndpointProtocol & Description
Chat CompletionsPOST /v1/chat/completionsOpenAI Chat Completions compatible endpoint, supporting full streaming (SSE), Function Calling, and multimodal inputs.
Playground ChatPOST /pg/chat/completionsDedicated endpoint for the console web playground, reusing unified routing, protocol conversion, billing, and retry pipelines.
Claude MessagesPOST /v1/messagesAnthropic Claude native compatible endpoint, supporting seamless direct connection for official Claude SDKs and native clients.
Gemini Native CallPOST /v1beta/models/{model}:{action}Google Gemini native format endpoint, supporting operations like generateContent, streamGenerateContent, etc.
Gemini Compatible CallPOST /v1/models/{model}:{action}Handles Gemini-style model operation requests with a /v1 prefix, automatically performing protocol parsing and conversion.
EmbeddingsPOST /v1/embeddingsBatch vectorization of text, automatically adapted to upstream Embeddings channels.
RerankPOST /v1/rerankReranks candidate documents based on query relevance, suitable for RAG-enhanced retrieval.
Image GenerationPOST /v1/images/generationsText-to-image endpoint, supporting generative models such as DALL·E, FLUX, Midjourney, etc.
Image EditingPOST /v1/images/editsImage editing and inpainting, supporting JSON and multipart/form-data upload requests.
Audio TranscriptionPOST /v1/audio/transcriptionsWhisper speech recognition, transcribing audio to text.
Text to SpeechPOST /v1/audio/speechTTS speech synthesis, rendering text into high-quality audio streams.
ModerationPOST /v1/moderationsSensitive content filtering and compliance detection.
Responses APIPOST /v1/responsesOpenAI Responses format endpoint, supporting context compression and advanced event handling.
RealtimeGET /v1/realtime (WebSocket)OpenAI Realtime-style full-duplex, low-latency voice/text streaming endpoint.
Model ListGET /v1/modelsLists currently available models, supporting adaptive response formats based on OpenAI, Anthropic, and Gemini request headers.
Model DetailsGET /v1/models/{model}Retrieves configuration and capability details for a specific model.

Was this page helpful?

⚡ Using API & Playground | OpenRely Docs