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

# Start Agent Test Run



## OpenAPI

````yaml /openapi.yaml post /v1/agents/{agent_id}/test-runs
openapi: 3.1.0
info:
  title: Kupe API
  version: 0.1.0
  description: >-
    Public Kupe REST API. Authenticate with `Authorization: Bearer sk-kupe-...`
    (project API key) or a Supabase user JWT. API-key callers can GET /v1/me for
    the org_id and project_id scoped to the key.
servers:
  - url: https://x.kupe.in
    description: Production
security:
  - BearerAuth: []
tags:
  - name: Me
    description: Current principal — org and project scoped to an API key.
  - name: Agents
    description: Agent CRUD, versions, tools, analyses, memories, and tests.
  - name: Realtime
    description: Mint an ephemeral Realtime session for the WebSocket.
  - name: Sessions
    description: LiveKit web sessions and telephony call sessions.
  - name: Inbound
    description: Bind an agent to a phone number with availability windows.
  - name: Campaigns
    description: 'Outbound batches: contacts, schedule, start/pause/resume.'
  - name: Recipient lists
    description: Reusable contact lists that attach to campaigns.
  - name: Tools
    description: Org tool catalog (webhooks, MCP, Composio-backed).
  - name: Composio
    description: Connect third-party apps and attach actions as tools.
  - name: Analyses
    description: Post-call analysis configs and session results.
  - name: Databases
    description: Call databases, rows, export, and agent attachments.
  - name: Knowledge bases
    description: Files and RAG search for agent context.
  - name: Audio assets
    description: Ambient audio presets and project uploads.
  - name: Phones
    description: Search, buy, and manage telephony numbers.
  - name: Voices
    description: Catalog voices, clones, preview, and speak.
  - name: Providers
    description: STT, LLM, and TTS catalog (defaults + enabled models).
  - name: Logs
    description: Session transcripts, recordings, and tool-call events.
  - name: Billing
    description: Wallet balance and invoices (not checkout).
  - name: Usage
    description: Cost summary and daily usage (no per-service breakdown).
  - name: Orgs
    description: Organizations.
  - name: Projects
    description: Projects inside an org.
  - name: Members
    description: Org membership.
  - name: API keys
    description: Project API keys (`sk-kupe-...`).
  - name: Feature flags
    description: Workspace feature flags.
  - name: Health
    description: Liveness and readiness probes.
paths:
  /v1/agents/{agent_id}/test-runs:
    post:
      tags:
        - Agents
      summary: Start Agent Test Run
      operationId: start_agent_test_run_v1_agents__agent_id__test_runs_post
      parameters:
        - name: agent_id
          in: path
          required: true
          schema:
            type: string
            title: Agent Id
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/StartRunBody'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AgentTestRunOut'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
components:
  schemas:
    StartRunBody:
      properties:
        test_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Test Id
        multiplier:
          type: integer
          maximum: 5
          minimum: 1
          title: Multiplier
          default: 1
        run_name:
          anyOf:
            - type: string
            - type: 'null'
          title: Run Name
      type: object
      title: StartRunBody
    AgentTestRunOut:
      properties:
        id:
          type: string
          title: Id
        agent_id:
          type: string
          title: Agent Id
        agent_version:
          type: integer
          title: Agent Version
        run_name:
          anyOf:
            - type: string
            - type: 'null'
          title: Run Name
        multiplier:
          type: integer
          title: Multiplier
        status:
          type: string
          title: Status
        total_test_count:
          type: integer
          title: Total Test Count
        completed_test_count:
          type: integer
          title: Completed Test Count
        created_at:
          type: string
          title: Created At
        started_at:
          anyOf:
            - type: string
            - type: 'null'
          title: Started At
        finished_at:
          anyOf:
            - type: string
            - type: 'null'
          title: Finished At
        error:
          anyOf:
            - type: string
            - type: 'null'
          title: Error
        results:
          anyOf:
            - items:
                $ref: '#/components/schemas/AgentTestRunResultOut'
              type: array
            - type: 'null'
          title: Results
      type: object
      required:
        - id
        - agent_id
        - agent_version
        - run_name
        - multiplier
        - status
        - total_test_count
        - completed_test_count
        - created_at
        - started_at
        - finished_at
      title: AgentTestRunOut
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    AgentTestRunResultOut:
      properties:
        id:
          type: string
          title: Id
        test_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Test Id
        test_name:
          type: string
          title: Test Name
        attempt_number:
          type: integer
          title: Attempt Number
        status:
          type: string
          title: Status
        passed:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Passed
        transcript:
          items:
            $ref: '#/components/schemas/TranscriptTurn'
          type: array
          title: Transcript
        tool_calls_made:
          items:
            $ref: '#/components/schemas/ToolCallMade'
          type: array
          title: Tool Calls Made
        behavior_results:
          items:
            $ref: '#/components/schemas/BehaviorResult'
          type: array
          title: Behavior Results
        judge_reasoning:
          anyOf:
            - type: string
            - type: 'null'
          title: Judge Reasoning
        error:
          anyOf:
            - type: string
            - type: 'null'
          title: Error
      type: object
      required:
        - id
        - test_id
        - test_name
        - attempt_number
        - status
        - passed
        - transcript
        - tool_calls_made
        - behavior_results
        - judge_reasoning
        - error
      title: AgentTestRunResultOut
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
    TranscriptTurn:
      properties:
        role:
          type: string
          title: Role
        content:
          type: string
          title: Content
      type: object
      required:
        - role
        - content
      title: TranscriptTurn
    ToolCallMade:
      properties:
        name:
          type: string
          title: Name
        args:
          additionalProperties: true
          type: object
          title: Args
        mock_response:
          additionalProperties: true
          type: object
          title: Mock Response
      type: object
      required:
        - name
        - args
        - mock_response
      title: ToolCallMade
    BehaviorResult:
      properties:
        behavior:
          type: string
          title: Behavior
        met:
          type: boolean
          title: Met
        evidence:
          type: string
          title: Evidence
      type: object
      required:
        - behavior
        - met
        - evidence
      title: BehaviorResult
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      bearerFormat: API key
      description: Project API key (`sk-kupe-...`) or a Supabase user JWT.

````