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

# Generate text embedding

> Internal endpoint on `agent-worker`. Generates a vector
embedding for the supplied text via Workers AI (or the chosen
provider override).




## OpenAPI

````yaml /docs/openapi-minimal.yaml post /agent/embedding
openapi: 3.0.3
info:
  title: Hoox API
  description: |
    REST API for the Hoox algorithmic trading platform.

    Ingest trade signals, check system health, and manage DeFi wallet
    operations on the Cloudflare edge. All requests are handled by the
    Hoox gateway worker (`workers/hoox`) running at the network edge.
  version: 1.0.0
  contact:
    name: Hoox Support
    email: support@hoox.sh
servers:
  - url: https://api.hoox.sh
    description: Production API
  - url: https://staging.hoox.sh
    description: Staging environment
security: []
paths:
  /agent/embedding:
    post:
      tags:
        - AI Agent
      summary: Generate text embedding
      description: |
        Internal endpoint on `agent-worker`. Generates a vector
        embedding for the supplied text via Workers AI (or the chosen
        provider override).
      operationId: agentEmbedding
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - text
              properties:
                text:
                  type: string
                  minLength: 1
                  maxLength: 10000
                  example: BTC funding rate flipped positive after 14 days
                provider:
                  type: string
                  description: Optional provider override
                  example: workers-ai
      responses:
        '200':
          description: Embedding returned
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    example: true
                  embedding:
                    type: array
                    items:
                      type: number
                  model:
                    type: string
                  error:
                    type: string
                    nullable: true
        '400':
          description: Missing or empty `text`
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '401':
          description: Internal authentication missing or invalid
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '502':
          description: Upstream provider failure
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
components:
  schemas:
    ErrorResponse:
      type: object
      properties:
        success:
          type: boolean
          example: false
        requestId:
          type: string
          format: uuid
          description: Request trace identifier
          example: 9b1deb4d-3b7d-4bad-9bdd-2b0d7b3dcb6d
        error:
          type: string
          description: Human-readable error description
          example: Invalid JSON payload structure.

````