# Your first request explained > A line-by-line walkthrough of one Messages call — what every field does and what comes back. _Source: https://aiprimetech.io/docs/getting-started/first-request/ · Home > Docs > Getting started_ The Quickstart gets you a response. This page explains what each part of it means, so the next request is one you write yourself. ## The request ```bash curl https://aiprimetech.io/v1/messages \ -H "x-api-key: $CLAUDEAPIKEY" \ -H "anthropic-version: 2023-06-01" \ -H "content-type: application/json" \ -d '{ "model": "claude-sonnet-4-6", "max_tokens": 1024, "messages": [{"role": "user", "content": "Hello"}] }' ``` | Field | Required | What it does | |---|---|---| | `model` | yes | Which model to run. Must match an id from `/v1/models` exactly. | | `max_tokens` | yes | Hard ceiling on the **output**. The model stops here even mid-sentence. This is a cost control, not a target. | | `messages` | yes | The conversation so far, oldest first. Each entry has a `role` (`user` or `assistant`) and `content`. | | `system` | no | Instructions that apply to the whole conversation. A top-level field, not a message with `role: system`. | | `temperature` | no | 0–1. Lower is more deterministic. Leave unset unless you have a reason. | | `stream` | no | `true` returns server-sent events instead of one JSON body. See [Streaming](/docs/api-reference/streaming/). | ## The response ```json { "id": "msg_01ABC...", "type": "message", "role": "assistant", "model": "claude-sonnet-4-6", "content": [{"type": "text", "text": "Hello! How can I help?"}], "stop_reason": "end_turn", "usage": {"input_tokens": 9, "output_tokens": 12} } ``` - **`content` is an array**, not a string. Text lives at `content[0].text`. Treating it as a string is the most common client bug. - **`stop_reason`** tells you why generation ended: `end_turn` (finished), `max_tokens` (hit your ceiling — the reply is truncated), `stop_sequence`, or `tool_use`. - **`usage`** is what you are billed on. Log it; it is the only reliable basis for cost attribution. > If `stop_reason` is `max_tokens`, your answer was cut off. Raise `max_tokens` or ask for a shorter reply — do not retry blindly, you pay for the truncated output too. ## Multi-turn conversations The API is stateless. To continue a conversation you resend the whole history, including the model's previous replies: ```json { "model": "claude-sonnet-4-6", "max_tokens": 1024, "messages": [ {"role": "user", "content": "What is the capital of France?"}, {"role": "assistant", "content": "Paris."}, {"role": "user", "content": "And its population?"} ] } ``` > Because history is resent every turn, input tokens grow with the conversation and so does the bill. This is why long agent sessions get expensive. [Prompt caching](/docs/guides/prompt-caching/) and [context management](/docs/guides/context-management/) both attack this directly. - [Messages API](https://aiprimetech.io/docs/api-reference/messages/) — Complete field reference - [Streaming](https://aiprimetech.io/docs/api-reference/streaming/) — Token-by-token responses - [Python SDK](https://aiprimetech.io/docs/sdks/python/) — The same call in Python --- _ClaudeAPIKey.dev is an independently operated, Anthropic-compatible API gateway. Not affiliated with Anthropic._