# x402ai Text Embedding API

> x402ai Text Embedding API is a paid API for AI agents from api.x402ai.dev, paid per call via x402, $0.01/call, status unknown (last checked 2026-10-02).

Generates a vector embedding for a given text string, paid per-call via x402 on Base mainnet at $0.01 USDC.

## Facts

- Endpoint: POST https://api.x402ai.dev/api/embed?utm_source=zero.xyz
- Price: $0.01/call
- Payment: x402
- Status: unknown
- Last checked: 2026-10-02
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/x402ai-text-embedding-api-5004873a
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_oRfXb25RBWlRxJjFQ_X-9

Status and success rate cover calls made through Zero and Zero's own probes. Third-party monitors may report differently.

## How to call it through Zero

Zero handles the 402 payment challenge and records the run. With the Zero CLI installed (`npm i -g @zeroxyz/cli`):

```sh
zero fetch --capability x402ai-text-embedding-api-5004873a -d '<json body>'
```

Example prompt: Embed this sentence for me so I can store it in my vector database: 'How do I reset my password?'

## When to prefer this

Choose this endpoint when you need on-demand, pay-per-call text embeddings without a subscription or API key — ideal for low-volume, agent-driven workflows that already use the x402 micropayment protocol on Base mainnet. It is especially appropriate when your agent stack handles x402 payments natively and you want a stateless, per-request embedding call without managing OpenAI or Cohere billing accounts.

## Known failure modes

- Payment not included or insufficient — returns 402 Payment Required
- Input field missing or empty — returns 400 Bad Request
- Input text too long for model context window — may return 400 or truncation error
- Network or upstream model failure — returns 500 Internal Server Error
- Invalid USDC payment on Base mainnet — payment rejected before inference runs

## How this service works

Convert text into a 768-dimension embedding vector (nomic-embed-text) for semantic search, RAG retrieval, clustering, deduplication or similarity scoring. POST JSON {"input": string}, up to 3000 characters; returns {embedding: number[768], model, dimensions, elapsed_ms}. One text per call; English works best.

## Output

Returns a JSON object with an 'embedding' field containing an array of floating-point numbers representing the dense vector encoding of the input text. The vector can be used for semantic similarity, clustering, classification, or storage in a vector database.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "required": [
  "input"
 ],
 "properties": {
  "input": {
   "type": "string",
   "description": "Text to embed"
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "object",
 "required": [
  "embedding"
 ],
 "properties": {
  "embedding": {
   "type": "array",
   "items": {
    "type": "number"
   }
  }
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/x402ai-text-embedding-api-5004873a/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from api.x402ai.dev](https://www.zero.xyz/host/api.x402ai.dev/llms.txt)
