--- name: anthropic description: Write, edit and reason with Claude through the Anthropic API. Use when the user wants a script, caption, outline, rewrite or plan written by Claude from a script or another tool, or wants a second model's opinion. Needs ANTHROPIC_API_KEY. --- # Anthropic (Claude) Key: `ANTHROPIC_API_KEY`. Get one at https://platform.claude.com/settings/keys Examples pipe JSON through `jq`. Without it, read the JSON and take the field named in each step. ## Write something ```bash curl -s 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-5-5","max_tokens":2000,"messages":[{"role":"user","content":"Write a 30-second voice-over script for a coffee brand."}]}' \ | jq -r '.content[] | select(.type=="text") | .text' ``` The reply is synchronous. The answer is in the `content` block whose `type` is `text`. ## Models - `claude-opus-5-5`: the default pick for writing and planning. - `claude-sonnet-5-5`: faster and cheaper. - `claude-haiku-5-5`: the cheapest, for bulk work like tagging or short captions. List what your key can use with `curl -s https://api.anthropic.com/v1/models -H "x-api-key: $ANTHROPIC_API_KEY" -H "anthropic-version: 2023-06-01"`. ## Notes - Long JSON is easier in a file: write `request.json`, then `-d @request.json`. - A 401 means the key is wrong. A 400 that mentions credit means the account needs credits.