name: pwn-ai-providers-grok description: Drive PWN::AI::Providers::Grok from pwn_eval. license: MIT allowed-tools: [pwn, pwn_eval] metadata: bundled: true generated: false preserve: true module: PWN::AI::Providers::Grok source: pwn/ai/providers/grok.rb
PWN::AI::Providers::Grok
This plugin interacts with xAI's Grok API, similar to the Grok plugin. It provides methods to list models, generate completions, and chat. API documentation: https://docs.x.ai/docs Obtain an API key from https://x.ai/api
When to use
Call PWN::AI::Providers::Grok from pwn_eval when the task needs this module.
Do not reimplement it in shell.
Catalog authentication
Use ai.grok.key for independent API-key access. To use an account grant,
PWN reuses the access token or tries silent refresh. Only ai.grok.oauth.enroll: true
(or oauth: true) permits a new RFC 8628 device login during a request. A
missing key or client ID is not consent. For a first grant, the operator runs
get_models in a private foreground terminal, checks the provider URL and code,
and approves in their browser. Leave key: unset for an OAuth-only test: with
enrollment off, a failed silent refresh can select a separately configured key.
How to call
PWN::AI::Providers::Grok.get_models(non_interactive: true).length
Public methods
refresh_oauth_bearer_tokenobtain_oauth_bearer_tokenget_modelsget_modelchat_with_toolschatauthorshelp
References
references/urls.md— URLs from source
Source
pwn/ai/providers/grok.rb
Verification
The number counts rows returned by the xAI catalog. It does not establish subscription tier, generation permissions or billing. Do not print tokens.
