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

# Create embeddings

> Get a vector representation of a given input that can be easily consumed by machine learning models and algorithms.



## OpenAPI

````yaml /openapi.json post /embeddings
openapi: 3.0.3
info:
  title: AnyAPI API
  description: >-
    Universal API Integration Platform - Connect any API to any API with
    intelligent data transformation and workflow orchestration.
  version: 1.0.0
  contact:
    name: AnyAPI Support
    email: support@anyapi.ai
    url: https://anyapi.ai/support
  license:
    name: MIT
    url: https://opensource.org/licenses/MIT
servers:
  - url: https://api.anyapi.ai/v1
    description: Production server
security:
  - bearerAuth: []
tags:
  - name: Text
    description: Generate text completions
  - name: Images
    description: Generate and manipulate images
  - name: Audio
    description: Generate speech and transcribe audio
  - name: Music
    description: List and retrieve model information
  - name: Video
    description: Create vector embeddings for text
  - name: Vision
    description: Create vector embeddings for text
  - name: 3D Models
    description: Create vector embeddings for text
  - name: Embeddings
    description: Create vector embeddings for text
  - name: Files
    description: Files
  - name: Batches
    description: Batches
  - name: Moderation
    description: Moderation
  - name: Other
    description: Other models
paths:
  /embeddings:
    post:
      tags:
        - Embeddings
      summary: Create embeddings
      description: >-
        Get a vector representation of a given input that can be easily consumed
        by machine learning models and algorithms.
      operationId: createEmbedding
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/EmbeddingRequest'
            examples:
              basic_embedding:
                summary: Basic text embedding
                value:
                  input: The food was delicious and the waiter...
                  model: text-embedding-ada-002
                  encoding_format: float
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/EmbeddingResponse'
        '400':
          description: Bad request - Invalid input parameters
        '401':
          description: Unauthorized - Invalid or missing API key
        '429':
          description: Rate limit exceeded
        '500':
          description: Internal server error
components:
  schemas:
    EmbeddingRequest:
      type: object
      required:
        - input
        - model
      properties:
        input:
          oneOf:
            - type: string
              description: Input text to embed
            - type: array
              items:
                type: string
              description: Array of input texts to embed
        model:
          type: string
          description: ID of the model to use
          example: text-embedding-ada-002
        encoding_format:
          type: string
          description: The format to return the embeddings in
          enum:
            - float
            - base64
          default: float
        dimensions:
          type: integer
          description: The number of dimensions the resulting embeddings should have
          minimum: 1
        user:
          type: string
          description: A unique identifier representing your end-user
    EmbeddingResponse:
      type: object
      required:
        - object
        - data
        - model
        - usage
      properties:
        object:
          type: string
          enum:
            - list
          description: The object type, which is always 'list'
        data:
          type: array
          description: Array of embedding objects
          items:
            $ref: '#/components/schemas/Embedding'
        model:
          type: string
          description: The name of the model used to generate the embedding
        usage:
          $ref: '#/components/schemas/Usage'
    Embedding:
      type: object
      required:
        - object
        - embedding
        - index
      properties:
        object:
          type: string
          enum:
            - embedding
          description: The object type, which is always 'embedding'
        embedding:
          type: array
          description: The embedding vector
          items:
            type: number
        index:
          type: integer
          description: The index of the embedding in the list of embeddings
    Usage:
      type: object
      required:
        - prompt_tokens
        - completion_tokens
        - total_tokens
      properties:
        prompt_tokens:
          type: integer
          description: Number of tokens in the prompt
        completion_tokens:
          type: integer
          description: Number of tokens in the generated completion
        total_tokens:
          type: integer
          description: Total number of tokens used in the request
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: Bearer token authentication. Get your API key from the dashboard.

````