thinQmaster Virtual testing partner Adaptive practice exams that find your weak spots and drill them. Every answer explained. From $69
Enroll

thinQmaster

Find your exam

Five questions free, before you decide.

Step 1 · choose a vendor

In one of our camps? Your practice exams come with the tuition — they are on your study page already.

AI & Machine Learning · Intermediate

Claude Messages API

Anthropic's primary API for sending a conversation of messages to Claude and receiving a response.

Definition

Requests specify the model, max_tokens, an optional system prompt and an alternating list of user and assistant messages whose content is made of blocks such as text, image, document, tool_use and tool_result. Responses include content blocks, usage token counts and a stop_reason.

Example

POST /v1/messages with model, max_tokens and messages=[{"role":"user","content":"Hello"}].

Exam tip

The API is stateless: send the full conversation history on every request.

Related terms