Replace the AI agent's model strategy
PATCH/v1/brains/:brain_id/model-strategy
Replaces the entire model strategy atomically. The server validates each step, then runs DELETE+INSERT in a single transaction so concurrent readers never observe a partial state. Each step targets exactly one of three buckets: language_model_id (external BYOLLM, FK to language_models), language_model_alias (proxy SKU drawn from the LiteLLM proxy catalog), or neither (internal default). Per-channel chains are capped at 3 steps. Validation errors return a structured body identifying the offending step. Permissions - model_strategy.write. API keys - manage.
Request
Responses
- 200
- 400
- 401
- 404
- 500
Model strategy replaced
Validation error. Domain checks (chain length, bucket XOR, unknown alias) return the structured ModelStrategyValidationError shape so the UI can highlight the offending step. Generic schema errors (bad UUID, malformed body, invalid enum value) return the standard Error shape.
Unauthorized
Response Headers
Unique identifier for the API request, useful for debugging and tracking.
abc123xyz789The specified resource was not found
Response Headers
Unique identifier for the API request, useful for debugging and tracking.
abc123xyz789Internal Server Error
Response Headers
Unique identifier for the API request, useful for debugging and tracking.
abc123xyz789