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

# Create Embeddings

`POST /api/v1/embeddings`

## Request

- The document declares no server URL.
- Auth: API key in header `Authorization`

Create embeddings for the given input text(s).

This endpoint creates embeddings using the Morpheus Network providers.
It automatically manages sessions and routes requests to the appropriate embedding model.

Billing is applied to all requests:
- Balance is checked before the request starts
- 402 Payment Required is returned if insufficient credits
- Usage is finalized after completion with actual token counts
- Holds are voided on failures

## Request body

- EmbeddingRequest: Request model for embeddings endpoint
  - `input` union, required
    - string
    - string[]
  - `model` string
  - `encoding_format` string
  - `dimensions` integer
  - `user` string
  - `session_id` string

## Response `200`

Successful Response

- EmbeddingResponse: Response model for embeddings endpoint
  - `object` string
  - `data` EmbeddingObject[], required
    - `object` string
    - `embedding` number[], required
    - `index` integer, required
  - `model` string, required
  - `usage` EmbeddingUsage, required: Usage statistics for embedding request
    - `prompt_tokens` integer, required
    - `total_tokens` integer, required

## Other responses

- `422`: Validation Error

## Changes

- **2026-05-22** `6059f99c1875`: 1 breaking, 3 info
  - request body became required
  - added the new optional request property `dimensions`
  - the `input` request property default value `Sample text to generate embeddings` was removed
  - request property `input` list-of-types was widened by adding types `array` to media type `application/json`
- **2026-01-14** `ff8a4cf14cca`: 1 warning
  - removed the request property `dimensions`
- **2025-10-27** `84f9777ac275`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/morpheusais/apis/morpheus-api-gateway/changes/api/v1/embeddings/post.md)

---

[API](https://skmtc.dev/morpheusais/apis/morpheus-api-gateway.md) - [All operations](https://skmtc.dev/morpheusais/apis/morpheus-api-gateway/llms.txt) - [OpenAPI document](https://skmtc.dev/morpheusais/apis/morpheus-api-gateway/revisions/6059f99c1875?raw)
