Skip to content
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

send_message stopped working, is any changes on Claude? #94

Open
gregmichels opened this issue Feb 4, 2024 · 11 comments
Open

send_message stopped working, is any changes on Claude? #94

gregmichels opened this issue Feb 4, 2024 · 11 comments

Comments

@gregmichels
Copy link

I checked the model, but it seems they using another payload?
Have anybody experienced the same issues with send_message?

@gregmichels
Copy link
Author

@KoushikNavuluri @jhchenchong guys, sorry for putting up, something with https://claude.ai/api/append_message, am I right? Endpoint disabled

@Lxb921006
Copy link

yes,the same problem: {"error":{"type":"permission_error","message":"Endpoint disabled"}}。It's completely unusable

@gregmichels
Copy link
Author

yes,the same problem: {"error":{"type":"permission_error","message":"Endpoint disabled"}}。It's completely unusable

I'm on half way - they changed the payload structure - so for quick fix is to change URL and payload structure as below:

url = f"https://claude.ai/api/organizations/{self.organization_id}/chat_conversations/{conversation_id}/completion" 


payload = json.dumps({
    "prompt": prompt,
    "timezone": "Asia/Singapore",
    "model": f"claude-{self.model_version}",
    "attachments": [],
    "files": []
})

@Lxb921006
Copy link

Yes, I also noticed that it has been modified
11

@gregmichels
Copy link
Author

Now I see cookies started to change from chat opening - can't repeat my success path yet. Investigation in progress, lemme know if you also find smth please

@Lxb921006
Copy link

Yes, but this does not affect the use of this Claude API. I have called this Claude API several times for testing and have not found any problems

@gregmichels
Copy link
Author

gregmichels commented Feb 4, 2024

OK, now what we have:

  1. different URL for send_message and payload as above
  2. cookie now should be retrieved (once during login) from the chat window and request with a model name like claude-2.1 or instant - doesn't matter. This cookie can change from time to time - but it doesn't matter
  3. Important - response from Claude now should be retrieved in separate GET - they are providing whole dialogue in response.

So it is like POST -> GET + filter/associate with your POST as uuid and generated chronologically.

I would not share my code, as this is not optimal but an emergency. But the general thing is above. Files work as before through attachments.

@johnd0e
Copy link

johnd0e commented Feb 4, 2024

See fix is here st1vms/unofficial-claude-api@e2d1b57

@inconnu26
Copy link

inconnu26 commented Feb 5, 2024

See fix is here st1vms/unofficial-claude2-api@e2d1b57

Great ! How long before the fix is available through "pip install claude-api" command ? Also, I keep getting "{"type":"permission_error","message":"Endpoint disabled"}}" error. Is it my cookie ? I tried many times but I keep getting this issue. Thank you for your help !

@gregmichels
Copy link
Author

Hi Team, have you ever met an error with {"success":false,"error":"BrotliDecompress failed"}

I don't understand why sometimes there BrotliDecompress issue when retrieving the response
Its random and I can't repeat properly

@AshwinPathi
Copy link

I just put up a fix here on my version: https://github.com/AshwinPathi/claude-api-py. Give it a try and let me know if it works.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants