-
-
Notifications
You must be signed in to change notification settings - Fork 500
Failed to Get Session ID: SUNO_COOKIE Error Persists Despite Correct Setup #223
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Right now use the version from my PR, it's the only working right now. Please note that it is paid to solve the CAPTCHAs. #222 |
@awpalle I solved my issue. When visiting the Note I'm testing on @gohoski's branch, and I use docker compose. |
@hedleyroos everything is working fine for me when I'm testing both on swagger and via the API endpoint on Mozilla Firefox and Microsoft Edge… maybe your extensions are adding some unnecessary cookies. But I will definitely implement a check if the __client cookie exists, if not, then use the cookie from env. |
@gohoski yes, that is a possibility. FWIW the line that causes the issue is https://github.com/gohoski/suno-api/blob/patch-1/src/lib/SunoApi.ts#L801. This is from your patch branch. Interestingly, I tested with Firefox and Chrome on Ubuntu, and I do run some extensions. This post is probably more relevant to your branch. I just happened to search for a similar error and found this issue. Finally, thanks for your branch! It solves a huge headache for everyone. |
I discovered a website that not only supports Suno V4 and API, but also does not have watermarks. |
@gohoski it's working! But now i'm stuck with the CAPTCHAs. Does that mean I have to pay for a subscription to solve the issue? |
@awpalle Did you register on 2Captcha and entered the API key? Also try using a macOS system for avoiding CAPTCHAs, not required though |
@gohoski I did, and it's working! It's wonderful. Thank you !! |
The PR has been merged and this should be fixed now. Please close this issue as completed. |
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.
The text was updated successfully, but these errors were encountered: