https://www.ruapi.ai/v1, the same sk-... key. The only thing to change in your code is base_url.
Your first vector
Python (OpenAI SDK)
resp.data is a list: one input text yields one item with an .embedding field. text-embedding-3-small returns a 1536-number vector.
Need higher quality? Use text-embedding-3-large (3072 numbers per vector). It’s more accurate on hard text but costs more and runs slower. For most tasks -small is plenty.
Several texts at once
Pass a list toinput and you get one vector per item in a single request — faster and cheaper than sending texts one by one.
End-to-end RAG in five steps
The idea is simple: ahead of time, split your documents into chunks and compute a vector for each. When a question comes in, find the closest chunks and hand them to the chat model as context. 1. Split text into chunks. Chunks that are too long blur the meaning; too short and they lose context. Paragraphs or 200-500-word windows usually work well.Gotchas
Same model for the index and the query
Same model for the index and the query
Vectors from
text-embedding-3-small and text-embedding-3-large aren’t comparable — different dimensions, different meaning space. Embed your query with whatever model built the index. Switch models and you have to rebuild the whole index.Batch via a list in input
Batch via a list in input
Sending texts one at a time is slow and burns more requests. Pass a list to
input (usually up to a few hundred strings at once) — results come back in the same order.-small vs -large: dimensions and cost
-small vs -large: dimensions and cost
text-embedding-3-small is 1536 numbers per vector — cheaper and faster, good for most tasks. text-embedding-3-large is 3072 numbers — more accurate on complex, long text, but costs more and takes twice the storage. Start with -small and move to -large only if search quality falls short.What’s next
- Quickstart — sign up, get a key, make your first request
- GPT models — choosing the chat model that answers from your retrieved context
- API reference — endpoints, base URLs and request format
- LangChain — ready-made chains and RAG on top of RuAPI without hand-rolling code