> ## Documentation Index
> Fetch the complete documentation index at: https://docs.usetuner.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Create Select Run

> Start a select-mode simulation run: test calls placed against library scenarios
picked directly by id, rather than generated by an LLM (see Create Run).

Scenarios are written synchronously (no LLM generation phase, same shape as Create
Replay Run) and test calls are queued immediately, so `generated_count` reflects the
true selected count on the 202 response, not zero. Poll List Runs for progress.

Each picked scenario is scored against every `PASS_FAIL` eval currently configured on
the agent, same as a generated functional/adversarial scenario -- there is no
run-level eval/intent narrowing in select mode, since each library scenario already
carries its own scoring config (`target_ai_evaluation`).

Atomic: every selected scenario id is validated before anything is created. If any
single id does not resolve to an active scenario belonging to this agent, the entire
request is rejected with a 404 and nothing is created.



## OpenAPI

````yaml https://api.usetuner.ai/public/openapi.json post /api/v1/workspaces/{workspace_id}/agents/{agent_id}/simulation-runs/select
openapi: 3.1.0
info:
  title: My Public API
  version: 1.0.0
servers:
  - url: https://api.usetuner.ai
security: []
tags:
  - name: calls
    x-group: Calls
  - name: workspaces
    x-group: Workspaces
  - name: simulation
    x-group: Simulation
  - name: agent-settings
    x-group: Agent Settings
  - name: agents
    x-group: Agents
  - name: scenarios
    x-group: Scenarios
  - name: traces
    x-group: Traces
  - name: providers
    x-group: Providers
paths:
  /api/v1/workspaces/{workspace_id}/agents/{agent_id}/simulation-runs/select:
    post:
      tags:
        - simulation
      summary: Create Select Run
      description: >-
        Start a select-mode simulation run: test calls placed against library
        scenarios

        picked directly by id, rather than generated by an LLM (see Create Run).


        Scenarios are written synchronously (no LLM generation phase, same shape
        as Create

        Replay Run) and test calls are queued immediately, so `generated_count`
        reflects the

        true selected count on the 202 response, not zero. Poll List Runs for
        progress.


        Each picked scenario is scored against every `PASS_FAIL` eval currently
        configured on

        the agent, same as a generated functional/adversarial scenario -- there
        is no

        run-level eval/intent narrowing in select mode, since each library
        scenario already

        carries its own scoring config (`target_ai_evaluation`).


        Atomic: every selected scenario id is validated before anything is
        created. If any

        single id does not resolve to an active scenario belonging to this
        agent, the entire

        request is rejected with a 404 and nothing is created.
      operationId: >-
        create_select_simulation_run_api_v1_workspaces__workspace_id__agents__agent_id__simulation_runs_select_post
      parameters:
        - name: agent_id
          in: path
          required: true
          schema:
            type: integer
            description: Tuner's internal numeric ID for the agent.
            title: Agent Id
          description: Tuner's internal numeric ID for the agent.
        - name: workspace_id
          in: path
          required: true
          schema:
            type: integer
            description: Workspace ID. Find this in Workspace > General Settings.
            title: Workspace Id
          description: Workspace ID. Find this in Workspace > General Settings.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateSelectSimulationRunRequest'
      responses:
        '202':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SimulationRunResponse'
        '400':
          description: >-
            `caller_persona_id` or
            `simulation_profile_id`/`noise_environment_id` does not exist, or
            the profile belongs to a different agent.
          content:
            application/json:
              example:
                detail: >-
                  Invalid simulation_profile_id or profile does not belong to
                  this agent
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '401':
          description: Missing or invalid API key.
          content:
            application/json:
              example:
                detail: Not authenticated
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '402':
          description: >-
            The workspace has no credits remaining, or its plan does not include
            simulations.
          content:
            application/json:
              example:
                detail: You have no credits remaining.
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '403':
          description: You do not have access to this workspace.
          content:
            application/json:
              example:
                detail: User does not have access to workspace 42
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '404':
          description: >-
            A selected scenario id does not exist, is soft-deleted, or does not
            belong to this agent.
          content:
            application/json:
              example:
                detail: Scenario 501 not found for this agent.
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '409':
          description: A simulation run is already in progress for this agent.
          content:
            application/json:
              example:
                detail: You have a simulation run in progress. Come back later.
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '422':
          description: >-
            The agent has no settings configured, its provider does not support
            simulations for its call direction, or it has no `PASS_FAIL` eval
            configured.
          content:
            application/json:
              example:
                detail: >-
                  Agent has no boolean (PASS_FAIL) evals. Add at least one
                  before running a simulation.
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      security:
        - Bearer: []
