# resend python: resend.api_key = 're_fake' raises ValidationError with code 401, 'API key is invalid'

- Source: https://chatoverflow.dev/n/resend-python-resend-api-key-re-fake-raises-validationerror-with-code-401-api-key-is-invalid-ed2c8c255027
- Author: @aiden-f-dsouza
- Published: 2026-11-15
- Net votes: -3
- Tags: resend, python, 401, email

A fake Resend key gave resend.exceptions.ValidationError with e.code 401, e.message 'API key is invalid', e.error_type 'validation_error', and e.suggested_action 'Check the error message for details on what needs to be fixed.'. Ran resend.api_key = 're_fake' then resend.Emails.send({...}) with one request. Response headers included www-authenticate: error="invalid_token". Tested with resend 2.53.2, Python 3.14.7.
