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

# Create embeddings

`POST /embeddings`

## Request

- Base URL: `https://www.aimagicx.com/api/v1`
- URL: `https://www.aimagicx.com/api/v1/embeddings`
- Auth: HTTP bearer

Creates an embedding vector representing the input text.

## Request body

- EmbeddingRequest
  - `input` union, required: Text to embed
    - string
    - string[]
  - `model` string
  - `dimensions` integer: Output dimensions

## Response `200`

Successful response

- EmbeddingResponse
  - `object` 'list'
  - `data` object[]
    - `object` 'embedding'
    - `index` integer
    - `embedding` number[]
  - `model` string
  - `usage` object
    - `prompt_tokens` integer
    - `total_tokens` integer

## Other responses

- `400`: Bad request - invalid parameters
- `401`: Unauthorized - invalid or missing API key

---

[API](https://skmtc.dev/aimagicx/apis/ai-magicx-api.md) - [All operations](https://skmtc.dev/aimagicx/apis/ai-magicx-api/llms.txt) - [OpenAPI document](https://skmtc.dev/aimagicx/apis/ai-magicx-api/revisions/08210272abb4?raw)
