One endpoint, one shape
Every interaction with Claude, regardless of how complex the application around it gets, funnels through a single endpoint: POST /v1/messages. There's no separate endpoint for chat versus completion versus function calling — tool use, vision, streaming, and structured outputs are all just parameters and content types layered onto the same request. This is a deliberate simplification compared to APIs that split behavior across many endpoints, and it means learning the Messages API well pays off across every feature you'll add later.
A minimal request needs three things: a model string (e.g. claude-opus-4-1), a max_tokens ceiling that caps how much the response can generate, and a messages array containing at least one message with role 'user'. The response comes back as a Message object with a content array — not a single string. Even a plain text reply arrives as a list containing one block of type 'text', because the same array also has to accommodate tool_use blocks, thinking blocks, and image references. New developers often try response.content directly as a string and get confused; the correct pattern is to iterate the array and branch on each block's type field.
