Anthropic Claude API Tester
Build, run and copy Anthropic Claude Messages API requests as cURL, Python and JavaScript.
Building the request and the cURL, Python and JavaScript code happens entirely in your browser. When you press Run, your Anthropic API key and prompt are sent directly from your browser to Anthropic, not to ArrayKit. Your key is kept in browser memory only and is never stored or sent to ArrayKit. Avoid using production keys on shared or public machines.
Try the OpenAI API Tester
About Anthropic Claude API Tester
The Anthropic Claude API tester lets you build, run and copy requests to the Claude Messages API (POST /v1/messages) without leaving your browser. Paste your Anthropic API key, pick a model like claude-opus-4-8 or claude-sonnet-4-6, type a prompt and a max_tokens value, and ArrayKit assembles a correct request with the x-api-key and anthropic-version headers. Generate ready-to-paste cURL, Python and JavaScript snippets, or press Run to call Anthropic directly and inspect the response. It is built for developers, prompt engineers and anyone integrating Claude who wants to verify a key, sanity-check a model name, or grab a working request to drop into their codebase. The request and code are constructed locally; when you Run, your key and prompt go straight from your browser to Anthropic, never to ArrayKit.
Features
- Targets the Claude Messages API endpoint POST /v1/messages with the correct shape
- Sets x-api-key and anthropic-version headers automatically
- Model picker with suggestions like claude-opus-4-8, claude-sonnet-4-6 and claude-haiku-4-5
- Configurable max_tokens, which Anthropic requires on every request
- One-click cURL, Python and JavaScript code generation
- Run in the browser to call Anthropic directly and view the JSON response
- API key stays in browser memory only and is never stored or sent to ArrayKit
- Copy buttons for every generated snippet
How to use the Anthropic Claude API Tester
- Paste your Anthropic API key into the key field
- Pick a model such as claude-opus-4-8 or claude-sonnet-4-6
- Type your prompt and set a max_tokens value
- Press Run to call Anthropic, or copy the cURL / Python / JavaScript snippet
Example
Input
curl https://api.anthropic.com/v1/messages \
-H "x-api-key: $ANTHROPIC_API_KEY" \
-H "anthropic-version: 2023-06-01" \
-H "content-type: application/json" \
-d '{"model":"claude-opus-4-8","max_tokens":1024,"messages":[{"role":"user","content":"Hello, Claude"}]}'
Output
{
"id": "msg_01...",
"type": "message",
"role": "assistant",
"model": "claude-opus-4-8",
"content": [{"type": "text", "text": "Hello! How can I help you today?"}],
"stop_reason": "end_turn"
}
A minimal Claude Messages API request with the required headers and max_tokens.
Common errors & troubleshooting
- Pressing Run shows a CORS or network error in the browser — Browsers can block cross-origin calls to the API. Copy the generated cURL and run it from a terminal instead.
- 401 authentication_error — The API key is missing, malformed or revoked. Re-copy it from the Anthropic Console and paste it into the key field.
- 400 invalid_request_error about max_tokens — Anthropic requires max_tokens on every request. Set a positive integer before running or copying the snippet.
- 404 not_found_error on the model — The model id is mistyped or retired. Use a current id like claude-opus-4-8, claude-sonnet-4-6 or claude-haiku-4-5.
- 429 rate_limit_error — You hit your rate or token limit. Wait for the retry-after window, then run the request again.
Frequently asked questions
- What is the Anthropic Claude API tester?
- It is a browser tool that builds requests to the Claude Messages API (POST /v1/messages), generates cURL, Python and JavaScript code, and can run the request so you can inspect Claude's response.
- Does ArrayKit see or store my Anthropic API key?
- No. The request and code are built locally. When you press Run, your key and prompt are sent directly from your browser to Anthropic, never to ArrayKit. The key is kept in browser memory only and is never stored or sent to us.
- Why does Run fail with a CORS error when the cURL works?
- The Anthropic API may not allow direct cross-origin browser calls, so the browser blocks the request. The generated cURL command runs fine from a terminal or backend where CORS does not apply.
- Which Claude models can I test?
- Any current Messages API model id works. The picker suggests options like claude-opus-4-8, claude-sonnet-4-6 and claude-haiku-4-5, and you can type any valid id.
- Why do I have to set max_tokens?
- The Anthropic Messages API requires max_tokens on every request; it caps how many tokens Claude can generate. ArrayKit includes it in the request and the generated code.
- Is it safe to use a production key here?
- Avoid pasting production keys on shared or public machines. The key stays in your browser, but anyone with access to that machine could see it. Prefer a scoped or test key.
Related tools
- OpenAI API Tester — Build, run and copy OpenAI Chat Completions API requests as cURL, Python and JavaScript.
- Google Gemini API Tester — Build, run and copy Google Gemini generateContent API requests as cURL, Python and JavaScript.
- Replicate API Tester — Build, run and copy Replicate prediction API requests as cURL, Python and JavaScript.
- Hugging Face API Tester — Build, run and copy Hugging Face Inference API requests as cURL, Python and JavaScript.
- API Request Client — Send HTTP requests, build headers and params, inspect responses — your last 25 requests are saved locally.
- cURL to Fetch — Convert a curl command to a JavaScript fetch() call.
- URL Parser — Break a URL into its parts and list query parameters.
- Basic Auth Generator — Generate and decode HTTP Basic Auth Authorization headers from a username and password.
All ArrayKit tools