AD SPACE AVAILABLE · BRAND PARTNERS WELCOME

How to Integrate the Kits AI API for Programmatic Batch Voice Conversion and Stem Separation

Baptiste Aulanier · 365Finds Editorial
Indexed 88,650 Wiki articles

Put 365 Wiki to work with your AI

Copy the prompt below, paste it into the AI you already use, then ask your question.

Download full Skill

Try it with the prompt first. If you use 365 Wiki often, install the full 365Wiki Skill so you do not have to paste it again. No regular AI? Gemini or Microsoft Copilot on the web will work.

365Wiki Skill

Moving vocal production and dialogue localization from manual web uploads to an automated backend pipeline is a necessary leap for audio engineers, game audio directors, and music tech developers. Relying on the Kits AI web dashboard to manually upload audio tracks, select voice models, tweak sliders, and wait for individual downloads breaks down as soon as a project scales to hundreds of dialogue lines, multi-track vocal stems, or automated game character voice pipelines.

At 365Finds, our evaluation is clear: Kits AI provides one of the cleanest, musically aware RESTful APIs for voice conversion and stem separation on the market. Its inclusion of studio-grade digital signal processing (DSP) filters—such as noise gates, high-pass filters, compressors, and reverb directly within the conversion payload—eliminates unnecessary intermediate processing stages. However, integrating it into a high-throughput production environment requires solving three architectural constraints: navigating strict API rate limits, handling asynchronous job queues with persistent polling, and immediately caching generated audio files before their signed download URLs expire.

Here is the complete engineering guide to authenticating, submitting jobs, and orchestrating batch voice conversion and stem separation workflows with the Kits AI API.


1. Authentication and Base Architecture

Kits AI hosts its REST API under the Arpeggi Labs infrastructure:

