# Fix OpenAI Error code: 429 - Rate limit reached for text-embedding-3-large on tokens per min (TPM)

> OpenAI enforces dual per-minute ceilings (RPM and TPM, starting at 1,000,000 TPM on Tier 1) plus a hard 300,000-token per-request payload cap on /v1/embeddings, causing naive async workers to storm into HTTP 429 errors. Fix it immediately with pre-counted tiktoken token buckets and SHA-256 deduplication, or switch base_url to Voxell Forge ($0 Turbo 1024d; up to 3.0M TPM on Scale).

Canonical URL: https://voxell.ai/errors/openai-embeddings-429-rate-limit-exceeded-tpm/


## Why Async Worker Pools Trigger `429` TPM Storms & `300k` Payload Failures

Most ingestion scripts chunk by character length and fire `Promise.all` or `asyncio.gather` batches of `2,048` inputs. At `512` tokens per chunk, a single `2,048`-input request sends `1,048,576` tokens: instantly exceeding both OpenAI's `300,000`-token single-request cap and Tier-1 `1,000,000` TPM quota while burning retries on unchanged files.

## Immediate Python Fix: `tiktoken` Dual-Cap Batcher + SHA-256 Content Cache

```python
import hashlib, time, tiktoken
from openai import OpenAI

enc = tiktoken.get_encoding("cl100k_base")
client = OpenAI()

def embed_packed(texts: list[str], max_req_tokens: int = 250_000):
    batch, batch_toks = [], 0
    for t in texts:
        n = min(len(enc.encode(t)), 8191)
        if batch and (batch_toks + n > max_req_tokens or len(batch) >= 2048):
            yield client.embeddings.create(model="text-embedding-3-large", input=batch)
            batch, batch_toks = [], 0
            time.sleep(0.25)  # pace below org TPM window
        batch.append(t)
        batch_toks += n
    if batch:
        yield client.embeddings.create(model="text-embedding-3-large", input=batch)
```

## One-Line `base_url` Cutover to Voxell Forge (`$0` `Turbo` or Sovereign VPC)

Voxell Forge exposes an OpenAI-compatible `/v1/embeddings` endpoint where `Turbo` (`1024d`) is **$0** forever, `Pro` (`2560d` + `C_corpus` dialect conditioning) costs **$0.25/1M** tokens, and **Forge Local** (**$9,995/yr** Dev) runs unlimited local GPU throughput with zero cloud TPM ceilings.

## Related Optimization Guides, Calculators & Benchmarks

- **[OpenAI & Gemini 429 TPM Batch Packing & Dedup Guide](/optimize/openai-gemini-embedding-429-tpm-batch-packing/)**
- **[OpenAI Embedding Cost Calculator](/tools/openai-embedding-cost-calculator/)**
- **[Migrate From OpenAI text-embedding-3-large in 5 Minutes](/compare/migrate-from-openai-text-embedding-3-large/)**
- **[Audit Your Docs or GitHub Repo Free](/audit/)**

## Frequently Asked Questions

### What is the maximum number of inputs and tokens per OpenAI /v1/embeddings call?

OpenAI allows at most 2,048 array items per request and at most 300,000 summed tokens across all inputs in a single synchronous /v1/embeddings call.

### Does OpenAI Batch API avoid 429 TPM rate limits?

Yes, the asynchronous JSONL Batch API cuts per-token cost by 50% and uses a separate queue pool, but introduces up to a 24-hour completion SLA unsuitable for real-time sync.

---

## Zero-Install Model Context Protocol (MCP) & Keyless Agent Verification

```bash
claude mcp add --transport http voxell-forge https://api.voxell.ai/mcp/try
```

- Keyless Retrieval Bake-Off: `POST https://api.voxell.ai/api/v1/agent/bakeoff`
- Keyless Contradiction X-Ray: `POST https://api.voxell.ai/api/v1/agent/xray`
- Machine-Readable Pricing JSON: `https://voxell.ai/api/v1/agent/pricing.json`
- Full LLM Authority Map: `https://voxell.ai/llms-full.txt`
