PiAPI
HomeWorkspace
HomeWorkspace
Join Discord
  1. Create Task
  • Get Started
    • Overview
    • Quickstart
    • Make Instruction: How to Use PiAPI to Build a Workflow on Make?
  • Endpoints
    • Song(Udio)
      • Song API Task Creation Examples
      • [Udio] Song Extend
      • Get Task
      • Create Task
      • [Udio] Generate Lyrics
    • Kling
      • Lipsync With PiAPI Kling API Examples
      • Motion Brush With PiAPI Kling API Example
      • Kling Elements Video Generation API
      • Kling Effects Video Generation
      • Cancel Task
        • Cancel Tasks
        • Cancel Task
      • Get Task
      • Create Task
      • Kling Virtual Try-On
      • Kling Effects
    • Hailuo
      • Hailuo Director Mode Example
      • Generate Video
      • Get Task
    • Flux
      • Flux with LoRA and Controlnet
      • Available LoRA and Controlnet
      • Flux API with Redux Variation, Fill, Inpaint and Outpaint
      • Create Task
        • Text to Image
        • Image to Image
      • Get task
    • AI Hug
      • Get Task
      • Create Task
    • LLM
      • Use Cases for GPT-4o Image API
      • How To Avoid Timeouts in Completion API
      • GPT-4o Image Generation API
      • LLM API | Basic Completions
      • Get Task
    • Midjourney
      • PiAPI Penalties on Midjourney Usage
      • Detailed Explaination on Midjourney Task Result
      • Midjourney V7 API Instructions
      • Create Task
        • Imagine
        • Upscale
        • Variation
        • Reroll
        • Describe
        • Seed
        • Blend
        • Inpaint
        • Outpaint
        • Pan
      • Cancel Task
        • Cancel Task
        • Cancel Tasks
      • Get Task
    • Faceswap
      • Multi Faceswap
      • Image Faceswap
      • Video Faceswap
      • Get Task
    • TTS
      • Zeroshot Text-to-Speech F5-TTS
      • Get Task
    • Trellis
      • Create Task
      • Get Task
    • Luma Dream Machine
      • Cancel Task
        • Cancel Tasks
        • Cancel Task
      • Create Task
      • Get Task
    • WanX
      • Generate WanX Task with LoRA Using PiAPI
      • Available LoRA Types for Wanx
      • Use Cases for Wanx LoRA
      • Use Cases for Wanx Control Camera
      • Create Task
      • Get Task
    • Skyreels
      • Create Task
      • Get Task
    • Framepack
      • Create Task
      • Get Task
    • Hunyuan Video
      • How to Make a Hunyuan API Call
      • Get Task
      • Generate Video
    • Mmaudio
      • Get Task
      • Generate Audio
    • DiffRhythm
      • Generate Audio
      • Get Task
    • Ace Step
      • Create Task
        • Text to Audio
          POST
        • Audio to Audio
          POST
        • Audio Edit
          POST
        • Audio Extend
          POST
      • Get Task
        GET
    • Tools
      • File Upload API
      • Video Upscale
      • Video Upscale-Get Task
      • Remove Background API
      • Remove Background-Get Task
      • Segment With Prompt API
      • Segment With Prompt API-Get Task
      • Image Upscale(Super Resolution) API
      • Image Upscale-Get Task
    • PiAPI Account Management
      • PiAPI Account Info
      • Task List Info
      • User Task History
  • Resources
    • Change Log
    • Output Storage
    • Unified API Schema
    • Webhook
    • Bulk Generation Service
    • Billings
    • PiAPI MCP Server
    • Workspace Manual
      • Host-your-account (HYA) | Back-up Account
      • Host-your-account (HYA) | Debug Checklist
      • Host-your-account (HYA) | Connected Account Status
    • Announcements
      • PiAPI 2025 January 1st Pricing Update
  • Legacy Documentation
    • Midjourney
      • Midjourney Webhook
      • Imagine
      • Reroll
      • Upscale
      • Variation
      • Inpaint
      • Outpaint
      • Pan
      • Describe
      • Blend
      • Seed
      • Fetch
      • Multi Fetch
      • Cancel
    • Face Swap
      • Video Faceswap
      • Multi-face-swap
      • Fetch
    • Dream Machine
      • Video Generation
      • Video Extend
      • Get Video Generation
    • Kling
      • Video Generation
      • Video Extend
      • Get Video Generation
  1. Create Task

Audio Edit

POST
https://api.piapi.ai/api/v1/task

Overview#

This endpoint from PiAPI's Ace Step API can edit audio based on prompt and input audio with lyrics.
The lyric placement is highly flexible—PiAPI users can customize lyric integration using structured input formats.

Information&Pricing#

$0.0005 per seconds (duration of generated audio)

Example#

