Processing 5,000 lines of code (~56,000 tokens) with Text Embedding 004 costs $0.00112 for codebase ingestion and $0.00112 for an AI-powered code review and refactoring pass.
Feed 5,000 lines of code into the prompt context for repository search, Q&A, or architecture planning.
Ingest 5,000 lines of code and generate audit findings, unit test recommendations, and refactor diffs.
Text Embedding 004 writes 5,000 lines of code from scratch based on product specifications.
| Model | Provider | Code Ingestion | Cached Ingestion | Code Review Cost | Context Limit |
|---|---|---|---|---|---|
| Text Embedding 004 (Current) | $0.00112 | $0.00028 | $0.00112 | 8,192 | |
| Text Embedding 3 (Small) | openai | $0.00112 | $0.00028 | $0.00112 | 8,191 |
| Text Embedding 3 (Large) | openai | $0.00728 | $0.00182 | $0.00728 | 8,191 |
On average, code yields approximately 11.2 tokens per line in Text Embedding 004 (sentencepiece tokenizer). Indentation, brackets, camelCase variable names, and comments slightly increase token density compared to plain English text. 5,000 lines of code produces approximately 56,000 tokens.
Sending 5,000 lines of code as context and generating a thorough code review with recommendations costs approximately $0.00112. Utilizing prompt caching on repeat turns or static repository definitions drops this to $0.00028.
Text Embedding 004 has a context window of 8,192 tokens. 5,000 lines of code consumes 683.59% of its total available context.