Skip to main content
RuAPI supports two API protocols simultaneously: classic OpenAI-compatible and native Anthropic Claude-compatible. The same API key works with both.

OpenAI protocol

POST /v1/chat/completions — industry standard, supported by virtually all SDKs and frameworks.

Claude protocol

POST /v1/messages — native Anthropic format with thinking blocks and MCP support.
Quick reference:

Base URL

The address depends on the protocol — this is the #1 thing people get wrong: OpenAI-compatible — with /v1:
Anthropic — without /v1 (the SDK appends /v1/messages itself):
The endpoint tables below show full paths from the domain root. Auth via the Authorization: Bearer sk-... header (x-api-key also works on /v1/messages).
For Anthropic, do not add /v1 to the base_url — an extra /v1 returns a 404.

OpenAI protocol

Use this protocol if your code already uses the official OpenAI SDK or a compatible framework (LangChain, LlamaIndex, Vercel AI SDK, etc.).

Endpoint

Compatibility

The request/response format matches OpenAI’s Chat Completions API. Supported:
  • messages (with roles system / user / assistant / tool)
  • model — name of any model in the catalog (Claude/Gemini/Grok/Qwen/MiniMax/GLM included — we convert on the fly)
  • stream: true for streaming responses (Server-Sent Events)
  • tools / tool_choice for function calling
  • temperature, top_p, max_tokens and other parameters

Example: Python (OpenAI SDK)

Example: Node.js (OpenAI SDK)

Example: curl + streaming


Claude protocol

Use this protocol if your code is built on the Anthropic SDK or you need Claude-specific features (thinking blocks, native tool calls).

Endpoint

Compatibility

The request/response format matches Anthropic’s Messages API. Supported:
  • messages array (native Claude format)
  • system as a separate field
  • model — Claude model name or any other (we convert it into the Claude protocol)
  • max_tokens (required for Claude)
  • stream: true
  • tools / tool_choice
  • thinking for reasoning models

Example: Python (Anthropic SDK)

Example: Node.js (Anthropic SDK)

Example: curl

The Anthropic SDK uses the x-api-key header instead of Authorization: Bearer. RuAPI accepts both on the /v1/messages endpoint.

Which protocol should I pick?

In every case — same API key, same per-token price, shared balance.

All endpoints

The full list with current models lives on the Pricing page at www.ruapi.ai.