Skip to main content

Quickstart

Get your first song generated in under 5 minutes.

API Reference

Explore all endpoints with full parameter docs.

Deployment

Deploy with Vercel, Docker, or run locally.

Agent Integration

Use Suno API as a tool in GPTs, Coze, and LangChain.

What is Suno API?

Suno API is an open-source REST API wrapper for Suno.ai — the AI music generation service. Because Suno does not yet offer an official API, this project bridges that gap by automating the web interface and exposing a clean HTTP API you can call from any language or platform.
Suno API is an unofficial open-source project intended for learning and research purposes. It is not affiliated with or endorsed by Suno.ai.

Key features

Music from text prompts

Send a text description and get back audio URLs for two AI-generated song variations.

Custom Mode

Control lyrics, style tags, title, and negative tags for precise creative direction.

Automatic CAPTCHA solving

Uses 2Captcha and Playwright to solve hCaptcha challenges automatically — no manual intervention.

OpenAI-compatible endpoint

Drop-in /v1/chat/completions endpoint lets you use Suno API with any OpenAI-compatible client.

Extend & concat audio

Extend existing clips or concatenate extensions into a full song.

Stems & lyric timing

Separate vocal and instrumental tracks; get word-level timestamp data.

One-click deploy

Deploy to Vercel in one click, or run with Docker Compose — no complex setup.

Multi-account support

Override the default cookie per-request to rotate across multiple Suno accounts.

How it works

Suno API runs as a Next.js application. It authenticates with Suno using your browser cookie, maintains an active session automatically, and proxies generation requests to Suno’s internal API. When Suno requires hCaptcha verification, it spins up a headless Playwright browser, sends the CAPTCHA image to 2Captcha for solving, and completes the challenge on your behalf.
Your app  →  POST /api/generate  →  Suno API server  →  Suno.ai

                               2Captcha (when CAPTCHA required)

Supported endpoints

EndpointMethodDescription
/api/generatePOSTGenerate music from a text prompt
/api/custom_generatePOSTGenerate with custom lyrics, tags, and title
/api/extend_audioPOSTExtend an existing audio clip
/api/concatPOSTConcatenate clip extensions into a full song
/api/generate_lyricsPOSTGenerate lyrics from a prompt
/api/generate_stemsPOSTSeparate audio into vocal and instrumental stems
/api/get_aligned_lyricsGETGet word-level lyric timestamps
/api/getGETRetrieve audio info by ID(s)
/api/clipGETGet clip details by ID
/api/get_limitGETCheck remaining credit quota
/v1/chat/completionsPOSTOpenAI-compatible generation endpoint

Get started

1

Obtain your Suno cookie

Log in to suno.com/create, open DevTools → Network tab, refresh, and copy the Cookie header from any request containing __clerk_api_version.
2

Get a 2Captcha API key

Register at 2captcha.com, top up your balance, and copy your API key. Suno requires hCaptcha solving for music generation.
3

Deploy Suno API

Deploy to Vercel with one click, or run locally with npm run dev. Set the SUNO_COOKIE and TWOCAPTCHA_KEY environment variables.
4

Make your first API call

Send a POST request to /api/generate with a text prompt and get back two song variations within minutes.
Ready to start? Follow the quickstart guide for a complete walkthrough.

Build docs developers (and LLMs) love