Skip to main content
The policy optimization API creates and manages prompt / instruction optimization jobs with GEPA and MIPRO. Endpoint: POST /api/policy-optimization/online/jobs Authentication: Bearer token via Authorization: Bearer $SYNTH_API_KEY

Request

The request body is a policy optimization config object. The API supports both:
  • a newer policy_optimization section, and
  • a legacy prompt_learning section for backward compatibility.
Example (new section with GEPA):
{
  "policy_optimization": {
    "algorithm": "gepa",
    "localapi_url": "https://tunnel.example.com",
    "policy": { "model": "gpt-4o-mini", "provider": "openai" },
    "gepa": { "...": "algorithm parameters" }
  }
}
Example (new section with MIPRO):
{
  "policy_optimization": {
    "algorithm": "mipro",
    "task_app_url": "https://your-task-app.example.com",
    "policy": { "model": "gpt-4o-mini", "provider": "openai" },
    "mipro": { "...": "algorithm parameters" }
  }
}
Example (legacy section):
{
  "prompt_learning": {
    "algorithm": "gepa",
    "localapi_url": "https://tunnel.example.com",
    "policy": { "model": "gpt-4o-mini", "provider": "openai" },
    "gepa": { "...": "algorithm parameters" }
  }
}

Supported Algorithms

  • GEPA: Genetic Evolution of Prompt Architectures - Evolutionary algorithm for population-based search
  • MIPRO: Multi-prompt Instruction Proposal Optimizer - Systematic instruction proposal and evaluation

Response

The response returns a job identifier and initial status.
{
  "job_id": "po_abc123",
  "status": "running"
}

Status Codes

  • 200 / 201 — Job created successfully
  • 400 — Invalid request (missing required fields)
  • 401 — Authentication failed

Notes

  • For the canonical config shape (including overrides and LocalAPI health checks), prefer using the Python SDK: synth_ai.sdk.optimization.policy.
  • If you need to integrate at the HTTP layer, use the SDK docstrings as the source of truth for config fields.
  • See GEPA API Reference for GEPA-specific parameters
  • See MIPRO Online API Reference for online mode parameters
  • See MIPRO Offline API Reference for offline mode parameters