RelayHub
Logged out

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

  1. Sign in to RelayHub, open Dashboard, then create an API key (value starts with rk_) and copy it.
  2. In Cursor, open Settings (macOS: Command+, · Windows/Linux: Control+,). Go to Models (or Cursor SettingsModels).
  3. Under OpenAI, paste your key into OpenAI API Key.
  4. If you see Override OpenAI Base URL (wording may vary by version), set it to https://api.relayhub.vip/v1.
  5. Use Verify if the UI offers it, then Save.
  6. In the model picker, choose or add a model ID that RelayHub supports—for DeepSeek traffic use IDs such as deepseek-chat or deepseek-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 /v1 itself, try https://api.relayhub.vip per that app’s instructions.
  • API key: your full RelayHub key (rk_...).
  • Model name: for example deepseek-chat or deepseek-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 patternUpstream provider
Contains glmZhipu GLM
Contains kimi or moonshotMoonshot 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 CodeCauseRecommended Fix
400Unsupported parameters (for example stream: true)Use stream: false.
401Invalid key or missing Bearer tokenUse full rk_... key value.
402Insufficient balance or trial quotaTop up wallet or claim trial.
429Rate limit exceededReduce request rate and retry.
502/503Upstream/provider side issueRetry later or contact support.