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

# Get Test Batch

> The runs of one batch with their pass, fail and error counts.



## OpenAPI

````yaml get /v1/agent/agents/{agent_id}/test-batches/{batch_id}
openapi: 3.1.0
info:
  title: FishAudio OpenAPI
  version: '1'
servers:
  - description: Fish Audio API
    url: https://api.fish.audio
security: []
tags: []
paths:
  /v1/agent/agents/{agent_id}/test-batches/{batch_id}:
    get:
      tags:
        - Agent Tests
      summary: Get Test Batch
      description: >-
        The runs of one batch with their pass, fail and error counts. `status`
        is

        `running` until every run has finished, then `completed`.
      parameters:
        - in: path
          name: agent_id
          description: ''
          required: true
          schema:
            title: Agent Id
            type: string
          deprecated: false
        - in: path
          name: batch_id
          description: ''
          required: true
          schema:
            title: Batch Id
            type: string
          deprecated: false
      responses:
        '200':
          description: Request fulfilled, document follows
          headers: {}
          content:
            application/json:
              schema:
                properties:
                  batch_id:
                    title: Batch Id
                    type: string
                  agent_id:
                    title: Agent Id
                    type: string
                  status:
                    description: running until every run has finished.
                    enum:
                      - running
                      - completed
                    title: Status
                    type: string
                  completed:
                    title: Completed
                    type: boolean
                  passed:
                    title: Passed
                    type: integer
                  failed:
                    title: Failed
                    type: integer
                  errors:
                    title: Errors
                    type: integer
                  pass_rate:
                    anyOf:
                      - type: number
                      - type: 'null'
                    default: null
                    description: >-
                      passed / (passed + failed), null until a run passed or
                      failed. Error runs never judged the agent and are left
                      out.
                    title: Pass Rate
                  runs:
                    items:
                      $ref: '#/components/schemas/PublicAgentTestRun'
                    title: Runs
                    type: array
                required:
                  - batch_id
                  - agent_id
                  - status
                  - completed
                  - passed
                  - failed
                  - errors
                  - runs
                type: object
        '401':
          description: No permission -- see authorization schemes
          headers: {}
          content:
            application/json:
              schema:
                properties:
                  status:
                    title: Status
                    type: integer
                  message:
                    title: Message
                    type: string
                  reason:
                    anyOf:
                      - type: string
                      - type: 'null'
                    default: null
                    title: Reason
                required:
                  - status
                  - message
                type: object
        '404':
          description: Nothing matches the given URI
          headers: {}
          content:
            application/json:
              schema:
                properties:
                  status:
                    title: Status
                    type: integer
                  message:
                    title: Message
                    type: string
                  reason:
                    anyOf:
                      - type: string
                      - type: 'null'
                    default: null
                    title: Reason
                required:
                  - status
                  - message
                type: object
        '503':
          description: The server cannot process the request due to a high load
          headers: {}
          content:
            application/json:
              schema:
                properties:
                  status:
                    title: Status
                    type: integer
                  message:
                    title: Message
                    type: string
                  reason:
                    anyOf:
                      - type: string
                      - type: 'null'
                    default: null
                    title: Reason
                required:
                  - status
                  - message
                type: object
      security:
        - BearerAuth: []
      x-codeSamples:
        - lang: bash
          label: Poll Test Batch
          source: |-
            curl --request GET \
              --url https://api.fish.audio/v1/agent/agents/<agent-id>/test-batches/<batch-id> \
              --header 'Authorization: Bearer <token>'
