# Text Embedding 004 API — pricing & specs

Text Embedding 004 is a Google model that turns text into vectors for semantic search and retrieval, with up to 768 dimensions. On KeepRouter, Text Embedding 004 costs $0.002000 per 1M input tokens and $0.002000 per 1M output tokens, billed pay-as-you-go with no monthly fee; actual request cost depends on measured token usage. Call it through a compatible KeepRouter endpoint supported by its active route, with the model id `text-embedding-004`.

| Spec | Value |
|---|---|
| Maker | Google |
| Modality | Text embeddings |
| Context window | 2,048 tokens |
| Input price | $0.002000 per 1M tokens |
| Output price | $0.002000 per 1M tokens |
| Capabilities | Text embeddings |
| Endpoint | POST /v1/embeddings |
| Model id | `text-embedding-004` |

## Call it via embeddings endpoint

Send embedding requests to POST /v1/embeddings.

### cURL

```bash
curl https://keeprouter.com/v1/embeddings \
  -H "Authorization: Bearer $KEEPROUTER_KEY" -H "Content-Type: application/json" \
  -d '{"model":"text-embedding-004","input":"The quick brown fox"}'
```

### Python

```python
import os
from openai import OpenAI
client = OpenAI(base_url="https://keeprouter.com/v1", api_key=os.environ["KEEPROUTER_KEY"])
e = client.embeddings.create(model="text-embedding-004", input="The quick brown fox")
```

### JavaScript

```js
const res = await fetch("https://keeprouter.com/v1/embeddings", {
  method: "POST",
  headers: { Authorization: "Bearer " + process.env.KEEPROUTER_KEY, "Content-Type": "application/json" },
  body: JSON.stringify({ model: "text-embedding-004", input: "The quick brown fox" }),
});
```

## Estimate API costs

At the current KeepRouter customer price, an example workload of 1,000 total input tokens, no cached input, and 0 output tokens per request costs approximately $0.000002 per request. At 100 requests per day, that is $0.006000 over 30 days. This is a usage estimate, excluding processing fees, taxes, retries and application infrastructure. Actual usage, cache hits and supported generation durations need their own checks.

[Adjust quantities in the API cost calculator](/tools/api-cost-calculator?model=text-embedding-004).

## Model identity and official sources

Sources checked 2026-09-29.

### Who makes this model?

Google's Text Embedding 004 converts text into numerical vectors for semantic search and retrieval. It returns embeddings rather than a conversational answer.

[Google Cloud · embedding models](https://docs.cloud.google.com/gemini-enterprise-agent-platform/build/vector-search-2/embeddings/autogenerating-embeddings)

### Documented model limits

Google Cloud lists a 2,048-token maximum input sequence and up to 768 output dimensions for English and code tasks. Confirm returned dimensions before writing to an existing vector index.

[Google Cloud · embedding models](https://docs.cloud.google.com/gemini-enterprise-agent-platform/build/vector-search-2/embeddings/autogenerating-embeddings)

### Service-specific lifecycle

The Gemini API lists shutdown on January 14, 2026. Google Cloud separately lists retirement on April 1, 2027. These are different serving platforms. A KeepRouter catalog listing and configured route do not establish current successful inference or identify which Google platform a route uses. Validate a small request before a migration; changing embedding models requires rebuilding the index.

[Google · Gemini API deprecations](https://ai.google.dev/gemini-api/docs/deprecations) · [Google Cloud · model lifecycle](https://docs.cloud.google.com/gemini-enterprise-agent-platform/models/model-versions)

## How to evaluate Text Embedding 004

Text Embedding 004 is listed on KeepRouter as text embeddings under the exact id `text-embedding-004`. Use /v1/embeddings for the listed route; a maker's upstream features do not automatically apply to this gateway endpoint. The published context window is 2,048 tokens. These are limits, not a recommended request size.

**First workload:** Embed a small, labeled set of your own documents and queries; measure retrieval recall and index size before migrating the full corpus.

**Before production:** Keep query and document embeddings on the same model and version. Re-index after a model change rather than mixing incompatible vector spaces.

## Public model usage evidence

No public, exact-variant usage figure has been verified for this KeepRouter model id. Missing data is not zero usage; family-level or maker-wide traffic is not presented as this model's traffic.

## Published examples and cases

No exact-model customer case has been verified for this entry. The workload above is an evaluation recipe, not a claim of a public deployment.

## Source and verification boundary

[Official Text Embedding 004 documentation](https://docs.cloud.google.com/gemini-enterprise-agent-platform/build/vector-search-2/embeddings/autogenerating-embeddings). KeepRouter's live catalog is authoritative for the customer price and enabled endpoint shown here; the maker remains authoritative for upstream model capabilities and limits.

## Pricing and implementation guides

- [Calculate your API workload cost](https://keeprouter.com/tools/api-cost-calculator)
- [KeepRouter API keys: move from free to paid models](https://keeprouter.com/blog/keeprouter-api-key-free-to-paid)

## Related models

- [gemini-embedding-001](https://keeprouter.com/models/gemini-embedding-001.md) by Google DeepMind — $0.1500 per 1M input tokens and $0.6000 per 1M output tokens
- [Veo 3.1](https://keeprouter.com/models/veo-3.1.md) by Google DeepMind — $0.4000 per second of video
- [Seedream 5.0 Lite](https://keeprouter.com/models/seedream-5-0-lite.md) by ByteDance — $0.0350 per image
- [Veo 3.1 (1080p)](https://keeprouter.com/models/veo-3.1-1080p.md) by Google DeepMind — $0.4000 per second of video
- [Seedream 4.5](https://keeprouter.com/models/seedream-4-5.md) by ByteDance — $0.0400 per image
- [Veo 3.1 (4K)](https://keeprouter.com/models/veo-3.1-4k.md) by Google DeepMind — $0.6000 per second of video

## More

- [All models & pricing](https://keeprouter.com/models.md)
- [Quickstart](https://keeprouter.com/docs/quickstart.md)
- [Get an API key](https://keeprouter.com/login?returnTo=%2Fconsole%2Fkeys%3Fmodel%3Dtext-embedding-004)

_Catalog facts and prices last changed 2026-10-03._
_Page content reviewed 2026-09-28._
