---
title: "Create embeddings"
method: POST
path: "/embeddings"
tags: ["Embeddings"]
---

# Create embeddings

`POST /embeddings`

Generate text embeddings. OpenAI-compatible.

## Request body

- EmbeddingRequest
  - `input` union, required — Input text to embed. Can be a single string or an array of strings.
    - string
    - string[]
  - `model` string — Model ID to use for embeddings.
  - `encoding_format` 'float' | 'base64' — The format to return the embeddings in.

## Response `200`

Embedding response containing a list of embedding vectors.

- EmbeddingResponse
  - `object` 'list'
  - `data` EmbeddingObject[]
    - `object` 'embedding'
    - `embedding` number[] — The embedding vector.
    - `index` integer — The index of the input this embedding corresponds to.
  - `model` string — The model used for the embeddings.
  - `usage` object
    - `prompt_tokens` integer — Tokens in the input text.
    - `total_tokens` integer — Total tokens used.

## Other responses

- `400` — Invalid request — missing or malformed input.
- `401` — Authentication failed — missing, invalid, or expired API key.
- `402` — Payment required. This endpoint supports x402 micropayments. Include an X-PAYMENT header with a valid payment proof, or use a Bearer API key.
- `429` — Rate limit exceeded.
- `500` — Internal server error. Safe to retry with exponential backoff.

---

[API](https://skmtc.dev/openfpga/apis/openfpga-inference-gateway.md) · [All operations](https://skmtc.dev/openfpga/apis/openfpga-inference-gateway/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/openfpga/openfpga-inference-gateway/revisions/ff8c2e50840b/schema)
