---
title: "POST /v1/embeddings"
method: POST
path: "/v1/embeddings"
---

# POST /v1/embeddings

`POST /v1/embeddings`

Generate embeddings for code

## Request body

- EmbeddingRequest
  - `model` string, required — ID of the model to use for embedding generation
  - `input` string, required — The text to generate embeddings for. Can also be an array of strings for batch processing.
  - `encoding_format` 'float' | 'base64' — The format in which the embeddings are returned

## Response `200`

Embedding response

- EmbeddingResponse
  - `object` string, required — Object type
  - `data` object[], required — List of embedding objects
    - `object` string — Object type
    - `embedding` number[] — The embedding vector
    - `index` integer — Index of the embedding in the list
  - `model` string, required — ID of the model used
  - `usage` object, required — Usage statistics
    - `prompt_tokens` integer — Number of tokens in the prompt
    - `total_tokens` integer — Total number of tokens used

## Other responses

- `400` — Bad request error
- `401` — Authentication error

---

[API](https://skmtc.net/morphllm/apis/morph-api.md) · [All operations](https://skmtc.net/morphllm/apis/morph-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/morphllm/morph-api/versions/9e3d888071b5/schema)
