### Quick Start: Initialize Client and Separate Audio
Source: https://docs.audiopod.ai/sdks/python
Initialize the AudioPod client with an API key and separate audio from a URL into six stems. This example demonstrates basic client initialization and stem separation.
```python
from audiopod import AudioPod
# Initialize client
client = AudioPod(api_key="ap_your_api_key")
# Separate audio into 6 stems
result = client.stems.separate(
url="https://youtube.com/watch?v=VIDEO_ID",
mode="six"
)
# Download stems
for stem, url in result["download_urls"].items():
print(f"{stem}: {url}")
```
--------------------------------
### Generate Music with Python SDK (Simple Mode)
Source: https://docs.audiopod.ai/api-reference/music/overview
Quick start example for generating music using the Python SDK in simple mode. Requires API key and specifies the music query.
```python
from audiopod import AudioPod
client = AudioPod(api_key="ap_your_api_key")
# Simple mode — AudioMusic V2 auto-generates everything
job = client.music.simple(
query="a soft Bengali love song for a quiet evening",
wait_for_completion=True
)
print(f"Music URL: {job['output_url']}")
```
--------------------------------
### Install Node.js SDK
Source: https://docs.audiopod.ai/sdks/nodejs
Install the audiopod package using npm or yarn.
```bash
npm install audiopod
# or
yarn add audiopod
```
--------------------------------
### Install Audiopod Node.js Package
Source: https://docs.audiopod.ai/quickstart
Install the audiopod Node.js library using npm.
```bash
npm install audiopod
```
--------------------------------
### Install Python SDK
Source: https://docs.audiopod.ai/
Install the Audiopod Python SDK using pip. This is the first step to using the Python client.
```python
pip install audiopod
```
--------------------------------
### Generate Music with Node.js SDK (Simple Mode)
Source: https://docs.audiopod.ai/api-reference/music/overview
Quick start example for generating music using the Node.js SDK in simple mode. Requires API key and specifies the music query.
```typescript
import AudioPod from 'audiopod';
const client = new AudioPod({ apiKey: 'ap_your_api_key' });
// Simple mode — AudioMusic V2 auto-generates everything
const job = await client.music.simple({
query: 'a soft Bengali love song for a quiet evening',
});
const completed = await client.music.waitForCompletion(job.id);
console.log(`Music URL: ${completed.output_url}`);
```
--------------------------------
### Get Public Video Info (Python)
Source: https://docs.audiopod.ai/api-reference/media-extraction
Python example for retrieving basic video metadata. Authentication is not required. Set 'include_formats' to False to limit format information.
```python
import requests
# Get basic video info (no auth required)
video_info_request = {
"url": "https://youtube.com/watch?v=example123",
"include_formats": False # Limited format info for public access
}
response = requests.post(
"https://api.audiopod.ai/api/v1/video/public/info",
json=video_info_request
)
if response.status_code == 200:
video_info = response.json()
print(f"Title: {video_info['title']}")
print(f"Duration: {video_info['duration']} seconds")
print(f"Uploader: {video_info['uploader']}")
print(f"View count: {video_info['view_count']}")
```
--------------------------------
### Get Authenticated Video Info (Python)
Source: https://docs.audiopod.ai/api-reference/media-extraction
Python example for retrieving comprehensive video metadata with authentication. Provide your API key in the headers. Set 'include_formats' to True to get all available formats and qualities.
```python
# Get comprehensive video info (authentication required)
video_info_request = {
"url": "https://youtube.com/watch?v=example123",
"include_formats": True # Get all available formats and qualities
}
response = requests.post(
"https://api.audiopod.ai/api/v1/video/info",
headers={"X-API-Key": api_key},
json=video_info_request
)
if response.status_code == 200:
video_info = response.json()
print(f"Title: {video_info['title']}")
print(f"Duration: {video_info['duration']} seconds")
print(f"Estimated credits: {video_info['estimated_credits']}")
# Available formats
for format_info in video_info.get("formats", []):
print(f"Format: {format_info['format']} - {format_info['quality']}")
```
--------------------------------
### Install audiopod CLI with pnpm
Source: https://docs.audiopod.ai/sdks/cli
Install the audiopod CLI globally using pnpm for Node.js environments.
```bash
pnpm add -g audiopod
```
--------------------------------
### Install Node.js SDK
Source: https://docs.audiopod.ai/
Install the Audiopod Node.js SDK using npm. This is required for using the Node.js client.
```javascript
npm install audiopod
```
--------------------------------
### Install Node.js SDK
Source: https://docs.audiopod.ai/sdks/overview
Install the official Node.js SDK using npm or yarn. This SDK is TypeScript-ready and uses a promise-based API.
```bash
npm install audiopod
```
```bash
yarn add audiopod
```
--------------------------------
### Install audiopod CLI with npm
Source: https://docs.audiopod.ai/sdks/cli
Install the audiopod CLI globally using npm for Node.js environments. Requires Node 16+.
```bash
npm install -g audiopod
```
--------------------------------
### Get Public Supported Formats (Python)
Source: https://docs.audiopod.ai/api-reference/media-extraction
Use the Python requests library to fetch public download formats. This example shows how to access video formats, audio formats, and limitations from the response.
```python
response = requests.get(
"https://api.audiopod.ai/api/v1/video/video-download/public/formats"
)
if response.status_code == 200:
formats = response.json()
print("Public formats available:")
print(f"Video: {formats['video_formats']}")
print(f"Audio: {formats['audio_formats']}")
print(f"Limitations: {formats['limitations']}")
```
--------------------------------
### Install MCP Server with Codex CLI
Source: https://docs.audiopod.ai/sdks/mcp
Add the Audiopod MCP server for the Codex CLI. Verify the installation using `codex mcp list`.
```bash
codex mcp add audiopod --url https://mcp.audiopod.ai \
--header "X-API-Key: ap_YOUR_KEY"
```
--------------------------------
### Install audiopod CLI with pip
Source: https://docs.audiopod.ai/sdks/cli
Install the audiopod CLI using pip for Python environments. Requires Python 3.8+.
```bash
pip install audiopod
```
--------------------------------
### Initiate Registration
Source: https://docs.audiopod.ai/api-reference/auth
Starts the user registration process by sending an email verification code.
```bash
curl -X POST "https://api.audiopod.ai/api/v1/auth/initiate-registration" \
-H "Content-Type: application/json" \
-d '{
"email": "dev@example.com",
"password": "SecurePass123",
"full_name": "Developer Name"
}'
```
--------------------------------
### Stem Separation Examples
Source: https://docs.audiopod.ai/sdks/python
Provides examples for stem separation using different sources (YouTube URL, local file) and modes. It also shows how to extract a single stem and handle asynchronous job processing.
```python
from audiopod import AudioPod
client = AudioPod(api_key="ap_your_api_key")
# Six-stem separation from YouTube (waits for completion by default)
result = client.stems.separate(
url="https://youtube.com/watch?v=VIDEO_ID",
mode="six"
)
print(result["download_urls"])
# From local file
result = client.stems.separate(
file="./song.mp3",
mode="four"
)
# Extract only vocals
result = client.stems.separate(
url="https://youtube.com/watch?v=VIDEO_ID",
mode="single",
stem="vocals"
)
# Async job handling (for more control)
job = client.stems.extract(
url="https://youtube.com/watch?v=VIDEO_ID",
mode="six"
)
print(f"Job ID: {job['id']}")
# Check status
status = client.stems.status(job["id"])
print(f"Status: {status['status']}")
# Wait for completion
result = client.stems.wait_for_completion(job["id"])
# Get available modes
modes = client.stems.modes()
for m in modes["modes"]:
print(f"{m['mode']}: {m['description']}")
```
--------------------------------
### Start Narration
Source: https://docs.audiopod.ai/api-reference/audiobook
Initiates the narration process for an audiobook project. Authentication is required.
```APIDOC
## Start Narration
### Description
Initiates the narration process for an audiobook project. Authentication is required.
### Method
POST
### Endpoint
/audiobook/projects/{project_id}/narration/start
### Parameters
#### Path Parameters
- **project_id** (string) - Required - The unique identifier of the project.
#### Request Body
(No specific request body fields are detailed in the source)
### Response
#### Success Response (200)
(No specific success response fields are detailed in the source)
ERROR HANDLING:
(No specific error handling details are provided in the source)
```
--------------------------------
### Initiate Registration
Source: https://docs.audiopod.ai/api-reference/auth
Starts the user registration process by sending a verification code to the provided email address.
```APIDOC
## POST /api/v1/auth/initiate-registration
### Description
Starts the user registration process by sending a verification code to the provided email address.
### Method
POST
### Endpoint
/api/v1/auth/initiate-registration
### Parameters
#### Request Body
- **email** (string) - Required - The email address for registration.
- **password** (string) - Required - The desired password for the account.
- **full_name** (string) - Required - The full name of the user.
### Request Example
```json
{
"email": "dev@example.com",
"password": "SecurePass123",
"full_name": "Developer Name"
}
```
### Response
#### Success Response (200)
- **message** (string) - Confirmation that a verification code has been sent.
### Response Example
```json
{
"message": "Verification code sent to your email. Please check your inbox."
}
```
```
--------------------------------
### Get Sample Data
Source: https://docs.audiopod.ai/api-reference/music/jobs
Retrieve sample or test data for development and testing purposes. Requires your API key.
```bash
curl "https://api.audiopod.ai/api/v1/music/sample-data" \
-H "X-API-Key: $AUDIOPOD_API_KEY"
```
--------------------------------
### Initialize Client with API Key and Typed Responses
Source: https://docs.audiopod.ai/sdks/nodejs
Demonstrates initializing the AudioPod client with an API key and shows how to use exported types for job and balance responses.
```typescript
import AudioPod, { StemExtractionJob, StemMode, WalletBalance } from 'audiopod';
const client = new AudioPod({ apiKey: 'ap_your_api_key' });
// Fully typed responses
const job: StemExtractionJob = await client.stems.extract({
url: 'https://...',
mode: 'six' as StemMode
});
const balance: WalletBalance = await client.wallet.balance();
```
--------------------------------
### Download Transcript in Multiple Formats (Python)
Source: https://docs.audiopod.ai/api-reference/speech-to-text
Python examples for downloading transcripts in JSON, SRT, and PDF formats using the requests library. Ensure you have the 'requests' library installed and provide your API key and job ID.
```python
# Download as JSON with full details
response = requests.get(
f"https://api.audiopod.ai/api/v1/transcription/jobs/{job_id}/transcript",
headers={"X-API-Key": api_key},
params={"format": "json"}
)
transcript_data = response.json()
# Download as SRT subtitle file
response = requests.get(
f"https://api.audiopod.ai/api/v1/transcription/jobs/{job_id}/transcript",
headers={"X-API-Key": api_key},
params={"format": "srt"}
)
with open("transcript.srt", "w") as f:
f.write(response.text)
# Download as PDF document
response = requests.get(
f"https://api.audiopod.ai/api/v1/transcription/jobs/{job_id}/transcript",
headers={"X-API-Key": api_key},
params={"format": "pdf"}
)
with open("transcript.pdf", "wb") as f:
f.write(response.content)
```
--------------------------------
### Generate Podcast Introduction with Inline Markup
Source: https://docs.audiopod.ai/api-reference/text-to-speech
Generates a podcast introduction using inline markup for delivery instructions like energy and pauses. Requires an API key and specifies MP3 format.
```python
intro_script = (
"[speak with warm upbeat energy] Welcome back to the Tech Talk Podcast! "
' '
"Today we're diving deep into artificial intelligence and its impact on "
'content creation. Let\'s get started!'
)
response = requests.post(
"https://api.audiopod.ai/api/v1/voice/voices/ava/generate",
headers={"Authorization": f"Bearer {API_KEY}"},
data={
"input_text": intro_script,
"audio_format": "mp3",
# Expressive read; see "Delivery & timestamp controls" above.
"generation_params": '{"delivery_mode":"creative"}',
},
)
job_id = response.json()["job_id"] # poll to COMPLETED, then download audio_url
```
--------------------------------
### Quick Start: Separate Audio Stems
Source: https://docs.audiopod.ai/sdks/nodejs
Initialize the client and separate audio into six stems from a YouTube URL. The download URLs for each stem are then logged.
```typescript
import AudioPod from 'audiopod';
// Initialize client
const client = new AudioPod({ apiKey: 'ap_your_api_key' });
// Separate audio into 6 stems
const result = await client.stems.separate({
url: 'https://youtube.com/watch?v=VIDEO_ID',
mode: 'six'
});
// Download stems
for (const [stem, url] of Object.entries(result.download_urls)) {
console.log(`${stem}: ${url}`);
}
```
--------------------------------
### Hello World: Stem Separation
Source: https://docs.audiopod.ai/
A basic example demonstrating how to use the Python SDK to separate a song into stems. Ensure the AUDIOPOD_API_KEY environment variable is set.
```python
from audiopod import AudioPod
client = AudioPod() # Uses AUDIOPOD_API_KEY env var
# Separate a song into vocals, drums, bass, guitar, piano, other
result = client.stems.separate(
url="https://youtube.com/watch?v=VIDEO_ID",
mode="six"
)
print(result["download_urls"])
```
--------------------------------
### Account API Response Example
Source: https://docs.audiopod.ai/api-reference/account
Example JSON structure for a successful user profile retrieval.
```json
{
"id": "uuid",
"email": "dev@example.com",
"full_name": "Developer Name",
"is_verified": true,
"created_at": "2025-01-01T00:00:00Z",
"updated_at": "2025-01-01T00:00:00Z"
}
```
--------------------------------
### Register Account via CLI
Source: https://docs.audiopod.ai/quickstart
Use this cURL command to initiate account registration by providing your email, password, and full name. Check your email for a verification code.
```bash
curl -X POST "https://api.audiopod.ai/api/v1/auth/initiate-registration" \
-H "Content-Type: application/json" \
-d '{
"email": "you@example.com",
"password": "YourSecurePassword123",
"full_name": "Your Name"
}'
```
--------------------------------
### Initialize Client Using Environment Variable
Source: https://docs.audiopod.ai/sdks/nodejs
Demonstrates initializing the AudioPod client when the API key is automatically read from the AUDIOPOD_API_KEY environment variable.
```typescript
// Client reads from env automatically
import AudioPod from 'audiopod';
const client = new AudioPod();
```
--------------------------------
### GET /api/v1/music/liked
Source: https://docs.audiopod.ai/api-reference/music/jobs
Get all tracks you've liked. Supports pagination and filtering by song type and status.
```APIDOC
## GET /api/v1/music/liked
### Description
Get all tracks you've liked. Supports pagination and filtering.
### Method
GET
### Endpoint
/api/v1/music/liked
### Query Parameters
- **skip** (int) - Optional - Pagination offset. Defaults to 0.
- **limit** (int) - Optional - Number of records to return. Defaults to 50.
- **song_type** (string) - Optional - Filter by category.
- **status** (string) - Optional - Filter by status.
### Request Example
```json
{
"example": "curl \"https://api.audiopod.ai/api/v1/music/liked?limit=20\" \
-H \"X-API-Key: $AUDIOPOD_API_KEY\""
}
```
### Response
#### Success Response (200)
- **tracks** (array) - A list of liked tracks.
- **pagination** (object) - Pagination details.
### Response Example
```json
{
"tracks": [
{
"id": "track_123",
"title": "My Awesome Song",
"artist": "Me",
"liked_at": "2023-10-27T10:00:00Z"
}
],
"pagination": {
"skip": 0,
"limit": 20,
"total": 100
}
}
```
```
--------------------------------
### Configure OpenAI Client for AudioPod (Python)
Source: https://docs.audiopod.ai/api-reference/openai-compatibility
Initialize the OpenAI Python client with AudioPod's base URL and your API key. Ensure you have the `openai` library installed.
```python
from openai import OpenAI
client = OpenAI(
base_url="https://api.audiopod.ai/api/v1",
api_key="ap_your_api_key",
)
```
--------------------------------
### Noise Reduction API Response Example
Source: https://docs.audiopod.ai/api-reference/noise-reduction
An example of the JSON response received when initiating a noise reduction job.
```json
{
"id": 123,
"status": "PROCESSING",
"progress": 0,
"input_path": "/uploads/noisy_recording.wav",
"is_video": false,
"task_id": "celery_task_uuid_here",
"created_at": "2024-01-15T10:30:00Z",
"original_filename": "noisy_recording.wav",
"display_name": "noisy_recording.wav"
}
```
--------------------------------
### Configure OpenAI Client for AudioPod (Node.js)
Source: https://docs.audiopod.ai/api-reference/openai-compatibility
Initialize the OpenAI Node.js client with AudioPod's base URL and your API key. Ensure you have the `openai` library installed.
```javascript
import OpenAI from "openai";
const client = new OpenAI({
baseURL: "https://api.audiopod.ai/api/v1",
apiKey: "ap_your_api_key",
});
```
--------------------------------
### Example Job Completed Event Payload
Source: https://docs.audiopod.ai/account/webhooks
This is an example of the JSON payload for a 'job.completed' event. It includes event identification and job-specific details.
```json
{
"event_type": "job.completed",
"event_id": "f0a1…",
"job_id": 999001,
"job_type": "text_to_speech",
"status": "completed"
}
```
--------------------------------
### Get Music Generation Job Status (cURL)
Source: https://docs.audiopod.ai/api-reference/music/jobs
Make a direct HTTP request to get the status of a music generation job.
```bash
curl "https://api.audiopod.ai/api/v1/music/jobs/123/status" \
-H "X-API-Key: $AUDIOPOD_API_KEY"
```
--------------------------------
### Get job status
Source: https://docs.audiopod.ai/api-reference/text-to-speech
Retrieves the current status of a speech generation job. You can poll this endpoint until the job is completed to get the output URL.
```APIDOC
## GET /api/v1/voice/tts-jobs/{job_id}/status
### Description
Retrieves the current status of a speech generation job.
### Method
GET
### Endpoint
/api/v1/voice/tts-jobs/{job_id}/status
#### Path Parameters
- **job_id** (integer) - Required - The ID of the speech generation job.
### Response
#### Success Response (200)
- **status** (string) - The current status of the job (e.g., 'completed', 'failed', 'processing').
- **output_url** (string) - The URL to the generated audio file if the job is completed.
### Request Example
```bash
curl -X GET "https://api.audiopod.ai/api/v1/voice/tts-jobs/1234/status" \
-H "X-API-Key: $AUDIOPOD_API_KEY"
```
### Response Example
```json
{
"status": "completed",
"output_url": "https://api.audiopod.ai/output/audio.mp3"
}
```
```
--------------------------------
### Create Podcast Project (Python)
Source: https://docs.audiopod.ai/api-reference/podcast
This Python script demonstrates creating a podcast project using the requests library. It sends a POST request with project details and prints the created project ID.
```python
import requests
project = requests.post(
"https://api.audiopod.ai/api/v1/podcast/projects",
headers={"X-API-Key": api_key, "Content-Type": "application/json"},
json={
"title": "The Future of Audio AI",
"topic": "How on-device audio models change creator workflows",
"language": "en",
"target_duration_minutes": 15,
"speakers": [
{"name": "Host", "voice": "aura"},
{"name": "Guest", "voice": "sage"},
],
},
).json()
print(f"Project {project['id']} created")
```
--------------------------------
### Create a Project
Source: https://docs.audiopod.ai/api-reference/podcast
Creates a new podcast project with specified details including title, topic, language, duration, and speakers.
```APIDOC
## Create a Project
### Description
Creates a new podcast project with specified details including title, topic, language, duration, and speakers.
### Method
POST
### Endpoint
/api/v1/podcast/projects
### Parameters
#### Request Body
- **title** (string) - Required - Episode title (1–200 characters)
- **topic** (string) - Required - Main topic (1–500 characters)
- **briefing** (string) - Optional - Extra context / tone guidance
- **language** (string) - Optional - Primary language code (default `en`)
- **target_duration_minutes** (integer) - Optional - Target length, 5–60
- **speakers** (array) - Required - 1–4 initial speakers. Each speaker object should have:
- **name** (string) - Speaker's name
- **voice** (string) - The voice to use for the speaker
### Request Example
```json
{
"title": "The Future of Audio AI",
"topic": "How on-device audio models change creator workflows",
"briefing": "Keep it upbeat and accessible for a general audience.",
"language": "en",
"target_duration_minutes": 15,
"speakers": [
{ "name": "Host", "voice": "aura" },
{ "name": "Guest", "voice": "sage" }
]
}
```
### Response
#### Success Response (200)
- **id** (string) - The unique identifier for the created project.
```
--------------------------------
### Create Project
Source: https://docs.audiopod.ai/api-reference/audiobook
Creates a new audiobook project. Authentication is required.
```APIDOC
## Create Project
### Description
Creates a new audiobook project. Authentication is required.
### Method
POST
### Endpoint
/audiobook/projects
### Parameters
#### Request Body
(No specific request body fields are detailed in the source)
### Response
#### Success Response (200)
(No specific success response fields are detailed in the source)
ERROR HANDLING:
(No specific error handling details are provided in the source)
```
--------------------------------
### Get Download Job Status (HTTP)
Source: https://docs.audiopod.ai/api-reference/media-extraction
Use this HTTP GET request to retrieve the status and progress of a specific video download job using its ID.
```http
GET /api/v1/video/video-download/jobs/{job_id}
X-API-Key: {api_key}
```
--------------------------------
### Create a Project with cURL
Source: https://docs.audiopod.ai/api-reference/audiobook
Use this cURL command to create a new audiobook project. Specify the title, author, and optionally other metadata like genre.
```bash
curl -X POST "$AP/audiobook/projects" -H "X-API-Key: $AUDIOPOD_API_KEY" \
-H "Content-Type: application/json" \
-d '{"title":"The Lighthouse Keeper","author":"A. P. Tester","genre":"Fiction"}'
```
--------------------------------
### GET /api/v1/music/jobs/counts
Source: https://docs.audiopod.ai/api-reference/music/jobs
Get aggregated counts of your music generation jobs, broken down by task type and song category. Supports filtering by status and song type.
```APIDOC
## GET /api/v1/music/jobs/counts
### Description
Get aggregated counts of your music generation jobs, broken down by task type and song category.
### Method
GET
### Endpoint
/api/v1/music/jobs/counts
### Query Parameters
- **status** (string) - Optional - Filter by status
- **song_type** (string) - Optional - Filter by category: `rap`, `song`, `vocals`, `instrumental`, `samples`
### Response
#### Success Response (200)
- **total** (integer) - Total number of jobs.
- **by_task** (object) - Counts broken down by task type.
- **by_song_type** (object) - Counts broken down by song category.
- **filters** (object) - The filters applied to the request.
### Request Example
```json
{
"example": "curl \"https://api.audiopod.ai/api/v1/music/jobs/counts?status=COMPLETED\" \
-H \"X-API-Key: $AUDIOPOD_API_KEY\""
}
```
### Response Example
```json
{
"total": 150,
"by_task": {
"text2music": 80,
"prompt2instrumental": 40,
"text2rap": 20,
"retake": 10
},
"by_song_type": {
"songs": 80,
"rap": 20,
"instrumental": 40,
"edits": 10
},
"filters": {
"status": null,
"song_type": null
}
}
```
```
--------------------------------
### Generate Music with Reference Audio (Python)
Source: https://docs.audiopod.ai/api-reference/music/audio-tools
Use the Python client to generate music based on a reference audio file. Set `wait_for_completion=True` to block until the job is finished. Requires the `audiopod` library.
```python
job = client.music.reference(
reference_audio_url="https://example.com/reference-track.mp3",
caption="upbeat pop song with similar vocal warmth and production style",
lyrics="[Verse]\nHello world\n[Chorus]\nLa la la",
wait_for_completion=True
)
print(f"Reference-guided URL: {job['output_url']}")
```
--------------------------------
### User Download Statistics Response Example
Source: https://docs.audiopod.ai/api-reference/media-extraction
Example JSON response structure for the user download statistics endpoint, detailing total downloads, duration, credits, and platform/format breakdowns.
```json
{
"total_downloads": 45,
"total_duration": 12450.5,
"total_credits_used": 1245,
"downloads_by_platform": {
"youtube": 25,
"tiktok": 15,
"instagram": 5
},
"downloads_by_format": {
"mp3": 30,
"mp4": 15
},
"recent_downloads": [
{
"id": 123,
"title": "Recent Video",
"platform": "youtube",
"status": "COMPLETED",
"created_at": "2024-01-15T10:30:00Z"
}
]
}
```
--------------------------------
### Stem Separation Examples
Source: https://docs.audiopod.ai/sdks/nodejs
Provides examples for stem separation using different modes and sources. Includes extracting specific stems, processing local files, and initiating asynchronous jobs.
```typescript
import AudioPod from 'audiopod';
const client = new AudioPod({ apiKey: 'ap_your_api_key' });
// Six-stem separation from YouTube
const result = await client.stems.separate({
url: 'https://youtube.com/watch?v=VIDEO_ID',
mode: 'six'
});
console.log(result.download_urls);
// From local file
const result = await client.stems.separate({
file: './song.mp3',
mode: 'four'
});
// Extract only vocals
const result = await client.stems.separate({
url: 'https://youtube.com/watch?v=VIDEO_ID',
mode: 'single',
stem: 'vocals'
});
// Async job handling (for more control)
const job = await client.stems.extract({
url: 'https://youtube.com/watch?v=VIDEO_ID',
mode: 'six'
});
console.log(`Job ID: ${job.id}`);
// Wait for completion
const result = await client.stems.waitForCompletion(job.id);
// Get available modes
const modes = await client.stems.modes();
modes.modes.forEach(m => {
console.log(`${m.mode}: ${m.description}`);
});
```
--------------------------------
### JSON Response Format Example
Source: https://docs.audiopod.ai/api-reference/speech-to-text
This is an example of the JSON response structure returned by the API when requesting a transcript in JSON format. It includes job details, segments, speaker information, and video metadata.
```json
{
"job_id": 123,
"detected_language": "en",
"confidence_score": 0.92,
"total_duration": 1847.5,
"segments": [
{
"id": 1,
"start": 0.0,
"end": 4.5,
"text": "Welcome to our podcast about artificial intelligence.",
"confidence": 0.95,
"speaker_id": 0,
"speaker_label": "SPEAKER_00",
"words": [
{
"word": "Welcome",
"start": 0.0,
"end": 0.8,
"probability": 0.98
},
{
"word": "to",
"start": 0.8,
"end": 1.0,
"probability": 0.99
}
]
},
{
"id": 2,
"start": 5.0,
"end": 8.2,
"text": "Thank you for having me on the show.",
"confidence": 0.89,
"speaker_id": 1,
"speaker_label": "SPEAKER_01",
"words": [...]
}
],
"speakers": [
{
"id": 0,
"label": "SPEAKER_00",
"total_speaking_time": 920.3
},
{
"id": 1,
"label": "SPEAKER_01",
"total_speaking_time": 827.2
}
],
"video_metadata": [
{
"video_id": "example123",
"title": "AI Technology Discussion",
"description": "A deep dive into AI technology trends",
"duration": 1847.5,
"uploader": "Tech Channel",
"upload_date": "20240115"
}
]
}
```
--------------------------------
### Initialize AudioPod Client
Source: https://docs.audiopod.ai/sdks/python
Initialize the AudioPod client in Python. The client automatically reads the API key from the environment variable.
```python
# Client reads from env automatically
from audiopod import AudioPod
client = AudioPod()
```
--------------------------------
### Generate Voice Preview (Python)
Source: https://docs.audiopod.ai/api-reference/voice-management
This Python script demonstrates how to request a voice preview, retrieve the audio URL and duration, and download the audio file. Ensure the `requests` library is installed.
```python
voice_identifier = "123" # Voice ID or UUID
response = requests.get(
f"https://api.audiopod.ai/api/v1/voice/voice-profiles/{voice_identifier}/preview",
headers={"X-API-Key": api_key},
params={
"audio_format": "mp3",
"generate_if_missing": True
}
)
if response.status_code == 200:
preview_result = response.json()
print(f"Preview URL: {preview_result['audio_url']}")
print(f"Duration: {preview_result['duration']} seconds")
# Download preview audio
audio_response = requests.get(preview_result['audio_url'])
with open("voice_preview.mp3", "wb") as f:
f.write(audio_response.content)
print("Preview saved as voice_preview.mp3")
```
--------------------------------
### Create Custom Voice Response Example
Source: https://docs.audiopod.ai/api-reference/voice-management
This is an example of the JSON response received after successfully initiating the creation of a custom voice profile. It includes details about the created voice and its initial processing status.
```json
{
"id": 123,
"uuid": "550e8400-e29b-41d4-a716-446655440000",
"name": "My Custom Voice",
"description": "Professional voice for presentations",
"voice_type": "CUSTOM",
"status": "PROCESSING",
"created_at": "2024-01-15T10:30:00Z",
"processed_at": null,
"is_public": false,
"file_path": "/voices/custom/voice_123.wav"
}
```
--------------------------------
### Get Transcription Job Status (Python)
Source: https://docs.audiopod.ai/api-reference/speech-to-text
This Python snippet demonstrates how to make a request to get the status of a transcription job and print its progress. It also shows how to access details when the job is completed.
```python
response = requests.get(
f"https://api.audiopod.ai/api/v1/transcription/jobs/{job_id}",
headers={"X-API-Key": api_key}
)
job_status = response.json()
print(f"Status: {job_status['status']}")
print(f"Progress: {job_status['progress']}")
if job_status["status"] == "COMPLETED":
print(f"Transcript ready! Duration: {job_status['total_duration']} seconds")
print(f"Detected language: {job_status['detected_language']}")
print(f"Confidence: {job_status['confidence_score']}")
```
--------------------------------
### Generate Music with Simple Mode (Python)
Source: https://docs.audiopod.ai/api-reference/music/generation
Use the AudioPod client to generate music by describing your desired track in natural language. This example shows how to create a standard track, an instrumental track, and specify vocal language.
```python
from audiopod import AudioPod
client = AudioPod(api_key="ap_your_api_key")
# Just describe what you want
job = client.music.simple(
query="energetic K-pop dance track with catchy hooks and a powerful chorus",
wait_for_completion=True
)
print(f"Music URL: {job['output_url']}")
# Instrumental with language preference
job = client.music.simple(
query="epic cinematic trailer music with orchestral elements",
instrumental=True,
wait_for_completion=True
)
# Specify language for vocals
job = client.music.simple(
query="a romantic ballad about lost love",
vocal_language="ja", # Japanese
wait_for_completion=True
)
```
--------------------------------
### Node.js: AI Noise Reduction for Audio
Source: https://docs.audiopod.ai/api-reference/noise-reduction
Conceptual example for performing AI noise reduction on audio files using the AudioPod Node.js SDK. Note that this example is conceptual and may require updates based on the latest SDK.
```javascript
// Note: SDK examples shown are conceptual and may not reflect the current SDK implementation
// For production use, refer to the Raw HTTP examples or check the latest SDK documentation
const { AudioPodClient } = require('audiopod-js');
const fs = require('fs');
const client = new AudioPodClient();
async function denoiseAudio() {
try {
// Simple noise reduction
const denoised = await client.denoiser.denoiseAudio({
audioFile: fs.createReadStream('noisy_recording.wav'),
qualityMode: 'balanced', // "balanced", "studio"
waitForCompletion: true
});
console.log('Denoising completed!');
console.log(`Input file: ${denoised.inputFile}`);
console.log(`Denoised audio URL: ${denoised.denoisedAudioUrl}`);
console.log(`Noise reduction level: ${denoised.noiseReductionDb}dB`);
```
--------------------------------
### Initialize AudioPod Client in Python
Source: https://docs.audiopod.ai/account/api-keys
Initialize the AudioPod client in Python. It can automatically read the API key from the AUDIOPOD_API_KEY environment variable or accept it explicitly.
```python
from audiopod import AudioPod
# Auto-reads from AUDIOPOD_API_KEY env var
client = AudioPod()
# Or pass explicitly
client = AudioPod(api_key="ap_your_key_here")
```
--------------------------------
### Get one
Source: https://docs.audiopod.ai/account/webhooks
Retrieves details for a specific webhook endpoint by its ID.
```APIDOC
## GET /api/v1/webhooks/endpoints/{id}
### Description
Retrieves details for a specific webhook endpoint by its ID.
### Method
GET
### Endpoint
/api/v1/webhooks/endpoints/{id}
#### Path Parameters
- **id** (string) - Required - The unique identifier of the webhook endpoint.
```
--------------------------------
### Create a Project with Python
Source: https://docs.audiopod.ai/api-reference/audiobook
This Python snippet shows how to create an audiobook project using the requests library. It sends a POST request with project details in JSON format and extracts the project ID from the response.
```python
import requests
AP, H = "https://api.audiopod.ai/api/v1", {"X-API-Key": "ap_..."}
project = requests.post(f"{AP}/audiobook/projects", headers=H, json={
"title": "The Lighthouse Keeper", "author": "A. P. Tester", "genre": "Fiction",
}).json()
pid = project["id"]
```
--------------------------------
### AudioPod Client Initialization
Source: https://docs.audiopod.ai/sdks/nodejs
Initializes the AudioPod client with an API key, either directly or via an environment variable.
```APIDOC
## AudioPod Client Initialization
### Description
Initializes the AudioPod client with an API key. You can pass the API key directly during instantiation or set the `AUDIOPOD_API_KEY` environment variable for a more secure approach.
### Method
`new AudioPod({ apiKey: 'your_api_key' })` or `new AudioPod()` (if environment variable is set)
### Parameters
#### Constructor Parameters
- **apiKey** (string) - Optional - Your AudioPod API key. If not provided, the SDK will look for the `AUDIOPOD_API_KEY` environment variable.
### Request Example
```typescript
import AudioPod from 'audiopod';
// Method 1: Pass API key directly
const client = new AudioPod({ apiKey: 'ap_your_api_key' });
// Method 2: Use environment variable (recommended)
// Set AUDIOPOD_API_KEY environment variable, then:
const client = new AudioPod();
```
```
--------------------------------
### Get One Project
Source: https://docs.audiopod.ai/api-reference/podcast
Retrieves details for a specific project by its ID.
```APIDOC
## Get One Project
### Description
Retrieves details for a specific project.
### Method
GET
### Endpoint
/api/v1/podcast/projects/{id}
```
--------------------------------
### Clone Voice from Audio Sample
Source: https://docs.audiopod.ai/sdks/python
This example demonstrates how to create a custom voice by providing an audio sample. The cloned voice can then be used for text-to-speech generation. Initialize the AudioPod client with your API key.
```python
from audiopod import AudioPod
client = AudioPod(api_key="ap_your_api_key")
# Clone a voice from audio sample
voice = client.voice.clone(
file="./sample.wav",
name="My Voice"
)
print(f"Voice ID: {voice['id']}")
```
--------------------------------
### Get Current User
Source: https://docs.audiopod.ai/api-reference/auth
Retrieves the details of the currently authenticated user.
```APIDOC
## GET /api/v1/auth/me
### Description
Retrieves the details of the currently authenticated user.
### Method
GET
### Endpoint
/api/v1/auth/me
### Authentication
Requires `X-API-Key` or `Authorization: Bearer {token}` header.
### Response
#### Success Response (200)
- **id** (string) - The unique identifier for the user.
- **email** (string) - The email address of the user.
- **full_name** (string) - The full name of the user.
- **is_verified** (boolean) - Indicates if the user's email is verified.
- **created_at** (string) - The timestamp when the user account was created.
### Response Example
```json
{
"id": "uuid",
"email": "dev@example.com",
"full_name": "Developer Name",
"is_verified": true,
"created_at": "2025-01-01T00:00:00Z"
}
```
```
--------------------------------
### Initialize and Separate Audio Stems in Python
Source: https://docs.audiopod.ai/sdks/overview
Initializes the AudioPod client and separates audio into stems using a provided URL. The client can be initialized using an environment variable or by passing the API key directly. The result contains download URLs for each stem.
```python
from audiopod import AudioPod
# Initialize client (uses AUDIOPOD_API_KEY env var)
client = AudioPod()
# Or pass API key directly
client = AudioPod(api_key="ap_your_api_key")
# Separate audio into stems
result = client.stems.separate(
url="https://youtube.com/watch?v=VIDEO_ID",
mode="six"
)
# Download stems
for stem, url in result["download_urls"].items():
print(f"{stem}: {url}")
```
--------------------------------
### Get Profile
Source: https://docs.audiopod.ai/api-reference/account
Fetches the current user's profile information.
```APIDOC
## GET /api/v1/auth/me
### Description
Fetches the current user's profile information.
### Method
GET
### Endpoint
/api/v1/auth/me
### Response
#### Success Response (200)
- **id** (string) - The unique identifier for the user.
- **email** (string) - The user's email address.
- **full_name** (string) - The user's full name.
- **is_verified** (boolean) - Indicates if the user's email is verified.
- **created_at** (string) - The timestamp when the user account was created.
- **updated_at** (string) - The timestamp when the user account was last updated.
### Response Example
{
"id": "uuid",
"email": "dev@example.com",
"full_name": "Developer Name",
"is_verified": true,
"created_at": "2025-01-01T00:00:00Z",
"updated_at": "2025-01-01T00:00:00Z"
}
```
--------------------------------
### Get Chapter by ID
Source: https://docs.audiopod.ai/api-reference/audiobook
Fetches a specific chapter using its unique ID.
```APIDOC
## GET /audiobook/projects/{project_id}/chapters/{chapter_id}
### Description
Fetches a specific chapter using its unique ID.
### Method
GET
### Endpoint
/audiobook/projects/{project_id}/chapters/{chapter_id}
### Parameters
#### Path Parameters
- **project_id** (string) - Required - The UUID of the project.
- **chapter_id** (string) - Required - The UUID of the chapter.
### Response
#### Success Response (200)
- **id** (string) - Chapter UUID.
- **chapter_number** (integer) - Order in the book.
- **title** (string) - Chapter title.
- **content** (string) - Chapter text.
- **word_count** (integer) - Words in the chapter.
- **character_count** (integer) - Characters in the chapter.
- **duration_seconds** (number) - Narrated length, once generated.
- **status** (string) - `pending` · `processing` · `completed` · `failed`.
- **audio_file_path** (string) - Stored audio key, once narrated.
- **error_message** (string) - Reason a chapter failed (e.g. content too short for narration).
- **skip_narration** (boolean) - If true, the chapter is excluded from narration and export.
- **voice_id** (integer) - Per-chapter voice override.
```
--------------------------------
### List Voice Collections (Python)
Source: https://docs.audiopod.ai/api-reference/voice-management
This Python example shows how to fetch voice collections. It iterates through the response to print details of each collection, including its name, description, and voice count.
```python
response = requests.get(
"https://api.audiopod.ai/api/v1/voice/collections",
headers={"X-API-Key": api_key},
params={"limit": 25, "skip": 0}
)
if response.status_code == 200:
collections = response.json()
for collection in collections["collections"]:
print(f"Collection: {collection['name']}")
print(f" Description: {collection['description']}")
print(f" Voices: {len(collection['voice_ids'])}")
print(f" Created: {collection['created_at']}")
print()
```
--------------------------------
### GET /api/v1/music/sample-data
Source: https://docs.audiopod.ai/api-reference/music/jobs
Retrieves sample or test data for development and testing purposes.
```APIDOC
## GET /api/v1/music/sample-data
### Description
Get sample/test data for development and testing purposes.
### Method
GET
### Endpoint
/api/v1/music/sample-data
### Request Example
```bash
curl "https://api.audiopod.ai/api/v1/music/sample-data" \
-H "X-API-Key: $AUDIOPOD_API_KEY"
```
```
--------------------------------
### Manual MCP Server Configuration for Continue
Source: https://docs.audiopod.ai/sdks/mcp
Integrate the Audiopod MCP server into Continue by editing its `config.json` file under the `experimental.modelContextProtocolServers` section.
```json
{
"experimental": {
"modelContextProtocolServers": [
{
"transport": {
"type": "streamable-http",
"url": "https://mcp.audiopod.ai",
"headers": { "X-API-Key": "ap_YOUR_KEY" }
}
}
]
}
}
```