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

# Create Embeddings

`POST /v1/embeddings`

Creates an embedding vector representing the input text.

Get a vector representation of a given input that can be easily consumed by machine learning models and algorithms.

## Request body

- CreateEmbeddingRequest
  - `dimensions` integer, nullable — The number of dimensions the resulting output embeddings should have. Only supported in `text-embedding-3` and later models.
  - `encoding_format` 'float' | 'base64'
  - `input` union, required
    - string
    - string[]
    - integer[]
    - array[]
      - integer[]
  - `model` string, required — ID of the model to use. You can use the [List models](https://platform.openai.com/docs/api-reference/models/list) API to see all of your available models, or see our [Model overview](https://platform.openai.com/docs/models) for descriptions of them.
  - `user` string, nullable — A unique identifier representing your end-user, which can help OpenAI to monitor and detect abuse. [Learn more](https://platform.openai.com/docs/guides/safety-best-practices#end-user-ids).

## Response `200`

Embedding created successfully

- CreateEmbeddingResponse
  - `data` Embedding[], required — The list of embeddings generated by the model.
    - `embedding` union, required
      - number[]
      - string
    - `index` integer, required — The index of the embedding in the list of embeddings.
    - `object` string, required — The object type, which is always "embedding".
  - `model` string, required — The name of the model used to generate the embedding.
  - `object` string, required
  - `usage` EmbeddingUsage, required
    - `prompt_tokens` integer, required — The number of tokens used by the prompt.
    - `total_tokens` integer, required — The total number of tokens used by the request.

## Other responses

- `404` — Model not found
- `500` — Internal server error

---

[API](https://skmtc.dev/spiceai/apis/runtime.md) · [All operations](https://skmtc.dev/spiceai/apis/runtime/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/spiceai/runtime/revisions/fb597a4eaa56/schema)
