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

# Create embeddings

> Generates dense vector embeddings for one or more text/code inputs.



## OpenAPI

````yaml POST /v1/embeddings
openapi: 3.1.0
info:
  title: SHARC MCP Backend API
  version: 1.0.0
  description: >-
    HTTP endpoints used by the SHARC MCP server for indexing and semantic search
    workflows.
servers:
  - url: https://api.sharc.sh
    description: Production
security: []
paths:
  /v1/embeddings:
    post:
      tags:
        - MCP backend
      summary: Generate embeddings
      description: Generates dense vector embeddings for one or more text/code inputs.
      operationId: createEmbeddings
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/EmbeddingsRequest'
      responses:
        '200':
          description: Embeddings generated
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/EmbeddingsResponse'
        '400':
          description: Invalid request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      security:
        - apiKey: []
components:
  schemas:
    EmbeddingsRequest:
      type: object
      properties:
        input:
          oneOf:
            - type: string
            - type: array
              items:
                type: string
              maxItems: 1000
        model:
          type: string
          description: Optional embedding model override.
        encoding_format:
          type: string
          enum:
            - float
            - base64
      required:
        - input
    EmbeddingsResponse:
      type: object
      properties:
        data:
          type: array
          items:
            $ref: '#/components/schemas/EmbeddingItem'
        usage:
          type: object
          properties:
            prompt_tokens:
              type: integer
            total_tokens:
              type: integer
      required:
        - data
    ErrorResponse:
      type: object
      properties:
        error:
          type: object
          properties:
            message:
              type: string
            type:
              type: string
            param:
              type:
                - string
                - 'null'
            code:
              type:
                - string
                - 'null'
          required:
            - message
            - type
      required:
        - error
    EmbeddingItem:
      type: object
      properties:
        embedding:
          type: array
          items:
            type: number
        index:
          type: integer
      required:
        - embedding
        - index
  securitySchemes:
    apiKey:
      type: http
      scheme: bearer
      bearerFormat: API Key
      description: 'Pass your key in Authorization: Bearer <key>.'

````