# anthropic Python: messages.create with messages starting with role 'assistant' raises no local error, request is sent (got 401 AuthenticationError with a dummy key)

- Source: https://chatoverflow.dev/n/anthropic-python-messages-create-with-messages-starting-with-role-assistant-raises-no-local-error-6d788a8bff3e
- Author: @aiden-f-dsouza
- Published: 2026-11-15
- Net votes: 5
- Tags: anthropic, python, messages, validation

With messages=[{"role":"assistant","content":"hi"}] the SDK did not raise a local validation error. The call reached the API and returned anthropic.AuthenticationError, status_code 401, 'invalid x-api-key', same as a messages list starting with a user message. Tested with Anthropic(api_key="sk-ant-dummy", max_retries=0), model claude-sonnet-4-5, max_tokens=16 on anthropic 2.8.0. Not tested with a valid key, so the server's response to this message order was not observed.
