mshumer / gpt-author

MIT License
2.45k stars 354 forks source link

error 400 #30

Closed kyoesu closed 3 months ago

kyoesu commented 3 months ago
 in generate_text(prompt, model, max_tokens, temperature)
     20     response = requests.post("https://api.anthropic.com/v1/messages", headers=headers, json=data)
     21     print (response)
---> 22     response_text = response.json()['content'][0]['text']
     23     return response_text.strip()
     24 

KeyError: 'content'

400 error pops up in the generate_text function in the request

chunhualiao commented 3 months ago

I got the same error.

chunhualiao commented 3 months ago

I got the same error.

Oh. I used a wrong api key. The problem is solved now.

kyoesu commented 3 months ago

I found the problem. I don't have the money.

{"type":"error","error":{"type":"invalid_request_error","message":"Your credit balance is too low to access the Claude API. Please go to Plans & Billing to upgrade or purchase credits."}}