API Documentation
Generate time-synced LRC lyric files from audio programmatically using the AI LRC Generator API.
Overview
The AI LRC Generator API lets you upload audio files and receive time-synced LRC lyrics asynchronously. The typical flow is:
- Upload + trigger —
POST /api/v2/open/audio_analysis(one-step, recommended) - Poll for result —
GET /api/v2/open/audio_tasks/:iduntilstatusisCOMPLETED
Base URL: https://ailrcgenerator.com
Authentication
All requests require an API key in the Authorization header.
Authorization: Bearer ailrc_sk_YOUR_KEYCreate and manage your API keys on the Developer API page. Keys are shown only once at creation — save them immediately.
Treat your API key like a password. Never expose it in client-side code or public repositories.
Rate Limits
The API is currently in public beta. Rate limits are set conservatively to prevent abuse and ensure service stability. We will gradually increase limits based on operational data and user feedback. If you have special requirements, please contact support.
Limits are applied per API key based on your account tier, using a three-layer sliding window (minute / hour / day). Hitting any layer returns 429.
| Tier | Per Minute | Per Hour | Per Day |
|---|---|---|---|
| Free | 3 | 20 | 50 |
| Pro | 10 | 60 | 300 |
| Premium | 20 | 200 | 1,000 |
Rate limit state is returned on every response:
X-RateLimit-Limit: 100
X-RateLimit-Remaining: 87
X-RateLimit-Reset: 1745024400
Exceeding the limit returns 429 Too Many Requests with a Retry-After header indicating how many seconds to wait.
Endpoints
Trigger Analysis
Upload an audio file and immediately start AI analysis (one-step mode).
POST /api/v2/open/audio_analysis
Content-Type: multipart/form-data
Request
| Field | Type | Required | Notes |
|---|---|---|---|
file | File | ✓ | mp3, wav, ogg, flac |
fileName | string | — | Custom file name; falls back to original if omitted |
Size limits by tier: Free 7 MB · Pro 20 MB · Premium 50 MB
Example
curl -X POST https://ailrcgenerator.com/api/v2/open/audio_analysis \
-H "Authorization: Bearer ailrc_sk_YOUR_KEY" \
-F "[email protected]" \
-F "fileName=My Song"Response
{
"code": 0,
"message": "ok",
"items": {
"taskId": "cm4abc123",
"traceId": "cm4abc123",
"status": "QUEUED",
"queuePosition": 2,
"remainingCredits": 46,
"fileName": "song.mp3"
}
}Get Task Status
Fetch the current status and result of a task. Poll this endpoint until status is COMPLETED or FAILED. See Polling Guide for recommended intervals.
GET /api/v2/open/audio_tasks/:id
Example
curl https://ailrcgenerator.com/api/v2/open/audio_tasks/cm4abc123 \
-H "Authorization: Bearer ailrc_sk_YOUR_KEY"Response — in progress
{
"code": 0,
"items": { "taskId": "cm4abc123", "status": "PROCESSING", "fileName": "song.mp3" }
}Response — completed
{
"code": 0,
"items": {
"taskId": "cm4abc123",
"status": "COMPLETED",
"result": {
"lrc": "[00:00.00]Line one\n[00:05.23]Line two\n[00:10.40]Line three"
},
"creditsUsed": 6,
"completedAt": "2026-04-19T10:02:30Z",
"fileName": "song.mp3"
}
}List Tasks
Return a paginated list of your audio tasks.
GET /api/v2/open/audio_tasks
Query parameters
| Parameter | Default | Notes |
|---|---|---|
page | 1 | Page number |
limit | 20 | Max 100 per page |
status | — | Filter: PENDING QUEUED PROCESSING COMPLETED FAILED |
Example
curl "https://ailrcgenerator.com/api/v2/open/audio_tasks?page=1&limit=20&status=COMPLETED" \
-H "Authorization: Bearer ailrc_sk_YOUR_KEY"Delete Task
Delete a task and its associated data.
DELETE /api/v2/open/audio_tasks/:id
Tasks with status PROCESSING or QUEUED cannot be deleted.
Example
curl -X DELETE https://ailrcgenerator.com/api/v2/open/audio_tasks/cm4abc123 \
-H "Authorization: Bearer ailrc_sk_YOUR_KEY"Error Reference
All errors use a consistent envelope:
{
"code": 403,
"message": "Not enough credits",
"businessCode": "not_enough_credits"
}| HTTP | businessCode | Meaning |
|---|---|---|
400 | — | Bad request — missing or invalid field |
401 | — | API key is missing, invalid, revoked, or expired |
403 | not_enough_credits | Insufficient credits |
403 | level_not_enough | File exceeds the size limit for your tier |
404 | — | Task not found or does not belong to your account |
429 | — | Rate limit exceeded — check Retry-After |
500 | — | Internal server error |
Polling Guide
AI analysis is asynchronous and typically completes within 30–120 seconds depending on file length.
Recommended strategy: start at 3 s, back off to a 10 s cap, give up after 60 attempts (~10 min).
async function pollTask(taskId, apiKey) {
let delay = 3000;
for (let i = 0; i < 60; i++) {
await new Promise(r => setTimeout(r, delay));
const res = await fetch(
`https://ailrcgenerator.com/api/v2/open/audio_tasks/${taskId}`,
{ headers: { Authorization: `Bearer ${apiKey}` } }
);
const { items } = await res.json();
if (items.status === "COMPLETED") return items.result.lrc;
if (items.status === "FAILED") throw new Error(items.error ?? "Analysis failed");
delay = Math.min(delay * 1.5, 10000);
}
throw new Error("Timed out");
}Need help? Contact support · Webhook support coming soon.