Closed MubarakHAlketbi closed 2 months ago
I'm getting the same error
I'm getting the same error. Tried logging out and logging in.
Same. Perhaps they changed something in their permissions that causes this method to no longer function. Man I was so excited to not have to manually upload files to my projects. Oh well.
Hi @sato942,
Thank you for reporting this issue. The ClaudeSync tool is still working on my end, so to help diagnose the problem, could you please let me know if you're using the Free version of Claude.ai or the Pro version?
Assuming you have the Pro version, could you please enable debug logs and provide the output?
Run the following command to enable debug logs:
sed -i 's/"log_level": "INFO"/"log_level": "DEBUG"/' ~/.claudesync/config.json
Then, execute the following command:
claudesync organization ls
Copy and paste the output here, ensuring that you mask any sessionKey
visible in the logs.
This will help us better understand what might be going wrong. Thank you!
@kolbykappes I've removed your post as it contained your session key, which is sensitive information. For security reasons, please avoid sharing such keys publicly.
As a temporary workaround until we implement a fix, please manually add your organization ID to ~/.claudesync/config.json
. Here's how you can do it using PowerShell:
$config = Get-Content ~/.claudesync/config.json -Raw | ConvertFrom-Json
$config | Add-Member -NotePropertyName "active_organization_id" -NotePropertyValue "your-organization-id-here" -Force
$config | ConvertTo-Json | Set-Content ~/.claudesync/config.json
To find your organization ID:
/api/organizations
Here's a visual guide:
Replace "your-organization-id-here" in the PowerShell command with your actual organization ID.
After adding the organization ID, you should be able to run commands like claudesync project ls
successfully.
If you're using a Unix-based system (Linux or macOS), use this bash command instead:
jq '.active_organization_id = "your-organization-id-here"' ~/.claudesync/config.json > tmp.json && mv tmp.json ~/.claudesync/config.json
Note: Ensure you have jq
installed on your system to use this command.
Let me know if you need any further assistance!
Reopening this issue as the fix has been merged, but we need to confirm if it resolves the problem. Please verify the fix and update the status here.
Thanks for the update.
Progress - but now getting a 403 on the request to Projects:
DEBUG:urllib3.connectionpool:Starting new HTTPS connection (1): claude.ai:443 DEBUG:urllib3.connectionpool:https://claude.ai:443 "GET /api/organizations/removedkey/projects HTTP/11" 403 None
@kolbykappes
I was able to reproduce this issue ("permission_error") by creating an API Key via https://console.anthropic.com/settings/keys
Is this where you got your key?
@jahwag interesting.
I have an API account and a pro account. They're both tied to the same google identity.
However, they're using different session keys. I verified that the key I'm trying is the one that came from the pro account and not the API account.
@kolbykappes After logging into claude.ai in your browser, are you able to open this link: https://claude.ai/api/organizations and see your own JSON data?
@jahwag Yes
@kolbykappes Thank you for your input.
It’s interesting to note that, in my case, the only mandatory headers for a successful request are User-Agent
and Cookies
(specifically sessionKey
). These headers are used by claudesync
to simulate a request coming from a browser.
If you have the time, could you please use cURL
or a similar tool to determine which headers are necessary for you to get a 200 OK
response from GET https://claude.ai/api/organizations
?
A straightforward way to do this is through the developer tools in your browser:
By removing headers/cookies one by one, you can identify which ones are essential for your request.
For example, for me, the mandatory headers are as follows:
curl 'https://claude.ai/api/organizations' --compressed \
-H 'User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:128.0) Gecko/20100101 Firefox/128.0' \
-H 'Cookie: sessionKey=mysessionkey;'
Thanks again for your help!
@jahwag That minimum setup works on my local from Powershell
@kolbykappes
It looks like Cloudflare is being quite challenging!
I’ve released a new version (0.3.5) that might address your issue. Please try installing this latest version and make sure to delete your existing claudesync configuration to start fresh. Here are the steps:
Remove your current configuration:
rm ~/.claudesync/config.json
Install the new version:
pip install claudesync==0.3.5
Log in and configure claudesync:
claudesync.exe api login claude.ai
claudesync.exe organization select
The new config.json
will include a headers
field that you can customize. I'm not entirely sure why it works for some and not for others, but my guess is that the sessionKey
you had configured in claudesync might have expired while the one in your cURL was still active.
If that's not the case, having the ability to customize the headers might help you work around this issue. Please give it a try and let me know how it goes!
same issue here, I used the manual method described above:
conf:
{
"log_level": "DEBUG",
"upload_delay": 0.5,
"max_file_size": 32768,
"headers": {
"User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:128.0) Gecko/20100101 Firefox/128.0",
"Origin": "https://claude.ai"
},
"session_key": "sk-ant-REDACTED",
"active_provider": "claude.ai",
"active_organization_id": "116b197c-REDACTED"
}
Attempt to access org
Successfully installed claudesync-0.3.5
shadmin @ kea ❯ ~ claudesync api login claude.ai
To obtain your session key, please follow these steps:
1. Open your web browser and go to https://claude.ai
2. Log in to your Claude account if you haven't already
3. Once logged in, open your browser's developer tools:
- Chrome/Edge: Press F12 or Ctrl+Shift+I (Cmd+Option+I on Mac)
- Firefox: Press F12 or Ctrl+Shift+I (Cmd+Option+I on Mac)
- Safari: Enable developer tools in Preferences > Advanced, then press Cmd+Option+I
4. In the developer tools, go to the 'Application' tab (Chrome/Edge) or 'Storage' tab (Firefox)
5. In the left sidebar, expand 'Cookies' and select 'https://claude.ai'
6. Find the cookie named 'sessionKey' and copy its value
Please enter your sessionKey: sk-ant-REDACTED
Logged in successfully.
shadmin @ kea ❯ ~ claudesync organization select
ERROR:claudesync.providers.claude_ai:Request failed: 403 Client Error: Forbidden for url: https://claude.ai/api/organizations
ERROR:claudesync.providers.claude_ai:Response status code: 403
ERROR:claudesync.providers.claude_ai:Response headers: {'Date': 'Mon, 22 Jul 2024 22:11:16 GMT', 'Content-Type': 'application/json', 'Transfer-Encoding': 'chunked', 'Connection': 'keep-alive', 'Set-Cookie': '__cf_bm=REDACTED.anQ-1721686276-1.0.1.1-REDACTED; path=/; expires=Mon, 22-Jul-24 22:41:16 GMT; domain=.claude.ai; HttpOnly; Secure; SameSite=None', 'Vary': 'Accept-Encoding', 'Server': 'cloudflare', 'CF-RAY': '8a76c3fa6b9550ad-AKL', 'Content-Encoding': 'gzip', 'alt-svc': 'h3=":443"; ma=86400'}
ERROR:claudesync.providers.claude_ai:Response content: {"error":{"message":"We are unable to serve your request","type":"permission_error"}}
Error: API request failed: 403 Client Error: Forbidden for url: https://claude.ai/api/organizations
shadmin @ kea ❯ ~
@jahwag same behavior on the new version.
I will try to play around with the headers and see if I can figure a work around.
Hello everyone,
Just released a new version of ClaudeSync. Please update to the latest version using the following command:
pip install claudesync==0.3.6
This update includes additional measures to help prevent 403/permission denied errors. Thank you for your patience and support!
Thanks @jahwag - I just upgraded to the .3.6 version and I'm still getting a 403 on the Organizations select call
I’m excited to announce the release of version 0.3.8, which includes a new provider: claude.ai-curl
. As the name suggests, this provider uses cURL as its underlying client. For more information on how to use it, please refer to the updated README.md.
Please give it a try and let me know if it works better for you. Your feedback is always appreciated!
solves the issue for organization pick permissions, I can now select a project as well. Good work on that. Files sync too!
After uninstalling and reinstalling - I just followed the onscreen instructions. Im on Ubuntu 22.04.4 gnome desktop with latest Google Chrome 127.0.6533.88
Hey, I am on macos (14.6) and I am still having an issue even with claude.ai-curl, when I use it and try to do claudesync organization select(or ls) I get:
(base) xxx@Bens-MBP ~ % claudesync organization select
Traceback (most recent call last):
File "/opt/anaconda3/bin/claudesync", line 8, in
TypeError: string indices must be integers, not 'str'
When I do claudesync status:
(base) xxx@Bens-MBP ~ % claudesync status
Active provider: claude.ai-curl
Active organization id: Not set
Active project id: Not set
Active project name: Not set
Local path: Not set
Log level: INFO
Thanks for confirming the fix, @shaneholloman. I'm closing this issue now.
Hi @OohBen,
Thank you for reaching out. To better assist you, could you please create a separate issue and include the following details:
A description of your problem.
Your Claude.ai plan.
The output of calling https://claude.ai/api/organizations in your browser.
This will help me diagnose and address your issue more effectively.
Thanks!
i am trying to list the organization but i get errors