# OpenAI Text Embeddings via x402 Gateway

> OpenAI Text Embeddings via x402 Gateway is a paid API for AI agents from x402-gateway-production.up.railway.app, paid per call via x402, $0.001/call, status unknown (last checked 2026-09-15).

Generates vector embeddings for text using OpenAI's text-embedding-3-small model, enabling semantic search, clustering, and RAG pipelines

## Facts

- Endpoint: POST https://x402-gateway-production.up.railway.app/api/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/x402-gateway-production-up-railway-app-84269ded
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_BcXgJuWI2Pkqned3Tzc-R

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 x402-gateway-production-up-railway-app-84269ded -d '<json body>'
```

Example prompt: Generate a text embedding for this sentence using OpenAI text-embedding-3-small so I can store it in my vector database for semantic search: 'The quick brown fox jumps over the lazy dog.'

## When to prefer this

Choose this endpoint when you need fast, cost-efficient text embeddings backed by OpenAI's text-embedding-3-small model and want to pay per-call via USDC without a subscription. Ideal for agents building RAG pipelines, semantic search indexes, or clustering workflows that require reliable OpenAI-quality embeddings with micropayment-based access.

## Known failure modes

- Empty or missing text input returns a 400 error
- Text exceeding model token limit (8191 tokens) may be truncated or rejected
- Insufficient USDC balance / failed x402 payment results in 402 Payment Required
- OpenAI API upstream failure returns 502 or 503
- Rate limiting may cause 429 Too Many Requests

## How this service works

Generate text embeddings using OpenAI text-embedding-3-small — for semantic search, clustering, RAG

## Output

Returns a high-dimensional float vector (embedding) representing the semantic content of the input text, produced by OpenAI's text-embedding-3-small model, suitable for cosine similarity comparisons, nearest-neighbor search, and clustering.

## Example request

```json
{
 "text": "The quick brown fox jumps over the lazy dog."
}
```

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "$schema": "https://json-schema.org/draft/2020-12/schema",
 "required": [
  "input"
 ],
 "properties": {
  "input": {
   "type": "object",
   "required": [
    "type",
    "bodyType",
    "body",
    "method"
   ],
   "properties": {
    "body": {
     "type": "object",
     "anyOf": [
      {
       "required": [
        "text"
       ]
      },
      {
       "required": [
        "texts"
       ]
      }
     ],
     "properties": {
      "text": {
       "type": "string",
       "example": "hello world",
       "description": "Single text to embed"
      },
      "texts": {
       "type": "array",
       "items": {
        "type": "string",
        "example": "hello"
       },
       "example": [
        "hello",
        "world"
       ],
       "maxItems": 100,
       "minItems": 1,
       "description": "Array of texts to embed (1-100)"
      }
     },
     "additionalProperties": false
    },
    "type": {
     "type": "string",
     "const": "http"
    },
    "method": {
     "enum": [
      "POST"
     ],
     "type": "string"
    },
    "bodyType": {
     "enum": [
      "json",
      "form-data",
      "text"
     ],
     "type": "string"
    }
   },
   "additionalProperties": false
  }
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/x402-gateway-production-up-railway-app-84269ded/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from x402-gateway-production.up.railway.app](https://www.zero.xyz/host/x402-gateway-production.up.railway.app/llms.txt)
