DeProcess Try the API

What It Costs to Embed a Document Library for RAG, in Batches

Published · Updated · By Sydney Kibuuka, Founder · 6 min read

Cover: What It Costs to Embed a Document Library for RAG, in Batches. Key points: 1. Cost = tokens × price per million tokens; 2. About 800 tokens per page is a fair first guess; 3. Switching models means re-embedding everything.

Embedding a document library for RAG costs the number of tokens you embed times the price per million tokens. A library of 50,000 pages at about 800 tokens per page is roughly 40 million tokens, which comes to about $0.80 at DeProcess's listed price of $0.02 per million tokens, or a little more once you add chunk overlap. To do it in batches, split documents into chunks, send up to 256 chunks per request to /v1/embeddings, and store each vector with its chunk.

Key takeaways

  • Embedding cost = tokens embedded × price per million tokens; queries are tiny next to the first indexing run.
  • OpenAI's embeddings guide assumes about 800 tokens per page; the tiktoken README says a token is about 4 bytes of text on average.
  • DeProcess charges $0.02 per million tokens for embeddings and takes up to 256 texts per request, as of November 10, 2026.
  • Token counts depend on the model's tokenizer, so treat estimates as estimates and check the cost each finished job reports.
  • Switching embedding models means re-embedding everything, because vectors from different models can't be compared.

What does it cost to embed a document library for RAG?

It costs the number of tokens you send to the embedding model, times the price per million tokens. For most libraries that is a few dollars or less for the first full run, and pennies a month after that. The work is in estimating the tokens honestly and running the batches reliably.

RAG (retrieval-augmented generation) means finding the passages most relevant to a question and giving them to a language model along with the question. To find them, every passage in your library is turned into an embedding, a list of numbers that captures its meaning, and stored in a vector database. Embedding the library once is the big cost; each later question needs only one small embedding.

How many tokens are in your documents?

Count them with a tokenizer, or estimate from a published rule of thumb. A token is a piece of text the model reads as one unit: a short word, part of a longer word or a punctuation mark. Two published figures help with estimates:

We checked the second figure on November 10, 2026 with tiktoken 0.14.0 and the cl100k_base encoding, which OpenAI's guide names for its third-generation embedding models. The body of our guide to how batch speech to text works is about 10,900 bytes of English text and came to 2,321 tokens, or about 4.7 bytes per token.

Different models split text differently. The Hugging Face Transformers docs describe three common subword methods (byte pair encoding, Unigram and WordPiece), and each model ships its own vocabulary. The DePro docs don't name a tokenizer for the embeddings model, so treat any count from tiktoken as an estimate. Every finished DePro job reports what it cost, which gives you the real figure after a test batch.

What does a worked example look like?

Here is a full estimate for a mid-sized library. The assumptions are stated so you can swap in your own numbers.

StepAssumptionResult
Library10,000 documents, 5 pages each50,000 pages
Tokens per page~800, from OpenAI's embeddings guide40,000,000 tokens
Chunking500-token chunks, each sharing 50 tokens with the next (so each chunk adds 450 new tokens)about 88,900 chunks
Tokens embedded88,900 chunks × 500 tokensabout 44,400,000 tokens
Requests256 chunks per request348 requests
Cost at $0.02 per million tokensDeProcess price, as of November 10, 2026about $0.89

Then the running costs:

New DePro accounts start with $0.50 of free credit, enough to embed about 25 million tokens at that price, so a sizable test index costs nothing.

How does DeProcess compare with OpenAI's embedding prices?

On price per token, DeProcess matches OpenAI's text-embedding-3-small. OpenAI's pricing page lists text-embedding-3-small at $0.02 per million tokens and text-embedding-3-large at $0.13 per million tokens, checked November 10, 2026. The DePro pricing table lists embeddings at $0.02 per million tokens on the same day.

OptionPrice per 1M tokensChecked
DeProcess embeddings$0.02November 10, 2026 (DePro docs)
OpenAI text-embedding-3-small$0.02November 10, 2026 (OpenAI pricing page)
OpenAI text-embedding-3-large$0.13November 10, 2026 (OpenAI pricing page)

So for embeddings, the choice isn't about price against text-embedding-3-small. Choose on fit: OpenAI publishes benchmark scores and an 8,192-token maximum input for its models in its embeddings guide, which helps if you need a documented, fixed model. DeProcess runs an open-source model on its network, and it suits teams that want one OpenAI-compatible API for embeddings, transcription and chat, or that want jobs to run only on their own computers through a private pool or on-site install.

How do you run embeddings in batches?

Send lists of chunks, not one chunk per request. The DePro embeddings endpoint takes one string or a list of up to 256 (embeddings docs), in OpenAI's format, so the official SDK works after you change the base URL:

For a big indexing run, plain HTTP gives you more control. Requests that take longer than about 50 seconds come back as 202 with a job id instead of the vectors; the SDK doesn't wait for those, but a short loop can. This JavaScript version (Node 18 or later, no libraries) sends 256 chunks at a time and polls any batch that comes back as 202:

We ran this loop with Node 22 on November 10, 2026 against a local server that answers in the DePro formats, including the 202 path. The job status endpoint returns data with the vectors for embedding jobs, as the job status docs describe.

What else keeps a batch run cheap and safe?

A few habits save money and rework:

When is a different setup the better fit?

If you need a specific embedding model with published benchmark scores, a fixed long input limit or features the DePro API doesn't list, use a provider that documents those. If your library is small and changes rarely, any provider's cost will be tiny and convenience should decide. DeProcess fits best when you have a large library to index in the background, want the same low price for re-indexing runs, or need the work to stay on computers you control. The same batch approach works for testing models: see how to run thousands of LLM evals cheaply and reproducibly.

Frequently asked questions

How many tokens is one page?

It depends on the text and the tokenizer. OpenAI's embeddings guide uses about 800 tokens per page for its pricing examples; dense legal or technical text can run higher. Count a sample of your own documents to get a real figure.

Do I pay again when someone searches?

Yes, but very little. Each search embeds the question, which is usually a few dozen tokens. A thousand questions a day at 20 tokens each is 600,000 tokens a month, about $0.01 at $0.02 per million tokens.

Is the vector database included in the embedding price?

No. The embedding API turns text into vectors; storing and searching them is a separate cost, whether you use a hosted vector database or Postgres with a vector extension.

How big should chunks be?

There is no single right size. Smaller chunks give more precise matches but more vectors to store; larger chunks keep more context. Start with a few hundred tokens, test retrieval on real questions and adjust.

Sources

  1. OpenAI: Vector embeddings guide (tokens per page, cl100k_base, max input)
  2. OpenAI: API pricing (embedding models)
  3. PyPI: tiktoken 0.14.0 (README: about 4 bytes per token)
  4. Hugging Face: Tokenization algorithms (Transformers docs)
  5. DeProcess: API docs (embeddings, job status, pricing)

Have recordings to transcribe?

Test DeProcess on your own audio. Ask for a free 10-hour test, or start with the free credit every new account gets. Same API format as OpenAI.

Start a free test

Have a computer that sits idle?

Install the DePro app and your computer works on AI jobs while you’re away. Free to join, about five minutes to set up.

Join with your computer

Related guides

About this guide

Last reviewed . Written by Sydney Kibuuka, Founder, researched and drafted with AI and checked by automated quality checks before it was published. Facts about other companies come from their own published pages, with dates. Read our editorial standards; spotted a mistake? Tell us and we’ll fix it (see corrections).