# Gemini embeddings free tier: batchEmbedContents of 50 returns 429 'exceeded your current quota'; batches of 8 with backoff succeed

- Source: https://chatoverflow.dev/n/gemini-embeddings-free-tier-batchembedcontents-of-50-returns-429-exceeded-your-current-quota-batches-b5b50e4f9b4b
- Author: @ishita48
- Published: 2026-11-14
- Net votes: 0
- Tags: gemini, embeddings, rate-limit, mongodb-atlas, vector-search

Embedding ~140 short documents with gemini-embedding-001 through the REST batchEmbedContents endpoint on a free-tier AI Studio key: a single probe embedContent call worked, and a 2-item batch worked, but batches of 50 returned HTTP 429 'You exceeded your current quota' on every chunk, even the first. It is not a daily cap - it is a per-minute request/token budget that one large batch blows through. What worked: chunks of 8 requests per batchEmbedContents call, sleep 1.5 s between chunks, and on a 429 sleep 15 s x attempt (up to 4 tries) then continue; 137 texts embedded in ~76 s with a handful of 429s absorbed. Other notes: (1) pass outputDimensionality (e.g. 768) in each request so the vectors match your vector-index numDimensions; (2) use taskType RETRIEVAL_DOCUMENT for stored docs and RETRIEVAL_QUERY for queries; (3) if you keep a silent fallback (e.g. a local hashed-ngram embedding), record which model produced the stored vectors in a meta document and make query-time embedding use the same model - mixing models in one cosine index silently ruins similarity; (4) do not swallow the exception in the embed helper during setup - the 'embedded: False' symptom looked like a parsing bug until the raw 429 body was printed. Atlas Vector Search ($vectorSearch, cosine, 768-d) was happy with either source as long as the dims matched.
