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

# Create Embeddings

> This endpoint used to create new custom embeddings for the given input text using the specified model.



## OpenAPI

````yaml POST /vectors/embedding
openapi: 3.1.0
info:
  title: Pawa AI APIs
  description: >-
    API endpoints in Pawa Platform to perform CRUD operations on different
    features using Pawa AI, a digital assistant built for Africa for various
    tasks.
  license:
    name: MIT
  version: 1.0.0
servers:
  - url: https://api.pawa-ai.com/v1
    description: Production Server
security:
  - bearerAuth: []
paths:
  /vectors/embedding:
    post:
      tags:
        - Create a new embeddings
      summary: Create a new embeddings
      description: >-
        This endpoint used to create new custom embeddings for the given input
        text using the specified model.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/createEmbeddingRequestData'
      responses:
        '200':
          description: Embeddings created successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CreateEmbeddingResponseDto'
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              examples:
                badRequest:
                  value:
                    success: false
                    message: Invalid input provided
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              examples:
                unauthorized:
                  value:
                    success: false
                    message: Unauthorized access
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              examples:
                forbidden:
                  value:
                    success: false
                    message: You do not have permission to access this resource
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              examples:
                notFound:
                  value:
                    success: false
                    message: Resource does not exist
        '429':
          description: Too Many Requests
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              examples:
                tooManyRequests:
                  value:
                    success: false
                    message: Rate limit exceeded. Please try again later.
        '500':
          description: Unexpected error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              examples:
                serverError:
                  value:
                    success: false
                    message: Internal server error
components:
  schemas:
    createEmbeddingRequestData:
      type: object
      properties:
        model:
          type: string
          description: The model for the embedding request
          example: pawa-embeddings-v1-20241001
          default: pawa-embeddings-v1-20241001
          enum:
            - pawa-embeddings-v1-20241001
        lang:
          type: string
          description: The model for the embedding request
          default: multi
        sentences:
          description: A list of sentences to embed
          example:
            - Hello world
            - How are you?
          type: array
          items:
            type: string
      required:
        - model
        - sentences
    CreateEmbeddingResponseDto:
      type: object
      properties:
        success:
          type: boolean
          example: true
        message:
          type: string
          example: Embeddings created successfully
        data:
          $ref: '#/components/schemas/CreateEmbeddingData'
      required:
        - success
        - message
        - data
    ErrorResponse:
      required:
        - success
        - message
      type: object
      properties:
        success:
          type: boolean
          example: false
        message:
          type: string
          example: An error occurred
    CreateEmbeddingData:
      type: object
      properties:
        embeddings:
          type: array
          example:
            - - 0.0047908169
              - -0.0000800654
              - -0.0000212658
              - 0.0144227119
              - 0.0173993539
              - -0.0002167973
            - - 0.0047908169
              - -0.0000800654
              - -0.0000212658
              - 0.0144227119
              - 0.0173993539
              - -0.0002167973
          items:
            type: array
            items:
              type: number
      required:
        - embeddings
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer

````