To generate reasonable audio, Users could choose audio style(e.g., pop) based on text or upload Base64 or url of reference audio.
Here is an example that users could follow when they need to generate a song with lyrics:
[verse]
Sunshine on the boulevard the beach is calling loud
Waves are dancing golden sand under a cotton cloud
Electric heartbeat pounding fast the tide is on our side
Catch a wave and feel alive we’ll take it for a ride
[verse]
Palm trees swaying left to right they know where we belong
Feel the rhythm of the night it keeps us moving strong
Sea spray kisses salty air we’re flying with the breeze
Champagne states of mind we ride we do just as we please
[chorus]
We’re riding waves of life together hand in hand
With every beat we chase the beat it’s our own wonderland
Feel the music take you higher as the shorelines blur
This is our world our endless summer as we live and learn
[bridge]
Moonlight paints the ocean blue reflections in our eyes
Stars align to light our path we’re surfing through the skies
Every moment like a song we sing it loud and clear
Every day’s a new adventure with you always near
[verse]
Neon lights and city sounds they blend with ocean views
We’re unstoppable tonight no way that we can lose
Dreams are written in the sand they sparkle in the sun
Together we’re a masterpiece our story’s just begun
[chorus]
We’re riding waves of life together hand in hand
With every beat we chase the beat it’s our own wonderland
Feel the music take you higher as the shorelines blur
This is our world our endless summer as we live and learn

Request

Header Params
x-api-key
string 
optional
your api key
Body Params application/json
model
enum<string> 
required
Model name, currently select Qubico/ace-step.
Allowed value:
Qubico/ace-step
task_type
enum<string> 
required
Currently select edit.
Allowed value:
edit
input
object 
required
audio
string 
required
Input Audio to edit, either the url or base64 string.
style_prompt
string 
required
Describe the style of input audio.
lyrics
string 
optional
The lyrics of the input audio. If not provided, default use [inst].
edit_style_prompt
string 
required
Describe the style of audio that you want to generate.
edit_lyrics
string 
optional
The lyrics of the audio. If not provided, default use [inst] to generate instrument only audio.
config
object 
optional
webhook_config
object 
optional
Example
{
    "model": "Qubico/ace-step",
    "task_type": "edit",
    "input": {
        "audio": "https://img.theapi.app/temp/2c802652-03bb-4266-8d4b-1cd81da45dcb.mp3",
        "style_prompt": "guitar and piano",
        "lyrics": "[inst]",
        "edit_style_prompt": "guitar and piano, pop",
        "edit_lyrics": "[inst]"
    },
    "config": {
        "webhook_config": {
            "endpoint": "",
            "secret": ""
        }
    }
}

Request samples

Shell
JavaScript
Java
Swift
Go
PHP
Python
HTTP
C
C#
Objective-C
Ruby
OCaml
Dart
R
Request Request Example
Shell
JavaScript
Java
Swift
curl --location --request POST 'https://api.piapi.ai/api/v1/task' \
--header 'x-api-key;' \
--header 'Content-Type: application/json' \
--data-raw '{
    "model": "Qubico/ace-step",
    "task_type": "edit",
    "input": {
        "audio": "https://img.theapi.app/temp/2c802652-03bb-4266-8d4b-1cd81da45dcb.mp3",
        "style_prompt": "guitar and piano",
        "lyrics": "[inst]",
        "edit_style_prompt": "guitar and piano, pop",
        "edit_lyrics": "[inst]"
    },
    "config": {
        "webhook_config": {
            "endpoint": "",
            "secret": ""
        }
    }
}'

Responses

🟢200Success
application/json
Body
model
string 
optional
task_type
string 
optional
input
object 
optional
prompt
string 
required
negative_prompt
string 
optional
video
string 
required
steps
integer 
optional
seed
integer 
optional
config
object 
optional
webhook_config
object 
optional
Example
{
    "timestamp": 1749615296,
    "data": {
        "task_id": "72d9af32-0d57-4b9c-8fad-b7c6fc614e52",
        "model": "Qubico/ace-step",
        "task_type": "edit",
        "status": "completed",
        "config": {
            "service_mode": "",
            "webhook_config": {
                "endpoint": "https://webhook.site/72bc9c29-2e33-4534-b840-80c86803fd6a",
                "secret": ""
            }
        },
        "input": {
            "audio": "https://img.theapi.app/temp/2c802652-03bb-4266-8d4b-1cd81da45dcb.mp3",
            "edit_lyrics": "[inst]",
            "edit_style_prompt": "guitar and piano, pop",
            "lyrics": "[inst]",
            "style_prompt": "guitar and piano"
        },
        "output": {
            "audio_url": "https://img.theapi.app/temp/c76e853f-f32f-47e9-86af-28218d135328.mp3"
        },
        "meta": {
            "created_at": "2025-06-11T12:13:27.909116+08:00",
            "started_at": "2025-06-11T12:13:32.89947+08:00",
            "ended_at": "2025-06-11T12:14:56.841121+08:00",
            "usage": {
                "type": "llm",
                "frozen": 0,
                "consume": 5000
            },
            "is_using_private_pool": false
        },
        "detail": null,
        "logs": [],
        "error": {
            "code": 0,
            "raw_message": "",
            "message": "",
            "detail": null
        }
    }
}
Modified at 2025-06-11 09:16:44
Previous
Audio to Audio
Next
Audio Extend