Skip to content

Integration Guides

These guides show how to point popular clients and agents at the ru-llm gateway. ru-llm exposes an OpenAI-compatible surface (/v1/chat/completions) and an Anthropic-compatible surface (/v1/messages) on a single base URL, so most tools work after changing two settings: the base URL and the API key.

What you need

  • Base URLhttps://api.ru-llm.relay2.xyz (replace with your gateway URL if self-hosted).
    • OpenAI-style clients point at https://api.ru-llm.relay2.xyz/v1.
    • Anthropic-style clients point at https://api.ru-llm.relay2.xyz.
  • API key — an sk-ru-… key from the console → API Keys. It is accepted as Authorization: Bearer sk-ru-… or x-api-key: sk-ru-… on both surfaces.
  • A model ID — see Models & Pricing. Chat examples below use gpt-5.5, claude-sonnet-4-6, and claude-opus-4-8.

First request

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-5.5",
"messages": [{"role": "user", "content": "Hello, world!"}]
}'

Response:

{
"id": "chatcmpl-abc123",
"object": "chat.completion",
"model": "gpt-5.5",
"choices": [
{"index": 0, "message": {"role": "assistant", "content": "Hello! How can I help you today?"}, "finish_reason": "stop"}
],
"usage": {"prompt_tokens": 9, "completion_tokens": 10, "total_tokens": 19}
}

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-sonnet-4-6",
"max_tokens": 256,
"messages": [{"role": "user", "content": "Hello, world!"}]
}'

Pick your client

Claude Code

Point Anthropic’s CLI/IDE agent at the gateway with two env vars. Open guide →

Image generation

Generate images with gpt-image-2 via /v1/images/generations. Open guide →

Video generation

Render video with Seedance via the async video endpoint. Open guide →

Generic OpenAI / Anthropic SDKs

Any client built on the official OpenAI or Anthropic SDKs works by overriding the base URL and key — see the OpenAI-compatible and Anthropic-compatible references for Python and TypeScript snippets.