/api/agent/generateGenerate a new track for a user. Deducts one credit on success.
[ json_body ]
- userId — string (cuid) — the user to generate for
- lyrics — string, 1–10,000 chars, [Verse]/[Chorus] markers supported
- tags — string — comma-separated style tags, e.g. "drill, dark, aggressive"
- duration — int — seconds, 10–240
- adapterId — string (cuid), optional — LoRA adapter to apply
[ example ]
curl -X POST https://azraelai.com/api/agent/generate \
-H "x-api-key: $AGENT_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"userId": "clxxxxxxxxxxxxxxxxxxxxxxx",
"lyrics": "[Verse]\nDead by dawn...",
"tags": "drill, dark",
"duration": 60
}'[ response ]
{ "generation": { "id": "...", "status": "completed", "audioUrl": "https://...", ... } } // synchronous — returns when the track is done