Claude-API icon indicating copy to clipboard operation
Claude-API copied to clipboard

send_message stopped working, is any changes on Claude?

Open gregmichels opened this issue 1 year ago • 11 comments

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

gregmichels avatar Feb 04 '24 02:02 gregmichels

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

gregmichels avatar Feb 04 '24 05:02 gregmichels

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

Lxb921006 avatar Feb 04 '24 06:02 Lxb921006

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": []
})

gregmichels avatar Feb 04 '24 06:02 gregmichels

Yes, I also noticed that it has been modified 11

Lxb921006 avatar Feb 04 '24 06:02 Lxb921006

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

gregmichels avatar Feb 04 '24 06:02 gregmichels

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

Lxb921006 avatar Feb 04 '24 07:02 Lxb921006

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.

gregmichels avatar Feb 04 '24 08:02 gregmichels

See fix is here https://github.com/st1vms/unofficial-claude2-api/commit/e2d1b57bcf0dad8bfc545a53f250ec670e5d01f3

johnd0e avatar Feb 04 '24 21:02 johnd0e

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 !

inconnu26 avatar Feb 05 '24 10:02 inconnu26

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

gregmichels avatar Feb 16 '24 16:02 gregmichels

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.

AshwinPathi avatar Mar 06 '24 09:03 AshwinPathi