---
title: "Create Optimization Run"
method: POST
path: "/api/v1/optimization/runs"
tags: ["optimization"]
---

# Create Optimization Run

`POST /api/v1/optimization/runs`

Create a non-blocking prompt optimization run.

Returns immediately with the run_id.  The optimization executes as a
background task.  Poll ``GET /runs/{run_id}`` for progress and results.

## Request body

- GEPAOptimizationRequest — Request body for triggering a GEPA prompt optimization run.
  - `dataset_path` string, nullable — Relative filesystem path to the dataset file.
  - `dataset_id` string, nullable — Registered dataset identifier to optimize against.
  - `program_spec` string — DSPy program specification string to optimize in module:attr form. Required when module_slug is not provided.
  - `module_slug` string, nullable — Registered module slug for server-side dispatch. When provided, program_spec is auto-resolved from the module registry.
  - `skill_name` string, nullable — Bundled or mounted Fleet skill name to optimize as a markdown skill artifact.
  - `skill_path` string, nullable — Relative path to a SKILL.md-compatible markdown file to optimize.
  - `trace_bundle_paths` string[] — Optional offline trace bundle paths available to the RLM-GEPA instruction proposer.
  - `reflection_profile_id` string, nullable — Optional LLM provider profile id for the GEPA proposer/reflection model.
  - `reflection_model_id` string, nullable — Optional provider-native model id for the GEPA proposer/reflection model.
  - `output_path` string, nullable — Optional filesystem path to save the optimized program.
  - `auto` 'light' | 'medium' | 'heavy' — Optimization intensity level.
  - `max_metric_calls` integer, nullable — Optional GEPA metric-call budget override for short offline smoke runs.
  - `train_ratio` number — Fraction of examples to use for training (remainder used for validation).
  - `optimizer` 'gepa' — Optimizer backend to use. GEPA is the only supported optimizer.

## Response `200`

Successful Response

- OptimizationRunCreatedResponse — Response when an async optimization run is created.
  - `run_id` string, required — Unique identifier for the created run.
  - `status` string — Initial run status.

## Other responses

- `400` — Invalid optimization parameters.
- `401` — Authentication is required or the provided token is invalid.
- `422` — Validation Error
- `503` — GEPA optimization is unavailable in this environment.

---

[API](https://skmtc.net/qredence/apis/fleet-rlm.md) · [All operations](https://skmtc.net/qredence/apis/fleet-rlm/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/qredence/fleet-rlm/versions/62e8c152aa18/schema)
