> ## 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 Voice Clip Set

> Create a voice clip set from a call or an uploaded recording.

The clips are cut asynchronously: the set is returned in `extracting` status. Poll Get
Voice Clip Set until it is `ready`.



## OpenAPI

````yaml https://api.usetuner.ai/public/openapi.json post /api/v1/workspaces/{workspace_id}/agents/{agent_id}/voice-clip-sets
openapi: 3.1.0
info:
  title: Tuner API
  description: >-
    Send calls to Tuner and manage agents, evaluation settings, simulations and
    workspace settings.
  version: 1.0.0
servers:
  - url: https://api.usetuner.ai
security: []
tags:
  - name: calls
    description: Send call recordings and transcripts to Tuner and retrieve call details.
    x-group: Calls
  - name: workspaces
    description: >-
      Manage your workspaces, the API keys used to access them, and their PII
      redaction and data retention settings.
    x-group: Workspaces
  - name: simulation
    description: >-
      Run simulated calls against your agents, manage simulation profiles, and
      look up the caller personas and background-noise environments they can
      use.
    x-group: Simulation
  - name: scenarios
    description: Manage the test scenarios that simulated calls follow.
    x-group: Scenarios
  - name: replay-testing
    description: >-
      Replay recorded caller audio against a new version of your agent: upload
      or extract voice clips from real calls, then run them as replay runs.
    x-group: Replay Testing
  - name: agents
    description: Create, update and list the voice agents connected to your workspace.
    x-group: Agents
  - name: agent-settings
    description: >-
      Configure how Tuner evaluates an agent's calls, including evaluations,
      call outcomes, intents, data extraction, rules and alerts, plus the
      agent's SIP and outbound call configuration.
    x-group: Agent Settings
  - name: traces
    description: Send OpenTelemetry traces from your agent to Tuner.
    x-group: Traces
  - name: providers
    description: List the voice providers Tuner can connect to.
    x-group: Providers
paths:
  /api/v1/workspaces/{workspace_id}/agents/{agent_id}/voice-clip-sets:
    post:
      tags:
        - replay-testing
      summary: Create Voice Clip Set
      description: >-
        Create a voice clip set from a call or an uploaded recording.


        The clips are cut asynchronously: the set is returned in `extracting`
        status. Poll Get

        Voice Clip Set until it is `ready`.
      operationId: >-
        create_voice_clip_set_api_v1_workspaces__workspace_id__agents__agent_id__voice_clip_sets_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/VoiceClipSetCreateRequest'
      responses:
        '202':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/VoiceClipSetResponse'
        '400':
          description: >-
            `source_call_id` or `voice_clip_upload_id` does not exist or belongs
            to a different agent, or `caller_channel_index` is out of range for
            the upload.
          content:
            application/json:
              example:
                detail: Call with ID 123 not found for 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: >-
            Simulation (for a call source) or clip upload analysis (for an
            upload source) is not included in the workspace's current plan.
          content:
            application/json:
              example:
                detail: Clip upload analysis not included in your current plan.
              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: Agent not found.
          content:
            application/json:
              example:
                detail: Agent with ID 17 not found
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '409':
          description: >-
            A voice clip set with this name already exists for this agent, or
            the upload is not awaiting a channel selection or already has a clip
            set.
          content:
            application/json:
              example:
                detail: >-
                  A voice clip set named 'Angry customer' already exists for
                  this agent.
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
        - Bearer: []
