Templates · AI

Claude API collection template

Send messages to Claude, count tokens and list models with the Anthropic API.

What's inside

Talk to Claude with the Messages API: a single message, a system prompt and a multi-turn conversation, plus token counting and the models list. Change model in the environment to try another Claude model.

5 requests in 2 folders · Base URL https://api.anthropic.com/v1 · API key in the x-api-key header

Set it up

  1. Open Claude API in Requestarium (or in the app: Import, Start from a template) and import it. You get the collection and a "Claude API" environment.
  2. Create an API key in the Claude Console (platform.claude.com), Settings, API keys. Requests are billed to your Anthropic account.
  3. Fill in the environment, pick it in the environment menu and send the first request.

Environment variables

VariableWhat it is
anthropicApiKeysecretAPI key, sk-ant-…
modelClaude model id; "List models" shows the others.

Requests

Messages

  • POST
    Send a message /messages

    One user message.

  • POST
    Message with a system prompt /messages

    Sets the role with a system prompt.

  • POST
    Multi-turn conversation /messages

    The API is stateless: send the whole conversation each time.

  • POST
    Count tokens /messages/count_tokens

    Input tokens of a request before you send it.

Models

  • GET
    List models /models

    Available Claude models; a quick way to check the key.