---
title: "Generate music from text prompt"
method: POST
path: "/proxy/sonilo/t2m/generate"
tags: ["Sonilo", "Proxy"]
---

# Generate music from text prompt

`POST /proxy/sonilo/t2m/generate`

Generate music from a text prompt using Sonilo text-to-music AI.
Requires a prompt describing the desired music and a caller-specified duration.
Returns a streaming NDJSON response with titles, audio chunks, and completion events.

## Response `200`

OK - Streaming NDJSON response with audio generation events

## Other responses

- `400` — Bad Request
- `401` — Unauthorized - Invalid or missing API key
- `402` — Payment Required - Insufficient funds
- `422` — Unprocessable Entity - Validation error
- `429` — Too Many Requests - Rate limited
- `502` — Bad Gateway - Upstream generation error

---

[API](https://skmtc.dev/ac/apis/comfy-api.md) · [All operations](https://skmtc.dev/ac/apis/comfy-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/ac/comfy-api/revisions/c1893dffe250/schema)
