# Create text embeddings with LLM API's embeddings API

LLM API's embeddings endpoint turns a string or a list of strings into vectors with Text Embedding 3 Small, Text Embedding 3 Large or Jina Embeddings v4, all through one request shape. Text Embedding 3 Small costs $0.019 per million tokens, billed by exact input token from the same prepaid credit balance that pays for chat calls. Send `POST https://agents.llmapi.ai/zcj/hyo62a9yztq9/zc/v1/embeddings` with `model`, `input` and an agent bearer credential that holds credit.

## At a glance

- **Endpoint:** `POST https://agents.llmapi.ai/zcj/hyo62a9yztq9/zc/v1/embeddings`
- **Body:** `model` (`text-embedding-3-small`, `text-embedding-3-large` or `jina-embeddings-v4`) and `input` (a string or a list of strings). Both are required.
- **Price per million input tokens:** Text Embedding 3 Small $0.019 per million tokens; Text Embedding 3 Large $0.1235 per million tokens; Jina Embeddings v4 $0.019 per million tokens
- **Context per input:** 8K tokens for both Text Embedding 3 models, 32K tokens for Jina Embeddings v4
- **Payment:** calls draw on Prepaid credit (minimum $0.50), bought with an agent bearer credential over x402, MPP or card. No provider API key.
- **Response:** `data[].embedding`, `data[].index`, `model`, `usage.prompt_tokens`, `usage.total_tokens`
- **Full purchase flow:** [the buyer skill](https://agents.llmapi.ai/zcj/hyo62a9yztq9/SKILL.md)

## Choose an embeddings model

| `model` | Context per input | Price |
| --- | --- | --- |
| `text-embedding-3-small` | 8K | $0.019 per million tokens |
| `text-embedding-3-large` | 8K | $0.1235 per million tokens |
| `jina-embeddings-v4` | 32K | $0.019 per million tokens |

Send one of the three ids in the `model` column exactly as written.

## Embed text with the embeddings API

1. Get a free agent credential and buy prepaid credit once, from $0.50 by wallet or $0.50 by card. [The buyer skill](https://agents.llmapi.ai/zcj/hyo62a9yztq9/SKILL.md) covers each step.

2. Send the embeddings request with the access token:

   ```bash
   curl -s https://agents.llmapi.ai/zcj/hyo62a9yztq9/zc/v1/embeddings \
     -H "Authorization: Bearer $ACCESS_TOKEN" \
     -H "Content-Type: application/json" \
     -d '{"model": "text-embedding-3-small", "input": ["pay per call for an API", "prepaid credit for model calls"]}'
   ```

3. Read the vectors and the usage. The response is a JSON object with `object`, `data`, `model` and `usage`, where `data` holds one entry per input, each with `object`, `embedding` and `index`. It has this shape:

   ```text
   {
     "object": <string>,
     "data": [
       {"object": <string>, "embedding": [<number>, ...], "index": <number>},
       {"object": <string>, "embedding": [<number>, ...], "index": <number>}
     ],
     "model": <string>,
     "usage": {"prompt_tokens": <number>, "total_tokens": <number>}
   }
   ```

   Each Text Embedding 3 Small embedding in this example is a list of 1,536 numbers. Store each vector with its `index` and the `model` that produced it.

4. Check what the call drew. The `zc-billing` response header on a credit-funded call carries `fundingSource`, `chargedUsd` (what your balance was debited for this request) and `remainingCreditUsd` (your balance after it). The example embedded both phrases for 12 input tokens in all.

## Budget an embeddings job

Cost is input tokens times the model's rate.

| Job | Text Embedding 3 Small | Text Embedding 3 Large | Jina Embeddings v4 |
| --- | --- | --- | --- |
| 1,000 inputs of 500 tokens (500,000 tokens) | $0.0095 | $0.06175 | $0.0095 |
| 10,000 inputs of 500 tokens (5 million tokens) | $0.095 | $0.6175 | $0.095 |

## Limits and billing

- The endpoint takes `model` and `input`. `model` accepts only the three ids above.
- Each input must fit the model's context: 8K tokens for the Text Embedding 3 models, 32K for Jina Embeddings v4.
- There is no per-call payment. A call without a credential answers `401 bearer_required`, and one whose credential holds no covering plan answers `403 plan_required`.
- Calls are never quoted a per-call price. The priced 402 belongs to the credit purchase, and paying it completes the purchase. Calls then draw the balance by exact input token, and unused credit stays on the balance.
- Every input token is charged. The catalog lists no included tokens.
- Credit bought with an anonymous credential lasts only as long as that credential, which expires within days unless claimed. Claim the credential to a verified email, as [auth.md](https://agents.llmapi.ai/zcj/hyo62a9yztq9/auth.md) describes, to keep the balance.

## Errors

| Response | Meaning | Action |
| --- | --- | --- |
| `401 bearer_required` | The call carried no agent credential | Register at [auth.md](https://agents.llmapi.ai/zcj/hyo62a9yztq9/auth.md), then retry with `Authorization: Bearer <token>` |
| `401 invalid_token` (`token_expired`) | The access token expired | Exchange the stored assertion for a fresh token and retry |
| `403 plan_required` | The credential holds no credit for this call | Buy Prepaid credit at the `purchase.url` in the body's `plans`, then retry |
| `usage_exhausted` | The credit balance ran out | Top up with `POST https://agents.llmapi.ai/zcj/hyo62a9yztq9/extend` and `{"amountUsd": "..."}` |
| `400 amount_below_minimum` | A credit purchase was under the plan minimum | Send at least $0.50 |
| `400 invalid_request` | The request body is malformed | Fix the JSON |

## Frequently asked questions

### Which embeddings models does the LLM API storefront offer?

Three: `text-embedding-3-small`, `text-embedding-3-large` and `jina-embeddings-v4`, all on `POST https://agents.llmapi.ai/zcj/hyo62a9yztq9/zc/v1/embeddings`. Each is priced at 5% off its list price.

### Do I need an account with each model provider to get embeddings?

No. The storefront needs no provider API key. Each call carries the agent bearer credential the storefront issues, and the cost comes out of your Prepaid credit balance.

### Can I embed several texts in one request?

Yes. Set `input` to a list of strings, and `data` returns one entry per input. The example request embeds two phrases in one call.

### How much does the embeddings API cost per token?

Text Embedding 3 Small costs $0.019 per million tokens, Text Embedding 3 Large $0.1235 per million tokens and Jina Embeddings v4 $0.019 per million tokens. Only input tokens are billed, from the same balance that pays for the storefront's chat models.

### Can I pay for a single embeddings call without buying credit?

No. Every call draws on Prepaid credit, and the smallest purchase is $0.50. Small jobs use a fraction of that, and the rest stays on the balance for later calls.

## Keep reading

- [Buyer skill](https://agents.llmapi.ai/zcj/hyo62a9yztq9/SKILL.md): the full purchase flow
- [Identity](https://agents.llmapi.ai/zcj/hyo62a9yztq9/auth.md): register, exchange and claim a credential
- [How to pay](https://agents.llmapi.ai/zcj/hyo62a9yztq9/payment.md): x402, MPP, card and top-ups
- [Error reference](https://agents.llmapi.ai/zcj/hyo62a9yztq9/errors.md): every error code
- [Catalog](https://agents.llmapi.ai/zcj/hyo62a9yztq9/manifest.json): live services, plans and prices

---

Updated 2026-10-28. All LLM API guides: https://agents.llmapi.ai/guides.md. Storefront: https://agents.llmapi.ai/zcj/hyo62a9yztq9/llms.txt.
