{"name":"@deckyard/anthropic","description":"A client for Anthropic's Claude Messages API: tool use, thinking, prompt caching, token counting and message batches","versions":{"0.1.0":{"version":"0.1.0","kind":"git","url":"https://github.com/deckyard/deck-anthropic.git","ref":"0.1.0","commit":"d758469492e785db2d3b45db79582772c7fd4331","checksum":"","yanked":false,"license":"LGPL-3.0-only","requires":{},"engines":{"jennifer":"\u003e=0.26.0"},"capabilities":["net"],"keywords":["anthropic","claude","llm","ai","chat"],"description":"A client for Anthropic's Claude Messages API: tool use, thinking, prompt caching, token counting and message batches","publishedAt":"1794771039","repoId":1458227157,"repoOwnerId":346943577,"repoOwner":"deckyard"},"0.2.0":{"version":"0.2.0","kind":"git","url":"https://github.com/deckyard/deck-anthropic.git","ref":"0.2.0","commit":"d276c9e2ac898395353e9f01c7f2fd6c84040b19","checksum":"","yanked":false,"license":"LGPL-3.0-only","requires":{},"engines":{"jennifer":"\u003e=0.27.0"},"capabilities":["net"],"keywords":["anthropic","claude","llm","ai","chat"],"description":"A client for Anthropic's Claude Messages API: tool use, thinking, prompt caching, token counting and message batches","publishedAt":"1795559453","repoId":1458227157,"repoOwnerId":346943577,"repoOwner":"deckyard"}},"readme":"# @deckyard/anthropic\n\n[![test](https://github.com/deckyard/deck-anthropic/actions/workflows/test.yml/badge.svg)](https://github.com/deckyard/deck-anthropic/actions/workflows/test.yml)\n[![Documentation](https://img.shields.io/badge/docs-github%20pages-blue)](https://deckyard.github.io/deck-anthropic/)\n[![release](https://img.shields.io/github/v/release/deckyard/deck-anthropic)](https://github.com/deckyard/deck-anthropic/releases/latest)\n\nA client for Anthropic™'s Claude™ Messages API for\n[Jennifer](https://jennifer-lang.dev/) programs, over plain HTTPS: messages\nwith text, image and PDF content, tool use with a tool loop, adaptive\nthinking and effort, prompt caching, structured outputs, token counting,\nthe Models API and the Message Batches API. Requests and replies are\n`json.Value` documents in the API's own shape.\n\n**[Documentation](https://deckyard.github.io/deck-anthropic/)**\n\n## Install\n\n```sh\njvc add @deckyard/anthropic\n```\n\nThis vendors the deck to `vendor/\u003cscope\u003e/anthropic/`. Without `jvc`, unpack the\n`src/` subtree of a release archive (`\u003cscope\u003e-anthropic-\u003cversion\u003e.tar.gz`) there.\n\n## Usage\n\n```jennifer\nuse io;\nuse json;\nuse os;\n\nimport \"@deckyard/anthropic/\" as anthropic;\n\ndef c as anthropic.Client init anthropic.client(os.getEnv(\"ANTHROPIC_API_KEY\"));\ndef req as json.Value init anthropic.newRequest(anthropic.DEFAULT_MODEL);\n$req = anthropic.withEffort(anthropic.addUserText($req, \"Explain TCP slow start briefly.\"), \"low\");\ndef reply as json.Value init anthropic.chat($c, $req);\nio.printf(\"%s\\n\", anthropic.text($reply));\n```\n\nA tool loop, with a handler the program defines and a context passed to\nit (Jennifer has no closures):\n\n```jennifer\ndef run as anthropic.ToolRun init anthropic.runToolsWith($c, $req, runTool, $context, 10);\nio.printf(\"%s (%d tool calls)\\n\", anthropic.text($run.reply), $run.calls);\n```\n\nThe examples in `examples/` (`chat.j`, `tools.j`, `batch.j`) read the key\nfrom `ANTHROPIC_API_KEY`.\n\n## Requirements\n\nJennifer 0.27.0 or newer, the default `jennifer` binary (the deck needs the\n`net` capability, so not `jennifer-tiny`), network access to\n`api.anthropic.com` and an API key from the\n[Claude Console](https://platform.claude.com). Replies are not streamed (see\nthe documentation for what is not covered yet).\n\n## Development\n\n```sh\ntools/check-all.sh                   # the full gate, as CI runs it\njennifer test src/anthropic_test.j   # the test overlay\ntools/check-docs.sh                  # docs against the code\ntools/pack.sh dist                   # build the release archive\n```\n\nThe tests need no key: a loopback fake answers with replies in the shape of\nAnthropic's API reference.\n\n## Trademarks\n\nAnthropic™ and Claude™ are trademarks of Anthropic, PBC. Other product and\ncompany names may be trademarks of their respective owners. They are used\nonly to identify the products this deck works with. This deck is an\nindependent project, not affiliated with, sponsored or endorsed by\nAnthropic, PBC.\n\n## Licence\n\nLGPL-3.0-only, see [LICENSE](LICENSE). Copyright (C) 2026 mplx \u0026lt;mplx@jennifer-lang.dev\u0026gt;.\n"}