Generating an API Key

  1. Log into your Kits AI account dashboard.
  2. Navigate to the API tab on the left-hand navigation bar (or visit https://app.kits.ai/api-access).
  3. Click New Token, provide an identifier, and copy the generated secret immediately. The token is shown only once upon creation.

Querying Voice Model IDs

Voice conversions require a valid voiceModelId. You can resolve model identifiers dynamically by calling the voice model endpoint:

GET https://arpeggi.io/api/kits/v1/voice-models?myModels=false&perPage=20 HTTP/1.1
Authorization: Bearer YOUR_API_KEY

To fetch only custom-trained models associated with your workspace, set myModels=true. The JSON response delivers a paginated list of models containing their numerical id, title, and associated tags (e.g., genre, pitch range, vocal style).


2. Programmatic Voice Conversion Pipeline

The voice conversion endpoint accepts an input speech or singing audio track and restyles it using a target voice model.

Submission Endpoint and Payload Parameters

ParameterTypeRequiredDescription
voiceModelIdNumberYesTarget voice model numerical ID.
soundFileBinary FileYesInput audio file (WAV, MP3, FLAC; max 100MB).
conversionStrengthNumber (0.0 to 1.0)NoAccent and timbre intensity of the target voice. Higher values enforce voice character but may increase phoneme artifacts.
modelVolumeMixNumber (0.0 to 1.0)NoBalances original input volume dynamics against model output normalization.
pitchShiftNumber (-24 to +24)NoSemitone pitch transposition applied to the input audio.
preJSON ObjectNoPre-processing DSP chain applied to input audio prior to model inference.
postJSON ObjectNoPost-processing DSP chain applied to synthesized audio prior to final rendering.

Built-in Pre- and Post-Processing DSP

A standout advantage of the Kits AI API is in-payload DSP manipulation, allowing audio engineers to clean up raw dialogue or polish final vocal stems without chaining external DAW plugins:

Asynchronous Execution and Status Polling

Upon submission, the server returns HTTP 201 Created with an initial job object:

{
  "id": 142857,
  "createdAt": "2026-10-27 10:00:00.000000 +00:00",
  "type": "infer",
  "voiceModelId": 1014961,
  "status": "running",
  "jobStartTime": "2026-10-27 10:00:02.000000 +00:00",
  "jobEndTime": null
}

The client must periodically query GET https://arpeggi.io/api/kits/v1/voice-conversions/142857. When status transitions to "success", the response populates the download fields:

[!IMPORTANT] All signed audio output URLs returned by Kits AI expire after 4 hours. Automated production pipelines must download and ingest these assets into permanent storage (e.g., local shared storage or Amazon S3) immediately upon job completion.


3. Programmatic Stem Separation Pipeline

When working with pre-mixed tracks or live recordings where vocals and instruments are blended, running voice conversion directly on the raw file produces severe model degradation. Kits AI's stem separation endpoint splits mixed tracks into isolated musical stems prior to downstream voice processing.

Submission Endpoint and Request Format

ParameterTypeRequiredDescription
inputFileBinary FileYesInput mixed audio file (WAV, MP3, FLAC, WEBM; max 50MB).

Retrieving Stem Results

Polling GET https://arpeggi.io/api/kits/v1/stem-splits/{id} yields the resolved stems once processing completes:

{
  "id": 89201,
  "createdAt": "2026-10-27 10:05:12.000000 +00:00",
  "type": "separate",
  "status": "success",
  "jobStartTime": "2026-10-27 10:05:14.000000 +00:00",
  "jobEndTime": "2026-10-27 10:06:05.000000 +00:00",
  "vocalAudioFileUrl": "https://arpeggi-prod-public.s3.us-west-2.amazonaws.com/...",
  "lossyVocalAudioFileUrl": "https://...",
  "stemFileUrls": [
    { "instrument": "vocals", "url": "https://arpeggi-prod-public.s3.us-west-2.amazonaws.com/..." },
    { "instrument": "backing", "url": "https://arpeggi-prod-public.s3.us-west-2.amazonaws.com/..." },
    { "instrument": "harmony", "url": "https://arpeggi-prod-public.s3.us-west-2.amazonaws.com/..." },
    { "instrument": "reverb", "url": "https://arpeggi-prod-public.s3.us-west-2.amazonaws.com/..." }
  ]
}

[!NOTE] The top-level attribute backingAudioFileUrl is deprecated in favor of the structured stemFileUrls array. Developers should parse stemFileUrls matching instrument == "vocals" and instrument == "backing" for downstream routing.


4. End-to-End Batch Automation Architecture

In an enterprise game audio or commercial dubbing pipeline, processing hundreds of files simultaneously will trigger HTTP 429 errors if dispatched naively.

Understanding Rate Limits

Kits AI enforces rate limits tied directly to your overall account rather than individual API keys:

Developers building batch pipelines must request an increased rate limit via Kits AI official support (https://help.kits.ai/hc/en-us/requests/new) or implement strict concurrency throttling via an asynchronous semaphore and token bucket.

Complete Python Production Script

The following script implements an enterprise-grade batch pipeline: it handles concurrency limits, backs off on rate-limiting responses, polls job statuses with jitter, and streams converted WAV files to local disk:

import asyncio
import json
import os
import aiohttp

API_KEY = os.getenv("KITS_API_KEY", "your_kits_api_key_here")
BASE_URL = "https://arpeggi.io/api/kits/v1"
HEADERS = {"Authorization": f"Bearer {API_KEY}"}

# Throttle concurrent active POST jobs to respect tier limits
CONCURRENCY_LIMIT = 2
POLL_INTERVAL_SECONDS = 5
MAX_POLL_ATTEMPTS = 60

async def submit_voice_conversion(session: aiohttp.ClientSession, file_path: str, voice_model_id: int) -> int:
    url = f"{BASE_URL}/voice-conversions"
    
    # Optional DSP pre-processing configuration
    pre_dsp = {
        "NoiseGate": {"threshold_db": -42, "ratio": 3.0, "attack_ms": 10, "release_ms": 100},
        "HighPassFilter": {"cutoff_frequency_hz": 80}
    }
    
    while True:
        data = aiohttp.FormData()
        data.add_field("voiceModelId", str(voice_model_id))
        data.add_field("conversionStrength", "0.85")
        data.add_field("modelVolumeMix", "0.5")
        data.add_field("pitchShift", "0")
        data.add_field("pre", json.dumps(pre_dsp))
        data.add_field("soundFile", open(file_path, "rb"), filename=os.path.basename(file_path))

        async with session.post(url, data=data, headers=HEADERS) as response:
            if response.status == 201:
                res_json = await response.json()
                print(f"[Submitted] {os.path.basename(file_path)} -> Job ID: {res_json['id']}")
                return res_json["id"]
            elif response.status == 429:
                print(f"[Rate Limit] Hit 429 on {os.path.basename(file_path)}. Waiting 15 seconds...")
                await asyncio.sleep(15)
            else:
                error_body = await response.text()
                raise RuntimeError(f"Failed to submit {file_path}: HTTP {response.status} - {error_body}")

async def poll_and_download(session: aiohttp.ClientSession, job_id: int, output_path: str):
    url = f"{BASE_URL}/voice-conversions/{job_id}"
    
    for attempt in range(MAX_POLL_ATTEMPTS):
        await asyncio.sleep(POLL_INTERVAL_SECONDS)
        async with session.get(url, headers=HEADERS) as response:
            if response.status == 200:
                job = await response.json()
                status = job.get("status")
                
                if status == "success":
                    download_url = job.get("outputFileUrl")
                    if not download_url:
                        raise ValueError(f"Job {job_id} succeeded but outputFileUrl is missing.")
                    
                    # Download the processed master audio file
                    async with session.get(download_url) as dl_resp:
                        if dl_resp.status == 200:
                            with open(output_path, "wb") as f:
                                while chunk := await dl_resp.content.read(65536):
                                    f.write(chunk)
                            print(f"[Success] Saved converted audio: {output_path}")
                            return
                        raise RuntimeError(f"Failed to download asset from {download_url}")
                elif status in ("error", "cancelled"):
                    raise RuntimeError(f"Job {job_id} terminated with status: {status}")
            elif response.status == 429:
                await asyncio.sleep(10)
    
    raise TimeoutError(f"Job {job_id} timed out after {MAX_POLL_ATTEMPTS * POLL_INTERVAL_SECONDS} seconds.")

async def process_file(sem: asyncio.Semaphore, session: aiohttp.ClientSession, input_file: str, model_id: int, out_dir: str):
    base_name = os.path.basename(input_file)
    output_file = os.path.join(out_dir, f"converted_{base_name}")
    
    async with sem:
        try:
            job_id = await submit_voice_conversion(session, input_file, model_id)
            await poll_and_download(session, job_id, output_file)
        except Exception as e:
            print(f"[Error] Failed processing {base_name}: {e}")

async def run_batch_pipeline(input_folder: str, output_folder: str, model_id: int):
    os.makedirs(output_folder, exist_ok=True)
    audio_files = [
        os.path.join(input_folder, f)
        for f in os.listdir(input_folder)
        if f.lower().endswith((".wav", ".mp3", ".flac"))
    ]
    
    print(f"Queueing {len(audio_files)} audio files for conversion...")
    semaphore = asyncio.Semaphore(CONCURRENCY_LIMIT)
    
    connector = aiohttp.TCPConnector(limit=20)
    async with aiohttp.ClientSession(connector=connector) as session:
        tasks = [process_file(semaphore, session, audio_path, model_id, output_folder) for audio_path in audio_files]
        await asyncio.gather(*tasks)

if __name__ == "__main__":
    # Example execution
    asyncio.run(run_batch_pipeline("./dialogue_dry_takes", "./dialogue_kits_converted", 1014961))

5. Audio Engineering Trade-Offs and Pipeline Best Practices

To extract the highest sonic quality from Kits AI's neural inference models, adhere to the following production rules:

Serial Chaining: Stem Separation Before Voice Conversion

Never feed a mixed track (e.g., vocals with background music or heavy spill) directly into /voice-conversions. The pitch detection and timbre transfer algorithms will attempt to restyle harmonic instrumental notes into vocal artifacts, yielding robotic warbling. Always pass the raw file to /stem-splits, isolate the clean vocal stem, and feed only that stem into the conversion endpoint.

Acoustic Input Standards

Subscription and Cost Management

Kits AI structures commercial subscriptions into tiered plans:

For programmatic batch workflows, the Professional Plan or a negotiated Enterprise tier is strongly recommended. Attempting to run automated batch pipelines on tiers capped with download minute limits will cause downloads to halt abruptly mid-batch.


6. 365Finds Institutional Evaluation

365Finds recommends the Kits AI API for studios and tech startups seeking studio-grade vocal timbre transfer and vocal separation without maintaining dedicated GPU infrastructure. Its greatest engineering strength lies in its embedded DSP parameter chain, which lets developers execute clean audio pre-conditioning and post-reverberation within a single HTTP request.

The primary operational hurdle is the default account rate-limiting policy and the 4-hour asset lifetime. For successful deployment, treat Kits AI as an asynchronous job worker: enforce strict rate pacing, pair it with local S3-compatible asset staging, and verify your account's rate limits with their support team before launching large-scale batch renders.


References