# Generate test scenarios (/docs/api-reference/simulation/generateAutoScenarios)

> Write test scenarios for an agent from its prompt. Each scenario has a name, the steps the simulated caller follows, and how the agent should respond. Nothing is saved: pass the ones you want to `createSimulation`.

**POST** `/agents/{agent_id}/auto-scenarios`

Write test scenarios for an agent from its prompt. Each scenario has a name, the steps the simulated caller follows, and how the agent should respond. Nothing is saved: pass the ones you want to `createSimulation`.

```yaml
operationId: generateAutoScenarios
parameters:
  - name: agent_id
    in: path
    required: true
    schema:
      type: integer
    description: The ID of the agent.
requestBody:
  required: true
  content:
    application/json:
      schema:
        type: object
        required:
          - number_of_scenarios
        properties:
          number_of_scenarios:
            type: integer
            minimum: 1
            description: How many scenarios to write.
      example:
        number_of_scenarios: 5
responses:
  '200':
    description: The generated scenarios.
    content:
      application/json:
        schema:
          type: object
          properties:
            success:
              type: boolean
            scenarios:
              type: array
              items:
                type: object
                properties:
                  name:
                    type: string
                  description:
                    type: string
                    description: The steps the simulated caller follows.
                  expected_result:
                    type: string
                    description: How the agent should respond.
        example:
          success: true
          scenarios:
            - name: Reschedule an appointment
              description: Ask to move tomorrow's appointment to Friday afternoon.
              expected_result: The agent confirms the new slot and repeats the date and time.
  '400':
    description: '`number_of_scenarios` is missing.'
  '401':
    description: Missing or invalid API key.
  '403':
    description: The API key's user cannot run simulations.
  '404':
    description: Agent not found or access denied.
```

**Python SDK**

```python
from omnidimension import Client
client = Client(api_key)

response = client.simulation.generate_scenarios(agent_id=123, number_of_scenarios=5)
for scenario in response["json"]["scenarios"]:
    print(scenario["name"])
```

**curl**

```bash
curl -X POST "https://omnidim.io/api/v1/agents/{agent_id}/auto-scenarios" \
  -H "Authorization: Bearer $OMNIDIM_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "number_of_scenarios": 5
}'
```