components:
  schemas:
    VoiceClipSetCreateRequest:
      properties:
        name:
          type: string
          maxLength: 255
          minLength: 1
          title: Name
          description: Name of the voice clip set, up to 255 characters.
          examples:
            - Angry caller, billing dispute
        description:
          anyOf:
            - type: string
              maxLength: 10000
            - type: 'null'
          title: Description
          description: Optional notes about the voice clip set, up to 10,000 characters.
          examples:
            - Real call where the caller asks for a refund twice.
        source_call_id:
          anyOf:
            - type: integer
              exclusiveMinimum: 0
            - type: 'null'
          title: Source Call Id
          description: >-
            ID of an existing call to take the caller's turns from. Send either
            this or `voice_clip_upload_id`, not both.
          examples:
            - 1234
        voice_clip_upload_id:
          anyOf:
            - type: integer
              exclusiveMinimum: 0
            - type: 'null'
          title: Voice Clip Upload Id
          description: >-
            ID of an uploaded recording to take the caller's turns from. Send
            either this or `source_call_id`, not both.
          examples:
            - 56
        caller_channel_index:
          anyOf:
            - type: integer
              minimum: 0
            - type: 'null'
          title: Caller Channel Index
          description: >-
            Index of the channel in the uploaded recording that holds the
            caller's audio. Required with `voice_clip_upload_id`, and not
            allowed with `source_call_id`.
          examples:
            - 0
        extraction_settings:
          anyOf:
            - additionalProperties:
                type: integer
              type: object
            - type: 'null'
          title: Extraction Settings
          description: >-
            Optional overrides, in milliseconds, for `merge_gap_ms` (caller
            segments closer than this are merged into one turn, default 400),
            `min_turn_ms` (shorter turns are dropped, default 300) and `pad_ms`
            (padding added around each turn, default 120). Omit to use the
            defaults.
          examples:
            - merge_gap_ms: 400
              min_turn_ms: 300
              pad_ms: 120
      type: object
      required:
        - name
      title: VoiceClipSetCreateRequest
      description: >-
        Input schema for creating a voice clip set.


        The source is exactly one of `source_call_id` or `voice_clip_upload_id`;
        an upload also

        needs `caller_channel_index`.
    VoiceClipSetResponse:
      properties:
        id:
          type: integer
          title: Id
          description: Voice clip set ID.
        name:
          type: string
          title: Name
          description: Name of the voice clip set.
        description:
          anyOf:
            - type: string
            - type: 'null'
          title: Description
          description: Notes about the voice clip set.
        status:
          type: string
          title: Status
          description: >-
            `extracting` while the caller's clips are being cut, `ready` once
            the set can be replayed, or `failed`.
        clip_count:
          type: integer
          title: Clip Count
          description: Number of clips in the set.
        total_duration_ms:
          anyOf:
            - type: integer
            - type: 'null'
          title: Total Duration Ms
          description: Combined length of all clips in milliseconds. Set once ready.
        caller_track_duration_ms:
          anyOf:
            - type: integer
            - type: 'null'
          title: Caller Track Duration Ms
          description: >-
            Length of the full caller audio track in milliseconds. Set once
            ready.
        source_call_id:
          anyOf:
            - type: integer
            - type: 'null'
          title: Source Call Id
          description: ID of the call the set was built from, if it came from a call.
        source_voice_clip_upload_id:
          anyOf:
            - type: integer
            - type: 'null'
          title: Source Voice Clip Upload Id
          description: ID of the upload the set was built from, if it came from an upload.
        source_channel_mode:
          anyOf:
            - type: string
            - type: 'null'
          title: Source Channel Mode
          description: Whether the source recording was `mono` or `multi_channel`.
        failure_reason:
          anyOf:
            - type: string
            - type: 'null'
          title: Failure Reason
          description: Why extraction failed. Set only when `status` is `failed`.
        transcripts_version:
          type: integer
          title: Transcripts Version
          description: >-
            Goes up whenever any clip's transcript is edited, verified or
            unverified.
          default: 1
        verified_count:
          type: integer
          title: Verified Count
          description: Number of clips whose transcript has been verified.
          default: 0
        created_at:
          type: string
          format: date-time
          title: Created At
          description: When the voice clip set was created.
      type: object
      required:
        - id
        - name
        - status
        - clip_count
        - created_at
      title: VoiceClipSetResponse
      description: A voice clip set, without its clips.
    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.
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
        input:
          title: Input
        ctx:
          type: object
          title: Context
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
  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.