Skip to content

API Overview

Base URL

https://api.ru-llm.relay2.xyz

Replace this with your self-hosted gateway URL if applicable.

API surfaces

ru-llm exposes two fully compatible API surfaces on the same gateway:

SurfaceBase pathProtocol
OpenAI-compatible/v1OpenAI Chat Completions API
Anthropic-compatible/v1Anthropic Messages API

The surface is determined by the endpoint you call, not by configuration.

Authentication

All requests require an sk-ru-… API key. Both surfaces accept either header:

Authorization: Bearer sk-ru-YOUR_KEY
x-api-key: sk-ru-YOUR_KEY

Create and manage keys in the console → API Keys.

Endpoints

OpenAI-compatible

MethodPathDescription
POST/v1/chat/completionsChat completion (streaming or non-streaming)
GET/v1/modelsList available models

Anthropic-compatible

MethodPathDescription
POST/v1/messagesMessages API (streaming or non-streaming)
GET/v1/modelsList available models

Cross-dialect routing

This means your existing OpenAI SDK code can access Claude models without any changes to the SDK — just point base_url at the gateway and switch the model ID.

Content types

All request and response bodies are JSON (Content-Type: application/json). Streaming responses use text/event-stream (Server-Sent Events).

Versioning

  • OpenAI surface: no version header required.
  • Anthropic surface: pass anthropic-version: 2023-06-01 (or later) in request headers.