Skip to content

Failed to Get Session ID: SUNO_COOKIE Error Persists Despite Correct Setup #223

Closed
@awpalle

Description

@awpalle

Describe the bug
I am consistently encountering issues with my Suno cookie when trying to use the Suno API. The API returns the following error:
{"error":"Internal server error. Error: Failed to get session id, you may need to update the SUNO_COOKIE"}
Despite following the instructions to obtain and update the cookie, the issue persists.

To Reproduce
Steps to reproduce the behavior:

Go to app.suno.ai and log in.

Open the browser's developer tools (F12) and navigate to the Network tab.

Refresh the page and locate the request containing client?_clerk_js_version.

Copy the Cookie value from the request headers.

Set the SUNO_COOKIE environment variable in the .env file or Vercel dashboard with the copied cookie value.

Run the Suno API locally or deploy it to Vercel.

Make a request to the /api/get_limit endpoint.

Observe the error: {"error":"Internal server error. Error: Failed to get session id, you may need to update the SUNO_COOKIE"}.

Expected behavior
I expected the API to return my quota information, such as:

json
Copy
{
"credits_left": 50,
"period": "day",
"monthly_limit": 50,
"monthly_usage": 50
}
Instead, I received an error indicating an issue with the session ID or cookie.

Screenshots
If applicable, I can provide screenshots of:

The browser's developer tools showing the cookie extraction process.

The error response from the API.

Desktop

OS: [e.g., Windows 11]

Browser: [e.g., Chrome, Version 118]

Additional context

I have tried logging out and back into app.suno.ai to refresh the cookie, but the issue persists.

I am using the latest version of the suno-api repository, pulled directly from the main branch.

The issue occurs both when running the API locally and when deployed to Vercel.

I have double-checked that the SUNO_COOKIE environment variable is correctly set and matches the cookie value from the browser.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions