optimize_model
Optimize an agent's model for cost or speed without losing quality. Benchmarks cheaper/faster models, picks the best one, switches to it, and triggers prompt adaptation. Returns a jobId — use get_model_optimization_status to poll.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| target | No | Optimization target: 'cost' (cheapest passing model), 'speed' (fastest), 'balanced' (best score-to-cost ratio). Default: 'cost'. | |
| agentId | Yes | The agent ID to optimize. Must be active with runs. | |
| maxTurns | No | Max conversation turns per scenario (default: 3). | |
| customerId | No | (Converra superadmin only) Target customer ID. | |
| qualityThreshold | No | Minimum quality as percentage of current model's score (0-100). E.g., 85 means candidates must score >= 85% of current model. Default: 85. | |
| skipOptimization | No | If true, switch model without triggering prompt adaptation. Default: false. | |
| candidateModelIds | No | Optional specific model IDs to evaluate. If omitted, candidates are auto-selected based on target. Fine-tuned accounts/... ids are not accepted here; benchmark them with benchmark_models. |