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

# Generate Audio URL

> Generate a shareable streaming URL for an audio file

Generate shareable URLs for streaming or downloading audio files.

<CodeGroup>
  ```python Python theme={null}
  import videodb

  conn = videodb.connect(api_key="your_api_key")
  coll = conn.get_collection()
  audio = coll.get_audio("a-abc123def")

  # Generate download/streaming URL
  url = audio.generate_url()
  print(f"Audio URL: {url}")
  # https://cdn.videodb.io/v3/{collection}/{audio}.mp3
  ```

  ```javascript Node.js theme={null}
  import { connect } from 'videodb';

  const conn = connect({ apiKey: 'your_api_key' });
  const coll = await conn.getCollection();
  const audio = await coll.getAudio("a-abc123def");

  // Generate download/streaming URL
  const url = await audio.generateUrl();
  console.log(`Audio URL: ${url}`);
  // https://cdn.videodb.io/v3/{collection}/{audio}.mp3
  ```
</CodeGroup>

<Note>
  * URLs are CDN-hosted and can be shared directly
  * Format is MP3 or original audio format
  * URLs remain valid for extended periods
  * Useful for embedding in web players or sending via email
</Note>

<CardGroup cols={2}>
  <Card title="Streams and Exports" icon="download" href="/pages/act/output-and-delivery/streams-and-exports">
    Learn about generating URLs and streaming options
  </Card>

  <Card title="Get Audio Details" icon="music" href="/api-reference/audio/get_audio">
    Retrieve audio metadata before generating URLs
  </Card>
</CardGroup>


## OpenAPI

````yaml POST /audio/{audio_id}/generate_url
openapi: 3.0.3
info:
  title: VideoDB Server API
  description: >
    VideoDB Server API for video, audio, and image processing with AI
    capabilities.

    This API provides comprehensive video management, search, indexing, and
    AI-powered features.
  version: 1.0.0
  contact:
    name: VideoDB Support
    url: https://videodb.io
  license:
    name: MIT
    url: https://opensource.org/licenses/MIT
servers:
  - url: https://api.videodb.io
    description: Production server
  - url: https://staging-api.videodb.io
    description: Staging server
security:
  - ApiKeyAuth: []
tags:
  - name: Authentication
    description: User authentication and API key management
  - name: Collections
    description: Collection management operations
  - name: Videos
    description: Video upload, processing, and management
  - name: Audio
    description: Audio management operations
  - name: Images
    description: Image management operations
  - name: Search
    description: Content search and indexing
  - name: AI Generation
    description: AI-powered content generation
  - name: Billing
    description: Billing and usage management
  - name: RTStream
    description: Real-time streaming operations
  - name: Utilities
    description: Utility endpoints
  - name: Meeting
    description: Meeting recording and management
  - name: Capture
    description: Capture session management for recording streams
  - name: Editor
    description: Timeline editor operations
  - name: Transcode
    description: Media transcoding operations
  - name: Assets
    description: Cross-collection asset listing
paths:
  /audio/{audio_id}/generate_url:
    post:
      summary: Generate audio stream URL
      parameters:
        - name: audio_id
          in: path
          required: true
          schema:
            type: string
            pattern: ^a-
            example: a-12345
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                format:
                  type: string
                  enum:
                    - mp3
                    - wav
                    - flac
                  example: mp3
                quality:
                  type: string
                  enum:
                    - low
                    - medium
                    - high
                  example: high
      responses:
        '200':
          description: Stream URL generated
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    example: true
                  data:
                    type: object
                    properties:
                      stream_url:
                        type: string
                        example: https://stream.videodb.io/a/12345
      security:
        - ApiKeyAuth: []
components:
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: x-access-token
      description: API key for authentication (sk-xxx format)

````