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

# Generate voice audio



## OpenAPI

````yaml /api/openapi.yaml post /v1/voice-generations
openapi: 3.1.0
info:
  title: AdSkull Public API
  version: 1.0.0
  summary: Public API for AdSkull creative generation.
  description: >
    Create AI ad assets, images, videos, voiceovers, custom voices, and talking
    avatars.

    Responses expose AdSkull product resources.
servers:
  - url: https://api.adskull.io
security:
  - bearerAuth: []
tags:
  - name: Account
  - name: Models
  - name: Assets
  - name: Images
  - name: Videos
  - name: Voices
  - name: Talking Avatars
  - name: Webhooks
  - name: LLM
  - name: LLM OpenAI Compat
  - name: LLM Anthropic Compat
paths:
  /v1/voice-generations:
    post:
      tags:
        - Voices
      summary: Generate voice audio
      operationId: createVoiceGeneration
      parameters:
        - $ref: '#/components/parameters/IdempotencyKey'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateVoiceGenerationRequest'
      responses:
        '201':
          description: Voice generation completed or accepted.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/VoiceGeneration'
        '400':
          $ref: '#/components/responses/InvalidRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '402':
          $ref: '#/components/responses/InsufficientCredits'
        '403':
          $ref: '#/components/responses/Forbidden'
        '409':
          $ref: '#/components/responses/Conflict'
        '415':
          $ref: '#/components/responses/UnsupportedMediaType'
        '422':
          $ref: '#/components/responses/ContentPolicyViolation'
        '429':
          $ref: '#/components/responses/RateLimited'
      security:
        - bearerAuth:
            - voices:write
components:
  parameters:
    IdempotencyKey:
      in: header
      name: Idempotency-Key
      required: true
      schema:
        type: string
        minLength: 8
        maxLength: 128
      description: Unique key for safe retries of job creation requests.
  schemas:
    CreateVoiceGenerationRequest:
      type: object
      required:
        - voice_id
        - mode
      description: >
        Voice generation request.


        Pricing: 2 credits per 10 seconds, rounded up to the next 10s.

        Minimum 2 credits per request. Duration estimate for TTS = len(text) /
        12 seconds.
      properties:
        voice_id:
          type: string
          description: Library voice ID (e.g. "ahmed") or custom voice ID.
        mode:
          type: string
          enum:
            - tts
            - sts
          description: >
            • tts — Text-to-Speech (requires `text`).

            • sts — Speech-to-Speech, re-voice an existing recording (requires
            `audio_url`).
        text:
          type: string
          maxLength: 8192
          description: Script for TTS mode. Up to 8192 characters.
        audio_url:
          type: string
          format: uri
          description: |
            Hosted audio URL for STS mode. Accepted formats:
            mp3 / wav / m4a / ogg / webm. Maximum 50 MB.
    VoiceGeneration:
      type: object
      required:
        - id
        - object
        - status
      properties:
        id:
          type: string
        object:
          type: string
          const: voice_generation
        status:
          type: string
          enum:
            - queued
            - processing
            - completed
            - failed
            - canceled
        credits_reserved:
          type: integer
        credits_used:
          type: integer
          nullable: true
        credits_refunded:
          type: integer
        duration_seconds:
          type: number
        created_at:
          type: string
          format: date-time
        updated_at:
          type: string
          format: date-time
          nullable: true
        completed_at:
          type: string
          format: date-time
          nullable: true
        failed_at:
          type: string
          format: date-time
          nullable: true
        failure_code:
          type: string
          nullable: true
        failure_message:
          type: string
          nullable: true
        assets:
          type: array
          items:
            $ref: '#/components/schemas/Asset'
    Asset:
      type: object
      required:
        - id
        - object
        - type
        - url
        - mime_type
      properties:
        id:
          type: string
        object:
          type: string
          const: asset
        type:
          type: string
          enum:
            - image
            - audio
            - video
        url:
          type: string
          format: uri
        mime_type:
          type: string
        size_bytes:
          type: integer
        duration_seconds:
          type: number
          nullable: true
        width:
          type: integer
          nullable: true
        height:
          type: integer
          nullable: true
        expires_at:
          type: string
          format: date-time
          nullable: true
    ErrorEnvelope:
      type: object
      required:
        - error
      properties:
        error:
          type: object
          required:
            - code
            - message
            - request_id
          properties:
            code:
              type: string
            message:
              type: string
            request_id:
              type: string
            details:
              type: object
              additionalProperties: true
  responses:
    InvalidRequest:
      description: Invalid request.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorEnvelope'
    Unauthorized:
      description: Missing or invalid API key.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorEnvelope'
    InsufficientCredits:
      description: Not enough credits.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorEnvelope'
    Forbidden:
      description: Missing scope, plan, or resource access.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorEnvelope'
    Conflict:
      description: Idempotency or concurrency conflict.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorEnvelope'
    UnsupportedMediaType:
      description: Unsupported file type.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorEnvelope'
    ContentPolicyViolation:
      description: Input content is not allowed.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorEnvelope'
    RateLimited:
      description: Rate limit exceeded.
      headers:
        Retry-After:
          schema:
            type: integer
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorEnvelope'
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: API key

````