---
title: "Generate scenario instructions with AI"
method: POST
path: "/test_framework/v3/scenarios/generate-instructions/"
tags: ["test_framework"]
---

# Generate scenario instructions with AI

`POST /test_framework/v3/scenarios/generate-instructions/`

## Request

- Base URL: `https://api.cekura.ai`
- URL: `https://api.cekura.ai/test_framework/v3/scenarios/generate-instructions/`
- Auth: one of:
  - API key in header `X-CEKURA-API-KEY`
  - HTTP bearer
  - HTTP bearer

Write caller instructions and an expected outcome for a new evaluator of the agent, guided by `extra_instructions`, and return them. Nothing is saved. Usually takes under a minute.

## Request body

- GenerateInstructionsV3Request
  - `agent_id` integer, required: Agent the evaluator will test.
  - `extra_instructions` string, required: What the evaluator should test, in plain language.

## Response `200`

- object
  - `status` 'completed' | 'failed': `failed` when the job could not produce its result; see `error` / `errors`.
  - `agent_id` integer
  - `instructions` string, nullable
  - `expected_outcome_prompt` string, nullable
  - `error` string, nullable: Why the job failed, when it did.

## Other responses

- `400`
- `403`: No access to the agent, project, metric or result the job runs on.
- `504`: The job did not finish within 15 minutes. It may still complete in the background.

## Changes

- **2026-11-03** `a6fb6a739212`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/cekura/apis/cekura-api/changes/test_framework/v3/scenarios/generate-instructions/post.md)

---

[API](https://skmtc.dev/cekura/apis/cekura-api.md) - [All operations](https://skmtc.dev/cekura/apis/cekura-api/llms.txt) - [OpenAPI document](https://skmtc.dev/cekura/apis/cekura-api/revisions/a6fb6a739212?raw)
