---
title: "Optimize Skill Endpoint"
method: POST
path: "/v1/evaluations/optimize"
tags: ["evaluations"]
---

# Optimize Skill Endpoint

`POST /v1/evaluations/optimize`

## Request

- Base URL: `https://api.vlm.run` (the document declares no server; this is the origin it was published from)
- URL: `https://api.vlm.run/v1/evaluations/optimize`
- Auth: HTTP bearer

Optimize a skill using evaluation data. Fetches model responses and human corrections for the given skill, runs LLM-based optimization to improve the prompt and JSON schema, and saves a new skill version with the same name.

## Request body

- OptimizeSkillRequest: Request body for POST /evaluations/optimize.
  - `skill_id` string, required: Skill ID (UUID) to optimize
  - `skill_ids` string[], nullable: Additional skill IDs whose executions should be included in the evaluation data.
  - `data_from` string, nullable: ISO date filter start
  - `data_to` string, nullable: ISO date filter end
  - `infer_corrections` boolean: Use LLM to produce corrected JSON from notes-only feedback.
  - `n_samples` integer: Number of response/correction pairs to randomly sample for the LLM optimization.

## Response `200`

Successful Response

- OptimizeSkillResponse: Response for POST /evaluations/optimize.
  - `skill_id` string, required: ID of the newly created optimized skill
  - `name` string, required: Skill name (same as the original)
  - `version` string, required: Auto-generated version for the new skill
  - `original_skill_id` string, required: ID of the original skill that was optimized
  - `total_pairs` integer, required: Number of response/correction pairs available
  - `sampled_pairs` integer, required: Number of pairs actually sent to the LLM
  - `created_at` string, date-time, required: Creation timestamp of the new skill

## Other responses

- `422`: Validation Error

---

[API](https://skmtc.dev/vlm/apis/vlm-run-unified-server.md) · [All operations](https://skmtc.dev/vlm/apis/vlm-run-unified-server/llms.txt) · [OpenAPI document](https://skmtc.dev/vlm/apis/vlm-run-unified-server/revisions/4a68ab36546b?raw)
