Integration Docs
RelayHub provides an OpenAI-compatible gateway. Use one rk_ key and switch model/provider by changing the model field in request JSON.
Third-party apps (Cursor and similar)
Step-by-step setup for tools that accept an OpenAI-compatible API—no coding or command line required. Use the same rk_ key from your RelayHub Dashboard.
Cursor
- Sign in to RelayHub, open Dashboard, then create an API key (value starts with
rk_) and copy it. - In Cursor, open Settings (macOS: Command+, · Windows/Linux: Control+,). Go to Models (or Cursor Settings → Models).
- Under OpenAI, paste your key into OpenAI API Key.
- If you see Override OpenAI Base URL (wording may vary by version), set it to
https://api.relayhub.vip/v1. - Use Verify if the UI offers it, then Save.
- In the model picker, choose or add a model ID that RelayHub supports—for DeepSeek traffic use IDs such as
deepseek-chatordeepseek-v4-flash. Names must match exactly (see Routing Rules below).
Custom API keys in Cursor apply to chat features; Tab completion may still use Cursor's built-in models. Menus differ slightly between Cursor versions - if you do not see a base-URL field, check Cursor's own help for "OpenAI API key" or "override base URL".
Other desktop or IDE extensions
Clients labeled “OpenAI compatible”, “custom OpenAI”, or “BYOK” usually ask for the same three values:
- Base URL / API endpoint:
https://api.relayhub.vip/v1. If the app only accepts a host and adds/v1itself, tryhttps://api.relayhub.vipper that app’s instructions. - API key: your full RelayHub key (
rk_...). - Model name: for example
deepseek-chatordeepseek-v4-flash; use IDs listed on the RelayHub home or pricing page.
Examples include VS Code extensions and standalone chat apps that support custom OpenAI endpoints. Field names differ by product—use its documentation for “OpenAI API” or “compatible endpoint”.
For developers: The sections below describe direct HTTP calls to RelayHub.
Quick Start
1) Sign in (or create an account first)
2) Top up wallet balance or claim free trial
3) Create and copy API key from Dashboard
4) Send POST /v1/chat/completions with Authorization: Bearer <YOUR_RK_KEY>
API URL
Production API base URL: https://api.relayhub.vip.
POST https://api.relayhub.vip/v1/chat/completions Authorization: Bearer YOUR_RK_KEY
Health check:
GET https://api.relayhub.vip/health
Routing Rules
| Requested model pattern | Upstream provider |
|---|---|
Contains glm | Zhipu GLM |
Contains kimi or moonshot | Moonshot Kimi |
| Other values (for example DeepSeek models) | DeepSeek |
Supported Upstream Docs
Streaming
Streaming is currently disabled. Send "stream": false (or omit this field).
cURL Example
curl -X POST "https://api.relayhub.vip/v1/chat/completions" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_RK_KEY" \
-d '{
"model": "deepseek-chat",
"messages": [{"role":"user","content":"Hello"}],
"stream": false
}'
Common Errors
| Status Code | Cause | Recommended Fix |
|---|---|---|
| 400 | Unsupported parameters (for example stream: true) | Use stream: false. |
| 401 | Invalid key or missing Bearer token | Use full rk_... key value. |
| 402 | Insufficient balance or trial quota | Top up wallet or claim trial. |
| 429 | Rate limit exceeded | Reduce request rate and retry. |
| 502/503 | Upstream/provider side issue | Retry later or contact support. |