components:
  schemas:
    PublicAgentTestRun:
      properties:
        run_id:
          title: Run Id
          type: string
        test_id:
          title: Test Id
          type: string
        agent_id:
          title: Agent Id
          type: string
        batch_id:
          anyOf:
            - type: string
            - type: 'null'
          default: null
          title: Batch Id
        test_type:
          enum:
            - next_reply
            - tool
            - simulation
          title: Test Type
          type: string
        repeat_index:
          default: 0
          description: Which repeat of the test in its batch this run is.
          title: Repeat Index
          type: integer
        status:
          enum:
            - queued
            - running
            - passed
            - failed
            - error
          title: Status
          type: string
        needs_review:
          default: false
          description: The judge could not decide, or a tool call had no mock answer.
          title: Needs Review
          type: boolean
        error:
          default: ''
          title: Error
          type: string
        usage:
          $ref: '#/components/schemas/PublicAgentTestRunUsage'
        created_at:
          format: date-time
          title: Created At
          type: string
        started_at:
          anyOf:
            - format: date-time
              type: string
            - type: 'null'
          default: null
          title: Started At
        finished_at:
          anyOf:
            - format: date-time
              type: string
            - type: 'null'
          default: null
          title: Finished At
        agent_reply:
          default: ''
          description: The reply a scripted test judged.
          title: Agent Reply
          type: string
        judge_reasoning:
          default: ''
          title: Judge Reasoning
          type: string
        config_hash:
          default: ''
          description: The agent draft's config hash the run tested.
          title: Config Hash
          type: string
        latency_ms:
          default: 0
          title: Latency Ms
          type: integer
        simulation_result:
          anyOf:
            - $ref: '#/components/schemas/AgentTestSimulationResult'
            - type: 'null'
          default: null
        channel:
          anyOf:
            - enum:
                - web_voice
                - phone_inbound
                - phone_outbound
              type: string
            - type: 'null'
          default: null
          title: Channel
        turns_used:
          default: 0
          title: Turns Used
          type: integer
        ended_by:
          anyOf:
            - enum:
                - agent
                - user
                - transfer
                - max_turns
                - timeout
                - error
              type: string
            - type: 'null'
          default: null
          title: Ended By
        mock_gaps:
          items:
            $ref: '#/components/schemas/AgentTestMockGap'
          title: Mock Gaps
          type: array
      required:
        - run_id
        - test_id
        - agent_id
        - test_type
        - status
        - created_at
      title: PublicAgentTestRun
      type: object
    PublicAgentTestRunUsage:
      properties:
        agent_replies:
          default: 0
          title: Agent Replies
          type: integer
        cost_usd:
          anyOf:
            - type: string
            - type: 'null'
          default: null
          description: LLM cost of the run in USD, null while any part is unpriced.
          title: Cost Usd
      title: PublicAgentTestRunUsage
      type: object
    AgentTestSimulationResult:
      description: |-
        The simulation run's result: what was said, what the agent called,
        the deterministic assertions and the judge's per-condition verdicts.
      properties:
        transcript:
          items:
            $ref: '#/components/schemas/AgentTestTranscriptMessage'
          title: Transcript
          type: array
        tool_calls:
          items:
            $ref: '#/components/schemas/AgentTestToolCallRecord'
          title: Tool Calls
          type: array
        assertions:
          items:
            $ref: '#/components/schemas/AgentTestAssertionResult'
          title: Assertions
          type: array
        conditions:
          items:
            $ref: '#/components/schemas/AgentTestConditionResult'
          title: Conditions
          type: array
        summary:
          default: ''
          title: Summary
          type: string
        passed:
          default: false
          title: Passed
          type: boolean
      title: AgentTestSimulationResult
      type: object
    AgentTestMockGap:
      description: |-
        Calls of one tool the test prepared no answer for. A run with a
        gap never passes cleanly: it fails with needs_review.
      properties:
        tool_name:
          title: Tool Name
          type: string
        tool_id:
          anyOf:
            - type: string
            - type: 'null'
          default: null
          title: Tool Id
        tool_type:
          anyOf:
            - enum:
                - webhook
                - client
                - integration
              type: string
            - type: 'null'
          default: null
          title: Tool Type
        source:
          enum:
            - missing
            - unmatched
          title: Source
          type: string
        calls:
          default: 0
          title: Calls
          type: integer
      required:
        - tool_name
        - source
      title: AgentTestMockGap
      type: object
    AgentTestTranscriptMessage:
      properties:
        role:
          enum:
            - user
            - agent
          title: Role
          type: string
        text:
          default: ''
          title: Text
          type: string
        turn_id:
          anyOf:
            - type: integer
            - type: 'null'
          default: null
          title: Turn Id
        node_id:
          anyOf:
            - type: string
            - type: 'null'
          default: null
          title: Node Id
        created_at:
          anyOf:
            - type: string
            - type: 'null'
          default: null
          title: Created At
        seq:
          anyOf:
            - type: integer
            - type: 'null'
          default: null
          title: Seq
      required:
        - role
      title: AgentTestTranscriptMessage
      type: object
    AgentTestToolCallRecord:
      description: >-
        One tool the agent invoked during the simulation, as the runtime ledger
        recorded it.
      properties:
        id:
          default: ''
          title: Id
          type: string
        tool_name:
          default: ''
          title: Tool Name
          type: string
        tool_source:
          default: ''
          title: Tool Source
          type: string
        input:
          additionalProperties:
            $ref: '#/components/schemas/JsonValue'
          title: Input
          type: object
        status:
          default: ''
          title: Status
          type: string
        output:
          anyOf:
            - type: string
            - type: 'null'
          default: null
          title: Output
        error:
          anyOf:
            - type: string
            - type: 'null'
          default: null
          title: Error
        mocked:
          default: false
          title: Mocked
          type: boolean
        mock_source:
          anyOf:
            - enum:
                - test
                - tool
                - missing
                - unmatched
                - real
              type: string
            - type: 'null'
          default: null
          title: Mock Source
        node_id:
          default: ''
          title: Node Id
          type: string
        turn_id:
          anyOf:
            - type: integer
            - type: 'null'
          default: null
          title: Turn Id
        created_at:
          anyOf:
            - type: string
            - type: 'null'
          default: null
          title: Created At
        seq:
          anyOf:
            - type: integer
            - type: 'null'
          default: null
          title: Seq
      title: AgentTestToolCallRecord
      type: object
    AgentTestAssertionResult:
      properties:
        kind:
          enum:
            - tool_call
            - forbidden_tool
            - ended_by
          title: Kind
          type: string
        target:
          title: Target
          type: string
        tool_id:
          anyOf:
            - type: string
            - type: 'null'
          default: null
          title: Tool Id
        tool_type:
          anyOf:
            - enum:
                - webhook
                - client
                - integration
              type: string
            - type: 'null'
          default: null
          title: Tool Type
        passed:
          title: Passed
          type: boolean
        detail:
          default: ''
          title: Detail
          type: string
      required:
        - kind
        - target
        - passed
      title: AgentTestAssertionResult
      type: object
    AgentTestConditionResult:
      properties:
        name:
          title: Name
          type: string
        result:
          enum:
            - success
            - failure
            - unknown
          title: Result
          type: string
        rationale:
          default: ''
          title: Rationale
          type: string
      required:
        - name
        - result
      title: AgentTestConditionResult
      type: object
    JsonValue: {}
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer

````

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