> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.vapi.ai/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.vapi.ai/_mcp/server.

# Generate Scenarios with AI

POST https://api.vapi.ai/eval/simulation/scenario/generate
Content-Type: application/json

Generates scenarios for an assistant or squad by analyzing its configuration with AI.

Reference: https://docs.vapi.ai/api-reference/simulations/simulation-generate-controller-generate

## Authentication

- `Authorization` header (bearer token, required) — Authenticate server-side requests with a private Vapi API key. Create or copy a key from the [Vapi Dashboard](https://dashboard.vapi.ai) and send it in the `Authorization` header as `Bearer <token>`. Keep private API keys out of client-side code and public repositories.

## Request

### Body (application/json)

This endpoint expects a GenerateScenariosDTO.

- `assistantId` (string, optional) — ID of the assistant to generate scenarios for
- `squadId` (string, optional) — ID of the squad to generate scenarios for

## Response

### 201

- `scenarios` (list of GeneratedScenario, required) — Generated scenarios
- `coverageNotes` (string, required) — Summary of test coverage

## Types

### GeneratedScenario

- `name` (string, required) — Short descriptive name
- `instructions` (string, required) — Instructions for the tester
- `category` (enum, required) — Scenario category
  - Allowed values: `happy_path`, `edge_case`, `failure_mode`
- `reasoning` (string, required) — Why this scenario is valuable

## Examples

**Request**

```json
{}
```

**Response**

```json
{
  "scenarios": [
    {
      "name": "string",
      "instructions": "string",
      "category": "happy_path",
      "reasoning": "string"
    }
  ],
  "coverageNotes": "string"
}
```