# fastapi.online Text Embeddings

> fastapi.online Text Embeddings is a paid API for AI agents from api.fastapi.online, paid per call via x402, $0.001/call, status unknown (last checked 2026-09-15).

Converts a text string into a dense vector embedding using a configurable model, returned as an array of floats

## Facts

- Endpoint: POST https://api.fastapi.online/embeddings
- Price: $0.001/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-15
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/fastapi-online-text-embeddings-63bc8a8b
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_i7KpI2WRkQVafRDMCiqHh

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 fastapi-online-text-embeddings-63bc8a8b -d '<json body>'
```

Example prompt: Embed this text using fastapi.online so I can store it in my vector database: 'The quick brown fox jumps over the lazy dog'

## When to prefer this

Choose this endpoint when you need pay-per-call text embeddings with no signup or subscription — ideal for sporadic or low-volume embedding needs, or when you want to pay with crypto (USDC) rather than a monthly API key. Prefer established providers like OpenAI or Cohere for high-volume production workloads with SLA guarantees.

## Known failure modes

- Missing required 'input' field returns a 422 validation error
- Invalid or unsupported model name may return an error or fall back to default model
- Payment not included or insufficient USDC results in 402 Payment Required response
- Very long input strings may exceed model token limits
- Network timeouts on the self-hosted infrastructure during high load

## How this service works

Self-hosted AI API gateway. Expensive endpoints require an x402 micropayment (USDC on Base) before executing.

## Output

Returns a JSON object containing an array of embedding vectors (each a list of floats), the model name used, and a token count indicating how many tokens were processed

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "$schema": "https://json-schema.org/draft/2020-12/schema",
 "required": [
  "input"
 ],
 "properties": {
  "input": {
   "type": "object",
   "required": [
    "type",
    "method",
    "bodyType",
    "body"
   ],
   "properties": {
    "body": {
     "type": "object",
     "required": [
      "input"
     ],
     "properties": {
      "input": {
       "anyOf": [
        {
         "type": "string"
        },
        {
         "type": "array",
         "items": {
          "type": "string"
         }
        }
       ]
      },
      "model": {
       "type": "string"
      }
     }
    },
    "type": {
     "type": "string",
     "const": "http"
    },
    "method": {
     "enum": [
      "POST"
     ],
     "type": "string"
    },
    "bodyType": {
     "enum": [
      "json",
      "form-data",
      "text"
     ],
     "type": "string"
    }
   },
   "additionalProperties": false
  },
  "output": {
   "type": "object",
   "required": [
    "type"
   ],
   "properties": {
    "type": {
     "type": "string"
    },
    "example": {
     "type": "object"
    }
   }
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "count": 1,
  "model": "nomic-embed-text",
  "embeddings": [
   [
    0.012,
    -0.034
   ]
  ]
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/fastapi-online-text-embeddings-63bc8a8b/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from api.fastapi.online](https://www.zero.xyz/host/api.fastapi.online/llms.txt)
