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

# Create embeddings

> 

Use a compatible Hicap model ID in the request body. Azure deployment IDs and api-version are not part of this route. Supported optional parameters depend on the model.

> [!NOTE]
>
> Choose an exact compatible ID from [the model list](https://docs.hicap.ai/api-reference/models.md). Supported parameters and output formats vary by model and connection; this schema does not guarantee every upstream feature. See [endpoint availability](https://docs.hicap.ai/api-reference/introduction.md#endpoint-availability).


## OpenAPI

````yaml post /embeddings
openapi: 3.1.0
info:
  title: Hicap API
  description: >-
    OpenAI-compatible request reference. Authenticate using the api-key header.
    Listed paths and request shapes do not guarantee support for every model,
    connection, backend, or parameter; see
    https://docs.hicap.ai/api-reference/introduction.
  version: 1.0.0
  contact:
    name: Hicap Support
    email: support@hicap.ai
servers:
  - url: https://api.hicap.ai/v1
security:
  - apiKeyAuth: []
paths:
  /embeddings:
    post:
      summary: >-
        Get a vector representation of a given input that can be easily consumed
        by machine learning models and algorithms.
      description: >-


        Use a compatible Hicap model ID in the request body. Azure deployment
        IDs and api-version are not part of this route. Supported optional
        parameters depend on the model.
      operationId: embeddings_create
      parameters:
        - name: x-hicap-tags
          in: header
          required: false
          description: >-
            One JSON object mapping dimension keys to short string values. Never
            include secrets or direct personal identifiers. Opaque identity
            references require approved policy and verified destination
            handling; see the identity attribution guide.
          schema:
            type: string
          example: '{"feature":"support","env":"production"}'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              additionalProperties: true
              properties:
                input:
                  description: >-
                    Input text to embed, encoded as a string or array of tokens.
                    To embed multiple inputs in a single request, pass an array
                    of strings or array of token arrays. The input must not
                    exceed the max input tokens for the model (8192 tokens for
                    `text-embedding-ada-002`), cannot be an empty string, and
                    any array must be 2048 dimensions or less.
                  oneOf:
                    - type: string
                      default: ''
                      example: This is a test.
                      nullable: true
                    - type: array
                      minItems: 1
                      maxItems: 2048
                      items:
                        type: string
                        minLength: 1
                        example: This is a test.
                        nullable: false
                user:
                  description: >-
                    A unique identifier representing your end-user, which can
                    help monitoring and detecting abuse.
                  type: string
                  nullable: false
                input_type:
                  description: input type of embedding search to use
                  type: string
                  example: query
                encoding_format:
                  description: >-
                    The format to return the embeddings in. Can be either
                    `float` or `base64`. Defaults to `float`.
                  type: string
                  example: float
                  nullable: true
                dimensions:
                  description: >-
                    The number of dimensions the resulting output embeddings
                    should have. Only supported in `text-embedding-3` and later
                    models.
                  type: integer
                  example: 1
                  nullable: true
                model:
                  type: string
                  minLength: 1
                  description: Exact compatible Hicap model ID from GET /v1/models.
              required:
                - input
                - model
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
                  object:
                    type: string
                  model:
                    type: string
                  data:
                    type: array
                    items:
                      type: object
                      properties:
                        index:
                          type: integer
                        object:
                          type: string
                        embedding:
                          type: array
                          items:
                            type: number
                      required:
                        - index
                        - object
                        - embedding
                  usage:
                    type: object
                    properties:
                      prompt_tokens:
                        type: integer
                      total_tokens:
                        type: integer
                    required:
                      - prompt_tokens
                      - total_tokens
                required:
                  - object
                  - model
                  - data
                  - usage
        default:
          description: >-
            Gateway or backend error. Body shape varies; inspect HTTP status
            before parsing.
          content:
            application/json:
              schema:
                type: object
                properties:
                  statusCode:
                    type: integer
                  message:
                    type: string
                  error:
                    type: object
                    additionalProperties: true
                additionalProperties: true
components:
  securitySchemes:
    apiKeyAuth:
      type: apiKey
      in: header
      name: api-key
      description: Your Hicap API key.

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.