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

# Create embeddings

> OpenAI-compatible embeddings. Billed on input tokens. `input` accepts a single string or an array of strings.



## OpenAPI

````yaml POST /v1/embeddings
openapi: 3.1.0
info:
  title: Kubox API
  description: >-
    OpenAI-compatible AI endpoints on sovereign Australian infrastructure.
    Authenticate with your `kbx_live_…` API key as a Bearer token. This
    reference is generated from the gateway source code.
  version: 1.0.0
servers:
  - url: https://api.kubox.ai
    description: Kubox cloud
security:
  - bearerAuth: []
paths:
  /v1/embeddings:
    post:
      summary: Create embeddings
      description: >-
        OpenAI-compatible embeddings. Billed on input tokens. `input` accepts a
        single string or an array of strings.
      operationId: createEmbeddings
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - model
                - input
              additionalProperties: true
              properties:
                model:
                  type: string
                  description: An embedding model id from `GET /v1/models`.
                input:
                  oneOf:
                    - type: string
                      minLength: 1
                    - type: array
                      items:
                        type: string
                      minItems: 1
      responses:
        '200':
          description: The embedding vectors.
          content:
            application/json:
              schema:
                type: object
                properties:
                  object:
                    type: string
                    enum:
                      - list
                  data:
                    type: array
                    items:
                      type: object
                      properties:
                        object:
                          type: string
                          enum:
                            - embedding
                        index:
                          type: integer
                        embedding:
                          type: array
                          items:
                            type: number
                  model:
                    type: string
                  usage:
                    type: object
                    properties:
                      prompt_tokens:
                        type: integer
                      total_tokens:
                        type: integer
        '400':
          description: Invalid request body.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                error:
                  type: invalid_request_error
                  code: invalid_request
                  message: Invalid request body.
        '401':
          description: Incorrect API key provided.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                error:
                  type: invalid_request_error
                  code: invalid_api_key
                  message: Incorrect API key provided.
        '402':
          description: Insufficient credits. Top up to continue.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                error:
                  type: insufficient_quota
                  code: insufficient_balance
                  message: Insufficient credits. Top up to continue.
        '404':
          description: The model `<id>` does not exist.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                error:
                  type: invalid_request_error
                  code: model_not_found
                  message: The model `<id>` does not exist.
        '502':
          description: The provider rejected the request.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                error:
                  type: api_error
                  code: upstream_error
                  message: The provider rejected the request.
      security:
        - bearerAuth: []
components:
  schemas:
    Error:
      type: object
      properties:
        error:
          type: object
          properties:
            type:
              type: string
            code:
              type: string
            message:
              type: string
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: Your Kubox API key (`kbx_live_…`) from the console.

````