Skip to main content
LangChain is a framework for LLM apps — chains, agents, RAG. Since RuAPI is OpenAI-compatible, connecting comes down to the ChatOpenAI class with a changed base_url — no separate integration needed.

Prerequisites

1

RuAPI account and API key

Console → Tokens → create an sk-... key. The balance tops up in USDT — see Top-up.

Python

From here llm drops into any chain, agent or LCEL construct like a regular model.

JavaScript / TypeScript

To switch models, change the model field. The same key reaches Claude, GPT, Gemini, DeepSeek and more.

Embeddings (RAG)

Troubleshooting

api_key must be a RuAPI token (sk-...). Check for stray spaces.
The name in model must match RuAPI verbatim — see the pricing page.
No. Claude is called through ChatOpenAI on the same base_url — just put the Claude model ID in the model field.