API Reference
RelayX API documentation and quick start
Quick Start
RelayX provides a unified entry point for AI API calls. Prepare your account, confirm your balance, create an API key, choose a model, and then call the API from your app, script, or client.
Onboarding Flow
Sign in
Open the RelayX console and sign in to view your balance, available models, and API keys.
Check balance
Confirm that your account has enough available balance before sending production requests.
Create an API key
Create a key in the API Key or token page and store it safely. Do not expose it in public code or frontend pages.
Choose a model
Pick a model based on your use case. Text, image, audio, embedding, and other model types may have different pricing and latency.
Basic Request
RelayX is compatible with common OpenAI-style APIs. Use your RelayX endpoint as the base URL and pass your API key in the authorization header.
curl https://your-domain/v1/chat/completions \
-H "Content-Type: application/json" \
-H "Authorization: Bearer sk-your-api-key" \
-d '{
"model": "gpt-4o-mini",
"messages": [
{
"role": "user",
"content": "Introduce RelayX in one sentence."
}
]
}'Usage Tips
Start with small traffic
Before production use, verify model behavior, response format, billing, and error handling with a small number of requests.
Match models to tasks
Chat, code, long context, image, audio, and embedding tasks often need different models. Start with a balanced model first.
Protect your key
Store API keys on the server side, preferably in environment variables. Never ship them in frontend code or public repositories.
API Overview
RelayX provides RESTful APIs for AI model calls and is compatible with common OpenAI-style integrations. Use these APIs to list models, create chat completions, generate text, create embeddings, generate images, process audio, and more.
AI Model APIs
Model List
Retrieve the currently available model list.
Chat
Call chat models with conversation messages.
Completions
Traditional text completion API.
Embeddings
Generate text vectors for retrieval, clustering, and similarity search.
Rerank
Rerank candidate documents or text chunks by relevance.
Moderations
Run content safety checks for submitted text.
Audio
Speech recognition, translation, and speech synthesis APIs.
Realtime
Realtime audio session APIs.
Images
Image generation and image editing APIs.
Video
Video generation and task query APIs.