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

# 创建文本向量

> Creates vector embeddings for one or more input strings.

将文本转换为向量，适合语义搜索、RAG、聚类和相似度匹配。


## OpenAPI

````yaml api-reference/openapi.json POST /embeddings
openapi: 3.1.0
info:
  title: AIOAGI OpenAI-compatible API
  description: >-
    OpenAI-compatible API surface for AIOAGI model access. Endpoint
    availability, model names, and billing rules depend on your account and the
    current control panel configuration.
  version: 1.0.0
servers:
  - url: https://api.aiearth.dev/v1
    description: General API endpoint
  - url: https://api.aiearth.vip/v1
    description: CDN accelerated API endpoint
  - url: https://api-s1.aiearth.dev/v1
    description: Specialized endpoint for account and realtime capabilities
  - url: https://api-s1.aiearth.vip/v1
    description: CDN accelerated specialized endpoint
security:
  - bearerAuth: []
paths:
  /embeddings:
    post:
      summary: Create embeddings
      description: Creates vector embeddings for one or more input strings.
      operationId: createEmbeddings
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/EmbeddingRequest'
      responses:
        '200':
          description: Embedding response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/EmbeddingResponse'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
components:
  schemas:
    EmbeddingRequest:
      type: object
      properties:
        model:
          type: string
        input:
          oneOf:
            - type: string
            - type: array
              items:
                type: string
      required:
        - model
        - input
    EmbeddingResponse:
      type: object
      properties:
        object:
          type: string
          example: list
        data:
          type: array
          items:
            type: object
            properties:
              object:
                type: string
                example: embedding
              embedding:
                type: array
                items:
                  type: number
              index:
                type: integer
        usage:
          $ref: '#/components/schemas/Usage'
    Usage:
      type: object
      properties:
        prompt_tokens:
          type: integer
        completion_tokens:
          type: integer
        total_tokens:
          type: integer
    Error:
      type: object
      properties:
        error:
          type: object
          properties:
            message:
              type: string
            type:
              type: string
            code:
              type: string
  responses:
    BadRequest:
      description: Invalid request
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    Unauthorized:
      description: Missing or invalid API key
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: API key

````