Skip to content

Getting Started

ru-llm is an “OpenRouter for RU” LLM proxy. A single gateway exposes both an OpenAI-compatible API (/v1/chat/completions) and an Anthropic-compatible API (/v1/messages), and routes your requests to upstream LLM providers transparently.

Key facts:

  • One base URL: https://api.ru-llm.relay2.xyz (your gateway URL — replace if self-hosted)
  • One auth scheme: sk-ru-… API keys accepted via Authorization: Bearer or x-api-key
  • Both API surfaces accept either header
  • Prepaid USD balance; you’re charged for actual tokens used at per-model retail rates

Set up your account

  1. Create an account

    Sign up at ru-llm.relay2.xyz. Authentication is powered by Kratos — use email + password or a supported social provider.

  2. Top up your balance

    Navigate to Billing in the console and deposit funds via crypto/USDT. Your balance is prepaid in USD; requests are charged as tokens are consumed.

  3. Create an API key

    Go to API Keys in the console and click Create key. Copy the generated sk-ru-… key — it is shown only once.

Your first request

Replace sk-ru-YOUR_KEY with your actual key in the examples below.

OpenAI-compatible (chat completions)

Terminal window
curl https://api.ru-llm.relay2.xyz/v1/chat/completions \
-H "Authorization: Bearer sk-ru-YOUR_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "gpt-4o",
"messages": [{"role": "user", "content": "Hello, world!"}]
}'

Anthropic-compatible (messages)

Terminal window
curl https://api.ru-llm.relay2.xyz/v1/messages \
-H "x-api-key: sk-ru-YOUR_KEY" \
-H "anthropic-version: 2023-06-01" \
-H "Content-Type: application/json" \
-d '{
"model": "claude-3-5-sonnet-20241022",
"max_tokens": 256,
"messages": [{"role": "user", "content": "Hello, world!"}]
}'

Streaming

Both surfaces support streaming via Server-Sent Events. Add "stream": true to the request body:

Terminal window
curl https://api.ru-llm.relay2.xyz/v1/chat/completions \
-H "Authorization: Bearer sk-ru-YOUR_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "gpt-4o",
"messages": [{"role": "user", "content": "Count to five."}],
"stream": true
}'

Next steps