name: pwn-ai-providers-anthropic description: Drive PWN::AI::Providers::Anthropic from pwn_eval. license: MIT allowed-tools: [pwn, pwn_eval] metadata: bundled: true generated: false preserve: true module: PWN::AI::Providers::Anthropic source: pwn/ai/providers/anthropic.rb
PWN::AI::Providers::Anthropic
This plugin interacts with Anthropic's Claude API. It provides methods to list models, generate completions, and chat. API documentation: https://docs.anthropic.com/en/api Obtain an API key from https://console.anthropic.com/
When to use
Call PWN::AI::Providers::Anthropic from pwn_eval when the task needs this module.
Do not reimplement it in shell.
Catalog authentication
Set ai.anthropic.key to a Console API key. Alternatively, obtain a short-lived
Claude API access token for an authorized workspace outside PWN and set
ai.anthropic.oauth.platform_access_token through pwn-vault. The adapter
sends that token only to https://api.anthropic.com/v1. It does not
sign in to Pro/Max subscriptions, use Linked billing grants, import a client
login or refresh the token. Renew it at its source. If the API rejects the
token, PWN does not retry with an API key.
How to call
PWN::AI::Providers::Anthropic.get_models(non_interactive: true).length
Public methods
refresh_oauth_bearer_tokenandobtain_oauth_bearer_tokenare retired entry points: they raise with migration guidance and do not issue credentials.get_modelsget_modelchat_with_toolschatauthorshelp
References
references/urls.md— URLs from source
Source
pwn/ai/providers/anthropic.rb
Verification
The number counts returned Claude API catalog entries, not consumer plan entitlements. Do not move old subscription tokens into either credential field.
