---
title: "Generate Audio"
method: POST
path: "/v1/audio/generations"
tags: ["v1 audio"]
---

# Generate Audio

`POST /v1/audio/generations`

Dedicated audio generation endpoint using the Universal Schema with flat parameters.
    
    Supports three audio types:
    - **speech**: Multi-speaker TTS (auto-detects characters, designs unique voices per entity)
    - **music**: AI-generated music
    - **sfx**: AI-generated sound effects
    
    **Universal Base Schema:**
    - user_id (str, required): The end-user ID
    - project_id (str, required): The project ID
    - persona_id (str, optional): The specific system persona/voice to use
    - disabled_learning (bool, optional): If true, request is ignored by long-term memory
    
    **Input:**
    - text_input (str, required): Text to speak or audio prompt
    - context (str, optional): Additional context
    
    **Audio Params (Flat):**
    - model (str, required): Model ID (e.g., eleven-turbo)
    - voice (str, required): Voice ID for TTS
    - audio_type (str, optional): 'speech', 'music', or 'sfx'
    - speed (float, optional): Playback speed (0.5-2.0)
    - duration (float, optional): Max duration in seconds
    - seed (int, optional): Random seed for reproducibility
    
    **Reference inputs:**
    - image_base64 (str, optional): Base64 encoded reference image for context
    - video_base64 (str, optional): Base64 encoded reference video for context
    - audio_base64 (str, optional): Base64 encoded reference audio for context
    
    **Authentication**: Requires valid API key or JWT token
    
    Note: Reasoning is not currently supported for audio generation.

## Request body

- AudioGenerationRequest — Request model for audio generation with Universal Schema + flat params
  - `user_id` string, required — The end-user ID
  - `project_id` string, nullable — The project ID
  - `persona_id` string, nullable — The specific system persona/voice to use
  - `disabled_learning` boolean — If true, this request is ignored by long-term memory
  - `text_input` string, required — The prompt/description for audio generation
  - `session_id` string, nullable — Session ID for conversation context
  - `use_reasoning` boolean — Enable Chain-of-Thought/Reasoning steps before answering
  - `max_reasoning_iterations` integer — Max reasoning steps if reasoning is enabled
  - `image_base64` string, nullable — Base64 encoded reference image for context
  - `video_base64` string, nullable — Base64 encoded reference video for context
  - `audio_base64` string, nullable — Base64 encoded reference audio for context
  - `model` string — Audio generation model: 'lyria-2' (Google Lyria 2 on Vertex AI, default for music — 30s 48kHz WAV), 'audiocraft' (MusicGen/AudioGen on Cloud Run), or 'eleven-turbo' (ElevenLabs TTS for speech)
  - `voice` string — Voice ID for TTS (alloy, echo, fable, onyx, nova, shimmer)
  - `audio_type` 'speech' | 'sfx' | 'music' — Audio type: 'speech', 'sfx', or 'music'
  - `speed` number — Playback speed (0.5-2.0), only for speech
  - `duration` number, nullable — Max duration in seconds for music/sfx (Lyria 2 always generates 30s)
  - `seed` integer, nullable — Random seed for deterministic generation (Lyria 2 only, cannot be combined with sample_count)

## Response `200`

Successful Response

- AudioGenerationResponse — Response model for audio generation
  - `audio_base64` string, nullable — Base64 encoded audio content. Present when the payload is under ~30 MB. May be absent for very large outputs.
  - `audio_url` string, nullable — Signed GCS URL to download the audio (expires after 24 h). Always present when the upload succeeds.
  - `output_type` string — Delivery method: 'both' (base64 + url), 'url' (url only, base64 omitted due to size), or 'base64' (GCS upload failed).
  - `audio_format` string, required — Audio format, e.g. mp3, wav
  - `duration_seconds` number, nullable — Duration of generated audio in seconds
  - `audio_type` string, required — Type of audio generated
  - `success` boolean — Whether the request succeeded

## Other responses

- `400` — Bad Request
- `401` — Unauthorized
- `404` — User/Persona/Project Not Found
- `422` — Validation Error
- `500` — Internal Server Error

---

[API](https://skmtc.net/elicitlabs/apis/elicit-labs-api.md) · [All operations](https://skmtc.net/elicitlabs/apis/elicit-labs-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/elicitlabs/elicit-labs-api/revisions/27701839a070/schema)
