Building agentic AI, from first principles to the frontier.
Notes and guides on building software that plans, calls tools, verifies its own work, and ships to real users.
894 entries · 6 parts · 26 chapters · Updated 2026-12-03
From the blog
The refusal came back as a 200
Schema-guaranteed output is a guarantee about one code path, and every documented way off that path returns HTTP 200. A refusal arrives with stop_reason "refusal", a 200, a bill for the tokens generated, and output that need not match your schema. A max_tokens cut-off hands you a valid prefix of an invalid document. And the third exit sets no special stop_reason at all: enum capitalization is not guaranteed, so Anthropic's own example shows an enum of three values returning a fourth that differs only in a capital letter — completing normally, with no error. Worth knowing before you add a field: asking a property for the model's step-by-step reasoning can itself trigger a reasoning_extraction refusal.