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

# Synthesize a voice sample



## OpenAPI

````yaml GET /v1/accounts/{accountId}/voice-library/{voiceId}/sample
openapi: 3.1.0
info:
  title: PolyAI Agents API
  version: 1.0.11
  description: Manage PolyAI agents, telephony, deployments, and real-time configs.
servers:
  - url: https://api.us.poly.ai
    description: US region
  - url: https://api.eu.poly.ai
    description: EU region
  - url: https://api.uk.poly.ai
    description: UK region
  - url: https://api.studio.poly.ai
    description: Studio region
security:
  - polyApiKey: []
paths:
  /v1/accounts/{accountId}/voice-library/{voiceId}/sample:
    parameters:
      - name: accountId
        in: path
        required: true
        schema:
          type: string
      - name: voiceId
        in: path
        required: true
        schema:
          type: string
    get:
      tags:
        - Voice Library
      summary: Synthesize a short audio sample of a voice
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/VoiceSampleResponse'
        '401':
          description: Unauthorized – missing or invalid API key
        '403':
          description: Forbidden – insufficient permissions
        '404':
          description: Resource not found
components:
  schemas:
    VoiceSampleResponse:
      description: Response for GET /voice-library/<voice_id>/sample.
      type: object
      properties:
        voiceId:
          description: The voice that was synthesized
          type: string
        sampleUrl:
          description: Time-limited URL to a synthesized sample of the voice
          type: string
        expiresInSeconds:
          description: Number of seconds until sample_url expires
          type: integer
        text:
          description: The text that was synthesized
          type: string
      required:
        - voiceId
        - sampleUrl
        - expiresInSeconds
        - text
  securitySchemes:
    polyApiKey:
      type: apiKey
      in: header
      name: X-API-KEY

````