> ## Documentation Index
> Fetch the complete documentation index at: https://kiosapi.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Create Vector Embeddings from Text — POST /v1/embeddings

> POST /v1/embeddings generates vector embeddings from text for semantic search, clustering, and recommendations. Supports up to 8192 tokens per input.

Use the `/v1/embeddings` endpoint to generate dense vector representations of text. These embeddings capture semantic meaning, making them ideal for powering semantic search, document clustering, similarity scoring, and recommendation systems — all without requiring task-specific model fine-tuning.

## Request

**POST** `https://kiosapi.com/v1/embeddings`

### Headers

<ParamField header="Content-Type" type="string" required>
  Must be `application/json`.
</ParamField>

<ParamField header="Authorization" type="string" required>
  Your API key in the format `Bearer sk-xxx`.
</ParamField>

### Request Body

<ParamField body="model" type="string" required>
  The embedding model to use. Example: `text-embedding-3-large`.
</ParamField>

<ParamField body="input" type="string | array" required>
  The text to embed. Accepts a single string or an array of strings. Each individual input must not exceed **8192 tokens**.
</ParamField>

### Example Request

<Tabs>
  <Tab title="cURL">
    ```bash theme={null}
    curl https://kiosapi.com/v1/embeddings \
      -H "Content-Type: application/json" \
      -H "Authorization: Bearer sk-xxx" \
      -d '{
        "model": "text-embedding-3-large",
        "input": "The weather is beautiful today"
      }'
    ```
  </Tab>

  <Tab title="Python">
    ```python theme={null}
    import openai

    openai.api_key = "sk-xxx"
    openai.base_url = "https://kiosapi.com/v1/"

    response = openai.embeddings.create(
        model="text-embedding-3-large",
        input="The weather is beautiful today"
    )

    print(response.data[0].embedding[:5])  # First 5 dimensions
    ```
  </Tab>
</Tabs>

## Response

The endpoint returns a JSON object containing the embedding vector(s), the model used, and token usage statistics.

```json theme={null}
{
  "object": "list",
  "data": [
    {
      "object": "embedding",
      "index": 0,
      "embedding": [
        -0.022425562,
        -0.010263717,
        0.022136442,
        0.015323295,
        -0.0013466021
      ]
    }
  ],
  "model": "text-embedding-3-large",
  "usage": {
    "prompt_tokens": 16,
    "total_tokens": 16
  }
}
```

### Response Fields

<ResponseField name="object" type="string">
  Always `"list"`.
</ResponseField>

<ResponseField name="data" type="array">
  An array of embedding objects, one per input string.

  <Expandable title="data[] fields">
    <ResponseField name="data[].object" type="string">
      Always `"embedding"`.
    </ResponseField>

    <ResponseField name="data[].index" type="integer">
      The zero-based position of this embedding in the input array.
    </ResponseField>

    <ResponseField name="data[].embedding" type="array of numbers">
      The embedding vector — an array of floating-point numbers representing the input text in high-dimensional space.
    </ResponseField>
  </Expandable>
</ResponseField>

<ResponseField name="model" type="string">
  The model that was used to generate the embeddings.
</ResponseField>

<ResponseField name="usage.prompt_tokens" type="integer">
  The number of tokens in the input.
</ResponseField>

<ResponseField name="usage.total_tokens" type="integer">
  Total tokens processed (equal to `prompt_tokens` for embedding requests).
</ResponseField>
