# What must a Claude Messages API request contain?

Exam: CCDV-F — Claude Certified Developer - Foundations
Knowledge domain: Applications and Integration
Updated: 2026-11-25T08:29:55.410073+00:00
HTML: https://learningpathx.com/faq/CCDV-F/ccdvf-build-claude-messages-api-request.html

## Also asked as

- How do I send an authenticated Claude Messages request with a model, instructions, and history?
- Where do system instructions, message roles, and version headers go in a Claude API call?

For a first-party text generation call, send JSON to `POST https://api.anthropic.com/v1/messages` with a supported `model`, a suitable positive `max_tokens`, and ordered `messages`. Use the top-level `system` field for instructions that apply from the start of the conversation. Represent ordinary dialogue with `user` and `assistant` turns. Content can be a string for a single text part or an ordered array of typed blocks.

For direct HTTP, set `content-type: application/json`, a supported `anthropic-version` such as `2026-10-21`, and the documented credential header. A first-party API key can use `Authorization: Bearer <key>` or the supported `x-api-key` header. An all-workspaces key also needs the target `anthropic-workspace-id`. A supported client SDK sets the basic HTTP headers from configuration. Keep long-lived credentials in server-side secret storage, and prevent them from appearing in diagnostics.

Enable a documented beta only with its exact supported header value or the associated SDK option. Record the selected model and version in reviewed configuration. API version, model, provider, and beta access affect which fields work. For example, the `2026-10-21` API version rejects the legacy sampling parameters `temperature`, `top_p`, and `top_k`. A cloud provider can use a different endpoint, IAM method, model identifier, and feature contract.

Exercise the adapter with harmless input. Confirm the returned Message parses and record its stop reason, usage, and request ID where available.

**Official references**

* [Create a Message API reference](https://platform.claude.com/docs/en/api/messages/create)
* [Claude API overview](https://platform.claude.com/docs/en/api/overview)
* [Claude API authentication](https://platform.claude.com/docs/en/manage-claude/authentication)
* [Claude API versions](https://platform.claude.com/docs/en/api/versioning)
* [Claude API beta headers](https://platform.claude.com/docs/en/api/beta-headers)

Source: [Claude Messages API and SDK Integration Foundations](https://learningpathx.com/news/claude-messages-api-and-sdk-integration-foundations.html)
