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

# Create Embedding

`POST /embeddings`

Create embeddings for a given string or list of strings

## Request body

- CreateEmbeddingRequest
  - `model` union
    - string
    - Model
      - `name` string, required
      - `extra_headers` object, nullable
      - `options` object, nullable
    - object
    - union[]
      - union
        - string
        - Model
          - `name` string, required
          - `extra_headers` object, nullable
          - `options` object, nullable
        - object
  - `input` union, required — The input to embed, can be a single string or a list of strings
    - string
    - string[]

## Response `200`

Successful Response

- CreateEmbeddingResponse
  - `model` string, required — The model that was used to create the embedding
  - `data` object[], required — The embedding data
  - `usage` object, required — The usage information

## Other responses

- `400` — Bad Request
- `401` — Unauthorized
- `402` — Payment Required (out of credits)
- `404` — Not Found
- `422` — Request validation error
- `502` — Service unavailable due to downstream embedding provider error

---

[API](https://skmtc.dev/opper/apis/opper-api-v2.md) · [All operations](https://skmtc.dev/opper/apis/opper-api-v2/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/opper/opper-api-v2/revisions/d3ccdaa15678/schema)
