ChatOpenAI class with base_url set to https://www.ruapi.ai/v1 — no separate integration needed.
Prerequisites
1
RuAPI account and API key
Console → API Keys → create an
sk-... key. The balance tops up in USDT — see Top-up.Python
llm drops into any chain, agent or LCEL construct like a regular model.
JavaScript / TypeScript
Embeddings for RAG
For document search RuAPI offers the embedding modelstext-embedding-3-small (1536 dimensions) and text-embedding-3-large (3072). Use them with the same key via OpenAIEmbeddings:
chunk_size. emb works with any LangChain vector store (FAISS, Chroma and others), and llm from the example above writes the answers from the retrieved chunks. Embedding models unlock after a top-up; prices are on the Pricing page.
Troubleshooting
Model not found (503) or 404
Model not found (503) or 404
The name in
model must match RuAPI verbatim — see the pricing page.Do I need ChatAnthropic for Claude?
Do I need ChatAnthropic for Claude?
No. Claude is called through
ChatOpenAI on the same base_url — just put the Claude model ID in the model field.