Skip to main content
Suno API is configured entirely through environment variables. Set these in a .env file when running locally, or in your deployment platform’s environment settings (e.g. the Vercel dashboard).

Variables

VariableRequiredDefaultDescription
SUNO_COOKIEYesThe full Cookie header value copied from your Suno.com browser session. Must include the __client token for Clerk authentication.
TWOCAPTCHA_KEYYesYour 2Captcha API key, used to solve hCaptcha challenges automatically before each music generation.
BROWSERNochromiumBrowser used by Playwright when solving CAPTCHAs. Only chromium and firefox are supported. chromium is strongly recommended.
BROWSER_GHOST_CURSORNofalseEnable smooth mouse movement simulation via ghost-cursor-playwright. Does not appear to reduce CAPTCHA frequency. Retained for future testing.
BROWSER_LOCALENoenBrowser locale passed to Playwright and sent to 2Captcha workers. Using en or ru is recommended — those locales have the most available workers on 2Captcha.
BROWSER_HEADLESSNotrueRun the browser without a visible window. Set to false only for local debugging.
BROWSER_DISABLE_GPUNofalseDisable GPU acceleration in the browser. Recommended when running inside Docker containers.

Example .env

.env
SUNO_COOKIE=__client=<token>; ajs_anonymous_id=<id>; ...
TWOCAPTCHA_KEY=your_api_key_here
BROWSER=chromium
BROWSER_GHOST_CURSOR=false
BROWSER_LOCALE=en
BROWSER_HEADLESS=true
BROWSER_DISABLE_GPU=false
You can override SUNO_COOKIE on a per-request basis by passing a Cookie header in your HTTP request. The header value must contain a __client token, otherwise the environment variable is used as a fallback. This is useful when running multiple Suno accounts through the same API instance.

Build docs developers (and LLMs) love