Cookie header from a logged-in browser session, and the API handles the rest automatically.
How it works
On startup, and before each API operation, Suno API performs the following sequence against Suno’s Clerk-based auth infrastructure:Parse the cookie
The
SUNO_COOKIE value (or per-request Cookie header) is parsed into individual cookie fields. The __client value is extracted for use as a Clerk Authorization header, and ajs_anonymous_id is used as the device identifier (falling back to a random UUID if not present).Get the active session ID
A GET request is made to Clerk’s The
/v1/client endpoint:last_active_session_id field from the response is saved for the next step.Exchange for a JWT bearer token
A POST request is made to Clerk’s token endpoint using the session ID:The returned
jwt field becomes the bearer token attached to all subsequent Suno API calls.How to get your cookie
Open Suno in your browser
Navigate to suno.com/create while logged in to your Suno account.
Find a request with the Clerk API version parameter
In the filter box, search for
__clerk_api_version. Click any matching request.Copy the Cookie header
In the Headers tab of the selected request, scroll to the Request Headers section. Find
Cookie, hover over the value, and copy the entire string.Required cookie fields
The cookie string must contain at least the following fields for authentication to succeed:| Field | Purpose |
|---|---|
__client | Clerk client token. Used as the Authorization header when calling Clerk endpoints to get and refresh the session JWT. |
ajs_anonymous_id | Segment anonymous device identifier. Used as the Device-Id header on all Suno API requests. If absent, a random UUID is generated. |
__client is missing, the API will throw:
Per-request cookie override
Every HTTP request to your Suno API instance can include aCookie header to authenticate as a different Suno account:
Cookie value contains __client. Otherwise, the SUNO_COOKIE environment variable is used. Each unique cookie string results in a separate cached SunoApi instance.
Cookies expire periodically. If you start receiving authentication errors, return to the browser, copy a fresh
Cookie header, and update SUNO_COOKIE. There is no automatic cookie refresh — the session JWT is refreshed automatically, but the underlying Clerk client cookie must be updated manually when it expires.