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

# Embeddings

> POST /v1/embeddings — dense vector embeddings for text.

OpenAI-compatible embeddings endpoint.

```bash theme={null}
curl https://api.infery.ai/v1/embeddings \
  -H "Authorization: Bearer $INFERY_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "text-embedding-3-small",
    "input": "Dense vector, please"
  }'
```

Returns standard `{ data: [{ embedding: [...], index: 0 }], usage: {...} }`.

## Supported models

Browse with `GET /v1/models?modality=embedding` or see [Models](/models/catalog). OpenAI, Google, Alibaba and open-source embedding models available.

## Batching

`input` can be an array of up to 2 048 strings. Each string is a separate embedding; all share the same pricing.

## Dimensionality reduction

On supported models (e.g. `text-embedding-3-small`, `text-embedding-3-large`):

```json theme={null}
{"model": "text-embedding-3-small", "input": "...", "dimensions": 512}
```


## OpenAPI

````yaml openapi.json POST /v1/embeddings
openapi: 3.0.0
info:
  title: Infery Gateway
  description: >-
    Infery Inference Gateway — OpenAI-compatible API for LLMs, embeddings,
    images, audio, and video
  version: '1.0'
  contact: {}
servers:
  - url: https://api.infery.ai
    description: Production
  - url: http://localhost:3001
    description: Local
security: []
tags: []
paths:
  /v1/embeddings:
    post:
      tags:
        - Embeddings
      summary: Create embeddings
      operationId: EmbeddingsController_create
      parameters:
        - name: x-request-id
          in: header
          description: Optional request ID for tracking
          required: false
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - model
                - input
              properties:
                model:
                  type: string
                  example: text-embedding-3-small
                input:
                  oneOf:
                    - type: string
                    - type: array
                      items:
                        type: string
                encoding_format:
                  type: string
                  enum:
                    - float
                    - base64
                dimensions:
                  type: integer
      responses:
        '200':
          description: Embedding result
          content:
            application/json:
              schema:
                type: object
                properties:
                  object:
                    type: string
                    example: list
                  data:
                    type: array
                    items:
                      type: object
                      properties:
                        object:
                          type: string
                          example: embedding
                        index:
                          type: integer
                          example: 0
                        embedding:
                          type: array
                          items:
                            type: number
                          example:
                            - 0.0023
                            - -0.0094
                            - 0.0156
                          description: The embedding vector. Length depends on the model.
                  model:
                    type: string
                    example: text-embedding-3-small
                  usage:
                    type: object
                    properties:
                      prompt_tokens:
                        type: integer
                        example: 8
                      total_tokens:
                        type: integer
                        example: 8
                  credits_used:
                    type: integer
                    example: 1
                    description: >-
                      Credits deducted from the workspace balance for this
                      request
        '400':
          description: Invalid request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseDto'
        '401':
          description: Unauthorized — invalid or missing API key
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseDto'
        '404':
          description: Model not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseDto'
      security:
        - ApiKey: []
components:
  schemas:
    ErrorResponseDto:
      type: object
      properties:
        error:
          $ref: '#/components/schemas/ErrorDetailDto'
      required:
        - error
    ErrorDetailDto:
      type: object
      properties:
        message:
          type: string
          example: Model not found
          description: Human-readable error message
        type:
          type: string
          example: invalid_request_error
          description: Error category
          enum:
            - invalid_request_error
            - authentication_error
            - permission_error
            - quota_exceeded
            - rate_limit_error
            - server_error
        code:
          type: object
          example: model_not_found
          nullable: true
          description: Stable machine-readable error code
        param:
          type: object
          example: model
          nullable: true
          description: >-
            Name of the request parameter that triggered the error, if
            applicable
      required:
        - message
        - type
        - code
        - param
  securitySchemes:
    ApiKey:
      type: apiKey
      in: header
      name: Authorization
      description: 'API key in format: Bearer inf_***'

````