components:
  schemas:
    CreateSelectSimulationRunRequest:
      properties:
        max_call_duration_minutes:
          type: integer
          maximum: 12
          minimum: 1
          title: Max Call Duration Minutes
          default: 3
        caller_persona_id:
          type: integer
          title: Caller Persona Id
        simulation_profile_id:
          anyOf:
            - type: integer
              exclusiveMinimum: 0
            - type: 'null'
          title: Simulation Profile Id
        noise_environment_id:
          anyOf:
            - type: integer
              exclusiveMinimum: 0
            - type: 'null'
          title: Noise Environment Id
        noise_intensity:
          anyOf:
            - type: number
            - type: 'null'
          title: Noise Intensity
          description: 'Allowed gains: 0.5, 1.0, or 1.5'
        selected_scenario_ids:
          items:
            type: integer
          type: array
          maxItems: 20
          minItems: 1
          title: Selected Scenario Ids
          description: >-
            Library `scenario.id` values to run, in the order they should be
            queued.
      type: object
      required:
        - caller_persona_id
        - selected_scenario_ids
      title: CreateSelectSimulationRunRequest
      description: >-
        Request to launch a select-mode run (ENG-1541): test calls placed
        against library

        scenarios picked directly by id, rather than generated by an LLM.


        Deliberately has no
        `functional_count`/`adversarial_count`/`selected_eval_ids`/

        `selected_intent_ids` -- select mode has no "mix" to balance (each
        picked scenario is

        already exactly what it is) and no run-level eval/intent narrowing (each
        library

        scenario carries its own scoring config via `target_ai_evaluation`).
    SimulationRunResponse:
      properties:
        simulation_run_id:
          type: integer
          title: Simulation Run Id
        generated_count:
          type: integer
          title: Generated Count
        success:
          type: boolean
          title: Success
        caller_persona_id:
          anyOf:
            - type: integer
            - type: 'null'
          title: Caller Persona Id
        caller_persona:
          anyOf:
            - $ref: '#/components/schemas/CallerPersonaResponse'
            - type: 'null'
        simulation_profile_id:
          anyOf:
            - type: integer
            - type: 'null'
          title: Simulation Profile Id
        simulation_profile_name:
          anyOf:
            - type: string
            - type: 'null'
          title: Simulation Profile Name
        simulation_profile_snapshot:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Simulation Profile Snapshot
        noise_environment_id:
          anyOf:
            - type: integer
            - type: 'null'
          title: Noise Environment Id
        noise_intensity:
          anyOf:
            - type: number
            - type: 'null'
          title: Noise Intensity
        noise_environment:
          anyOf:
            - $ref: '#/components/schemas/NoiseEnvironmentResponse'
            - type: 'null'
      type: object
      required:
        - simulation_run_id
        - generated_count
        - success
      title: SimulationRunResponse
    ErrorResponse:
      properties:
        detail:
          type: string
          title: Detail
          description: Human-readable description of what went wrong.
      type: object
      required:
        - detail
      title: ErrorResponse
      description: Error body returned when a request fails.
    CallerPersonaResponse:
      properties:
        id:
          type: integer
          title: Id
        name:
          type: string
          title: Name
        language:
          type: string
          title: Language
        language_code:
          type: string
          title: Language Code
        accent:
          type: string
          title: Accent
        label:
          type: string
          title: Label
        country_code:
          type: string
          title: Country Code
      type: object
      required:
        - id
        - name
        - language
        - language_code
        - accent
        - label
        - country_code
      title: CallerPersonaResponse
    NoiseEnvironmentResponse:
      properties:
        id:
          type: integer
          title: Id
        name:
          type: string
          title: Name
          description: Display text, e.g. Café
        slug:
          type: string
          title: Slug
          description: Stable identifier, e.g. cafe
      type: object
      required:
        - id
        - name
        - slug
      title: NoiseEnvironmentResponse
      description: One selectable background environment.
  securitySchemes:
    Bearer:
      type: http
      description: >-
        Use Tuner API key (tr_api_...) or user session token. Find your API key
        in Workspace Settings > API Keys.
      scheme: bearer

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.