Get Started with Claude and the Claude API

Learn what to try in Claude chat, when to use the API, and how to verify your first response before adding streaming.

Try one request before you set up the API

Choose an output you can read in one glance

Paste the sentence “The export test passed on 14 May. A rollout date is pending approval.” into Claude and ask it to return the test date and the rollout date separately. Specify that an unconfirmed date should be written as pending.

The expected response is 14 May for the test date and pending for rollout. If Claude puts 14 May in both fields, clarify which event each field describes. The exercise isolates the behavior you want before you add application code.

Move the same request into your application

The Messages API is the interface for sending prompts from code. To get started, use the model ID available to your account, a small output budget, and a user message with the same sample sentence. Keep credentials on the server or in your development process environment. The browser only needs the response your application chooses to show.

Claude API documentation

Verify the complete response, then try streaming

Capture errors and inspect the response text before using it. In this example you can compare two short lines. For a response that feeds software, validate the result before passing it on.

Streaming can render text as it arrives. Test it using the same sample and compare the final text with a normal request. Handle a stream that stops partway through so your app can tell the reader that the response is incomplete.