> ## Documentation Index
> Fetch the complete documentation index at: https://nusaai-edit.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Create embeddings

> Generate vector embeddings from input text.



## OpenAPI

````yaml post /embeddings
openapi: 3.0.3
info:
  title: Neosantara AI API
  description: API for Neosantara AI services.
  version: 1.0.0
servers:
  - url: https://api.neosantara.xyz/v1
    description: API Base URL
security:
  - apiKey: []
tags:
  - name: response
  - name: chat
  - name: completions
  - name: embeddings
  - name: models
  - name: moderations
  - name: reasoning
  - name: authentication
  - name: images
paths:
  /embeddings:
    post:
      tags:
        - embeddings
      summary: Create embeddings
      description: Generate vector embeddings from input text.
      operationId: embeddings
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/EmbeddingsRequest'
            examples:
              simple_input:
                summary: Simple embedding request
                value:
                  model: nusa-embeddings-0001
                  input: example sentence
              multiple_inputs:
                summary: Multiple inputs embedding request
                value:
                  model: nusa-embeddings-0001
                  input:
                    - first sentence
                    - second sentence
                    - third sentence
      responses:
        '200':
          description: Embeddings result
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/EmbeddingsResponse'
              examples:
                success_response:
                  summary: Successful embeddings response
                  value:
                    object: list
                    data:
                      - object: embedding
                        embedding:
                          - 0.123
                          - 0.456
                          - 0.789
                        index: 0
                    model: nusa-embeddings-0001
                    usage:
                      prompt_tokens: 3
                      total_tokens: 3
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/AuthError'
        '429':
          $ref: '#/components/responses/RateLimitError'
        '500':
          $ref: '#/components/responses/ServerError'
components:
  schemas:
    EmbeddingsRequest:
      type: object
      required:
        - input
      properties:
        model:
          type: string
          example: nusa-embeddings-0001
        input:
          oneOf:
            - type: string
            - type: array
              items:
                type: string
        encoding_format:
          type: string
          default: float
          enum:
            - float
            - base64
    EmbeddingsResponse:
      type: object
      properties:
        object:
          type: string
          example: list
        data:
          type: array
          items:
            $ref: '#/components/schemas/EmbeddingObject'
        model:
          type: string
        usage:
          $ref: '#/components/schemas/EmbeddingUsage'
        _metadata:
          $ref: '#/components/schemas/Metadata'
    EmbeddingObject:
      type: object
      properties:
        object:
          type: string
          example: embedding
        embedding:
          type: array
          items:
            type: number
        index:
          type: integer
    EmbeddingUsage:
      type: object
      properties:
        prompt_tokens:
          type: integer
        total_tokens:
          type: integer
      required:
        - prompt_tokens
        - total_tokens
    Metadata:
      type: object
      properties:
        creator:
          type: string
          example: noesantara.xyz
        status:
          type: boolean
        timestamp:
          type: string
          format: date-time
        request_id:
          type: string
          nullable: true
        processing_time:
          type: number
          nullable: true
        tier:
          type: string
          nullable: true
        user_total_usage:
          $ref: '#/components/schemas/UsageInfo'
          nullable: true
    BadRequestError:
      type: object
      properties:
        error:
          type: object
          properties:
            message:
              type: string
            type:
              type: string
              example: invalid_request_error
            code:
              type: string
              enum:
                - invalid_parameter
                - missing_parameter
                - invalid_format
                - invalid_messages
              example: invalid_parameter
            param:
              type: string
              nullable: true
            details:
              type: object
              nullable: true
              additionalProperties: true
          required:
            - message
            - type
            - code
        info_metadata:
          $ref: '#/components/schemas/Metadata'
    AuthError:
      type: object
      properties:
        error:
          type: object
          properties:
            message:
              type: string
            type:
              type: string
              example: auth_error
            code:
              type: string
              enum:
                - missing_api_key
                - invalid_api_key
                - token_expired
                - session_expired
                - invalid_token
              example: invalid_api_key
            details:
              type: object
              nullable: true
              additionalProperties: true
          required:
            - message
            - type
            - code
        info_metadata:
          $ref: '#/components/schemas/Metadata'
    RateLimitError:
      type: object
      properties:
        error:
          type: object
          properties:
            message:
              type: string
            type:
              type: string
              example: rate_limit_exceeded
            code:
              type: string
              enum:
                - rpm_exceeded
                - tpm_exceeded
                - user_total_daily_limit_exceeded
                - user_total_monthly_limit_exceeded
              example: rpm_exceeded
            details:
              $ref: '#/components/schemas/RateLimitDetails'
              nullable: true
          required:
            - message
            - type
            - code
        info_metadata:
          $ref: '#/components/schemas/Metadata'
    ServerError:
      type: object
      properties:
        error:
          type: object
          properties:
            message:
              type: string
            type:
              type: string
              example: server_error
            code:
              type: string
              enum:
                - internal_error
                - service_unavailable
                - timeout
              example: internal_error
            details:
              type: object
              nullable: true
              additionalProperties: true
          required:
            - message
            - type
            - code
        info_metadata:
          $ref: '#/components/schemas/Metadata'
    UsageInfo:
      type: object
      properties:
        used:
          type: integer
        limit:
          type: integer
        remaining:
          type: integer
        reset_at:
          type: string
          format: date-time
      required:
        - used
        - limit
        - remaining
        - reset_at
    RateLimitDetails:
      type: object
      properties:
        limit:
          type: integer
        remaining:
          type: integer
        reset:
          type: string
          format: date-time
        retry_after:
          type: integer
          nullable: true
  responses:
    BadRequest:
      description: Bad request
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/BadRequestError'
    AuthError:
      description: Authentication failed
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/AuthError'
    RateLimitError:
      description: Rate limit exceeded
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/RateLimitError'
    ServerError:
      description: Internal server error
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ServerError'
  securitySchemes:
    apiKey:
      type: http
      scheme: bearer
      bearerFormat: API_KEY
      description: Your NeosantaraAI API Key.

````