> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.kontinent.ai/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.kontinent.ai/_mcp/server.

# Create embeddings

POST https://api.kontinent.ai/v1/embeddings
Content-Type: application/json

OpenAI embeddings schema. `model` must be an embeddings-kind model
(e.g. `mistral/mistral-embed`). No streaming.


Reference: https://docs.kontinent.ai/api-reference/endpoints/embeddings/create-embedding

## OpenAPI Specification

```yaml
openapi: 3.1.0
info:
  title: Kontinent API
  version: 1.0.0
paths:
  /v1/embeddings:
    post:
      operationId: createEmbedding
      summary: Create embeddings
      description: |
        OpenAI embeddings schema. `model` must be an embeddings-kind model
        (e.g. `mistral/mistral-embed`). No streaming.
      tags:
        - embeddings
      parameters:
        - name: Authorization
          in: header
          description: |
            A Kontinent API key: `Authorization: Bearer sk-kt-<43 base62 chars>`
            (49 chars total). Shown once at creation; only a SHA-256 hash is
            stored. No expiry; revocation takes effect within ~30 s.
          required: true
          schema:
            type: string
      responses:
        '200':
          description: The embedding vectors.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/EmbeddingResponse'
        '400':
          description: Malformed body, body over 2 MiB, or missing `model`.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '401':
          description: Bad or revoked API key. Do not retry.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '402':
          description: Organization balance is at or below zero. Top up, then retry.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '404':
          description: Unknown or disabled model id.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '429':
          description: >
            Rate limited. `rate_limit_exceeded` is the per-key RPM limit
            (sliding

            60 s window); `upstream_rate_limited` means the provider throttled
            us.

            Back off and retry.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '500':
          description: Gateway error. Retriable.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '502':
          description: >
            Upstream provider failure. `upstream_error` is a provider
            5xx/connect

            failure (retriable); `upstream_auth_error` means the provider
            rejected

            our credentials (our problem, not yours).
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/EmbeddingRequest'
servers:
  - url: https://api.kontinent.ai
    description: Production
  - url: http://localhost:4000
    description: Local development
components:
  schemas:
    EmbeddingRequestInput:
      oneOf:
        - type: string
        - type: array
          items:
            type: string
      description: Text (or array of texts) to embed.
      title: EmbeddingRequestInput
    EmbeddingRequest:
      type: object
      properties:
        model:
          type: string
        input:
          $ref: '#/components/schemas/EmbeddingRequestInput'
          description: Text (or array of texts) to embed.
      required:
        - model
        - input
      title: EmbeddingRequest
    EmbeddingResponseDataItems:
      type: object
      properties:
        object:
          type: string
        index:
          type: integer
        embedding:
          type: array
          items:
            type: number
            format: double
      title: EmbeddingResponseDataItems
    Usage:
      type: object
      properties:
        prompt_tokens:
          type: integer
        completion_tokens:
          type: integer
        total_tokens:
          type: integer
      title: Usage
    EmbeddingResponse:
      type: object
      properties:
        object:
          type: string
        model:
          type: string
        data:
          type: array
          items:
            $ref: '#/components/schemas/EmbeddingResponseDataItems'
        usage:
          $ref: '#/components/schemas/Usage'
      title: EmbeddingResponse
    ErrorError:
      type: object
      properties:
        message:
          type: string
        type:
          type: string
        code:
          type: string
      title: ErrorError
    Error:
      type: object
      properties:
        error:
          $ref: '#/components/schemas/ErrorError'
      title: Error
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: |
        A Kontinent API key: `Authorization: Bearer sk-kt-<43 base62 chars>`
        (49 chars total). Shown once at creation; only a SHA-256 hash is
        stored. No expiry; revocation takes effect within ~30 s.

```

## Examples



**Request**

```json
{
  "model": "mistral/mistral-embed",
  "input": "The quick brown fox"
}
```

**Response**

```json
{
  "object": "list",
  "model": "mistral/mistral-embed",
  "data": [
    {
      "object": "embedding",
      "index": 1,
      "embedding": [
        1.1
      ]
    }
  ],
  "usage": {
    "prompt_tokens": 1,
    "completion_tokens": 1,
    "total_tokens": 1
  }
}
```

**SDK Code**

```python basic
import requests

url = "https://api.kontinent.ai/v1/embeddings"

payload = {
    "model": "mistral/mistral-embed",
    "input": "The quick brown fox"
}
headers = {
    "Authorization": "Bearer <token>",
    "Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.json())
```

```javascript basic
const url = 'https://api.kontinent.ai/v1/embeddings';
const options = {
  method: 'POST',
  headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
  body: '{"model":"mistral/mistral-embed","input":"The quick brown fox"}'
};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go basic
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "https://api.kontinent.ai/v1/embeddings"

	payload := strings.NewReader("{\n  \"model\": \"mistral/mistral-embed\",\n  \"input\": \"The quick brown fox\"\n}")

	req, _ := http.NewRequest("POST", url, payload)

	req.Header.Add("Authorization", "Bearer <token>")
	req.Header.Add("Content-Type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby basic
require 'uri'
require 'net/http'

url = URI("https://api.kontinent.ai/v1/embeddings")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"model\": \"mistral/mistral-embed\",\n  \"input\": \"The quick brown fox\"\n}"

response = http.request(request)
puts response.read_body
```

```java basic
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://api.kontinent.ai/v1/embeddings")
  .header("Authorization", "Bearer <token>")
  .header("Content-Type", "application/json")
  .body("{\n  \"model\": \"mistral/mistral-embed\",\n  \"input\": \"The quick brown fox\"\n}")
  .asString();
```

```php basic
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://api.kontinent.ai/v1/embeddings', [
  'body' => '{
  "model": "mistral/mistral-embed",
  "input": "The quick brown fox"
}',
  'headers' => [
    'Authorization' => 'Bearer <token>',
    'Content-Type' => 'application/json',
  ],
]);

echo $response->getBody();
```

```csharp basic
using RestSharp;

var client = new RestClient("https://api.kontinent.ai/v1/embeddings");
var request = new RestRequest(Method.POST);
request.AddHeader("Authorization", "Bearer <token>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"model\": \"mistral/mistral-embed\",\n  \"input\": \"The quick brown fox\"\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift basic
import Foundation

let headers = [
  "Authorization": "Bearer <token>",
  "Content-Type": "application/json"
]
let parameters = [
  "model": "mistral/mistral-embed",
  "input": "The quick brown fox"
] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "https://api.kontinent.ai/v1/embeddings")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```