# Enable embeddings

Enables embedding generation and starts recalculation. If no modelId is provided, uses the previously configured model. If modelId matches current model, only recalculates posts without embeddings. If modelId is different, clears all embeddings and recalculates all posts.

RBAC: requires AdminSettings.Manage

Endpoint: PUT /api/v1/admin/embeddings/enable
Version: 1.0
Security: header

## Query parameters:

  - `batchDelayMs` (integer,null)
    Delay between batches in milliseconds (default: 100)

  - `modelId` (string,null)
    Model ID to use for embeddings. Uses current model if not provided.
    Example: "us_01hxcvk1hjexere4pvtrj0ymqq"

## Response 200 fields (application/json):

  - `enabled` (boolean, required)
    Whether embeddings are enabled

  - `modelId` (string,null, required)
    Current model ID (null if not configured)
    Example: "us_01hxcvk1hjexere4pvtrj0ymqq"

  - `modelExternalId` (string,null, required)
    Current model external ID (e.g., text-embedding-3-small)

  - `modelName` (string,null, required)
    Current model name

  - `vectorDimensions` (integer,null, required)
    Current vector dimensions

  - `totalPosts` (integer, required)
    Total posts in the system

  - `postsWithEmbeddings` (integer, required)
    Posts that have embeddings

  - `postsNeedingEmbeddings` (integer, required)
    Posts that need embeddings generated

  - `recalculation` (object,null, required)
    Current recalculation job progress (null if no job running)

  - `recalculation.status` (string, required)
    Job status
    Enum: "IDLE", "PENDING", "RUNNING", "COMPLETED", "CANCELLED", "FAILED"

  - `recalculation.processedPosts` (integer, required)
    Posts processed so far

  - `recalculation.totalToProcess` (integer, required)
    Total posts to process in this job

  - `recalculation.startedAt` (string,null, required)
    When the job started
    Example: "2022-03-10T16:15:50Z"

  - `recalculation.estimatedSecondsRemaining` (integer,null, required)
    Estimated seconds remaining (null if not calculable)

  - `recalculation.errorMessage` (string,null, required)
    Error message if job failed

## Response 400 fields (application/json):

  - `errorCode` (string, required)
    Error code

  - `message` (string, required)
    Error message

  - `docUrl` (string)
    Link to documentation

## Response 401 fields (application/json):

  - `errorCode` (string, required)
    Error code

  - `message` (string, required)
    Error message

  - `docUrl` (string)
    Link to documentation

## Response 403 fields (application/json):

  - `errorCode` (string, required)
    Error code

  - `message` (string, required)
    Error message

  - `docUrl` (string)
    Link to documentation

## Response 404 fields (application/json):

  - `errorCode` (string, required)
    Error code

  - `message` (string, required)
    Error message

  - `docUrl` (string)
    Link to documentation

## Response 409 fields (application/json):

  - `errorCode` (string, required)
    Error code

  - `message` (string, required)
    Error message

  - `docUrl` (string)
    Link to documentation


