This endpoint is designed for compatibility with OpenAI clients and agent frameworks. It does not stream tokens — it waits for Suno to finish generating the song before returning. Use
POST /api/generate for direct access with more control over generation parameters.Request body
The Suno model to use for generation. Maps directly to Suno’s
mv parameter (e.g. chirp-v3-5, chirp-v4). Ignored by the OpenAI SDK but forwarded to Suno.An array of message objects following the OpenAI chat format. The endpoint scans the array in order and uses the last message with
role: "user" as the music generation prompt.Response
The endpoint returns a plain-text string (not JSON) in the response body. TheContent-Type is not set to application/json — OpenAI-compatible clients treat the body as the message content.
The response body is a Markdown-formatted string with the following structure:
A Markdown string containing:
- Song Title — the title assigned by Suno.
- Song Cover — a Markdown image tag linking to the cover art URL.
- Lyrics — the generated lyrics for the song.
- Listen to the song — a direct link to the
.mp3audio file on Suno’s CDN.
Error responses
| Status | Meaning |
|---|---|
400 | No user message found in the messages array |
500 | Internal server error or Suno API error |
Examples
Example response
Use cases
GPTs and OpenAI Actions
Because this endpoint mirrors the OpenAI chat completions API, you can point a custom GPT’s action or OpenAI Assistant’s tool call atPOST /v1/chat/completions with no additional configuration. The GPT sends a natural-language description and receives a formatted song result it can display inline.
LangChain integration
Because the response is plain text (not a structured JSON), wrap the endpoint in a LangChainTool using a plain HTTP call rather than the OpenAI SDK integration:
GPTs and OpenAI Actions
Because this endpoint accepts the OpenAI chat completions request format, you can point a custom GPT action atPOST /v1/chat/completions. The GPT sends a natural-language description and receives a Markdown-formatted song result it can display inline.
The
model field in the request body is not forwarded to Suno’s generation API — the endpoint always uses the DEFAULT_MODEL constant (chirp-v3-5). The model field is accepted for API compatibility but has no effect on the output.