---
title: "PATCH /simulate/api/agent-prompt-optimiser/{id}/"
method: PATCH
path: "/simulate/api/agent-prompt-optimiser/{id}/"
tags: ["simulate"]
---

# PATCH /simulate/api/agent-prompt-optimiser/{id}/

`PATCH /simulate/api/agent-prompt-optimiser/{id}/`

## Request

- Base URL: `http://localhost:8000`
- URL: `http://localhost:8000/simulate/api/agent-prompt-optimiser/{id}/`
- Auth: one of:
  - API key in header `X-Api-Key`
  - API key in header `X-Secret-Key`

ViewSet for Agent Prompt Optimiser Runs.

## Request body

- AgentPromptOptimiserRun
  - `id` string, uuid
  - `agent_optimiser` string, uuid, required
  - `agent_optimiser_run` string, uuid, required
  - `test_execution` string, uuid, required
  - `optimiser_type` 'random_search' | 'gepa' | 'protegi' | 'bayesian' | 'metaprompt' | 'promptwizard', required
  - `model` string, required: LLM model used for the optimiser run
  - `status` 'pending' | 'running' | 'completed' | 'failed'
  - `result` object, nullable
  - `configuration` object, nullable

## Response `200`

OK

- AgentPromptOptimiserRunModelResponse
  - `id` string, uuid
  - `agent_optimiser` string, uuid
  - `agent_optimiser_run` string, uuid
  - `test_execution` string, uuid
  - `optimiser_type` 'random_search' | 'gepa' | 'protegi' | 'bayesian' | 'metaprompt' | 'promptwizard'
  - `model` string
  - `status` 'pending' | 'running' | 'completed' | 'failed'
  - `result` AgentPromptOptimiserRawResult, nullable
    - `history` AgentPromptOptimiserRawTrialResult[]
      - `prompt` string, nullable
      - `average_score` number, nullable
      - `is_baseline` boolean
      - `individual_results` object
    - `best_prompt` string, nullable
    - `final_score` number, nullable
    - `best_score` number, nullable
    - `trials_run` integer
    - `error` string, nullable
  - `configuration` AgentPromptOptimiserConfiguration, nullable
    - `num_gradients` integer
    - `errors_per_gradient` integer
    - `prompts_per_gradient` integer
    - `beam_size` integer
    - `num_rounds` integer
    - `num_variations` integer
    - `max_metric_calls` integer
    - `min_examples` integer
    - `max_examples` integer
    - `n_trials` integer
    - `task_description` string
    - `mutate_rounds` integer
    - `refine_iterations` integer

## Other responses

- `400`: Bad Request
- `404`: Not Found
- `500`: Internal Server Error
- `default`: Default error response

---

[API](https://skmtc.dev/futureagi/apis/future-agi-management-api.md) · [All operations](https://skmtc.dev/futureagi/apis/future-agi-management-api/llms.txt) · [OpenAPI document](https://skmtc.dev/futureagi/apis/future-agi-management-api/revisions/c8684118e142?raw)
