BYOK AI Coding Agent CLI: Use Your Own Model API Key
Configure a local BYOK AI coding agent CLI with your own model API key, understand what stays local, and run Wukong Loops without an account or monthly quota.
> What BYOK means in Wukong Code
BYOK means Bring Your Own Key. Wukong provides the terminal workflow and local Loop orchestration, while inference is billed and served by the model provider you choose.
The current Wukong release has no paid plan, managed model credits, Guest trial, or monthly Wukong Loop allowance. A Wukong account is optional and does not unlock the local coding Loop.
> Configure a model provider
Use the provider flow as the single place to add an API key and choose a default model. Login connects an optional Wukong account; it does not configure an OpenAI, Anthropic, DeepSeek, or other model provider.
wukong provider
wukong
/provider- [+]Do not commit API keys to the repository.
- [+]Use a provider key with the minimum permissions and spending limit appropriate for your work.
- [+]The writer and read-only reviewer can use separate configured model aliases.
> What stays local—and what does not
Wukong runs in your terminal, reads and edits the current workspace under its permission mode, runs approved project checks locally, and keeps durable Loop state on the machine for recovery. Optional anonymous product events contain bounded lifecycle and version/platform fields; they exclude source code, diffs, prompts, objectives, transcripts, repository names, file paths, provider keys, and provider endpoints. Set WUKONG_TELEMETRY=0 to disable those events without changing local Loop behavior.
BYOK is not the same as offline inference. The request context—and, when you explicitly consent, allowed changed files or sanitized Gate evidence needed for review—is sent to the model provider you configured, subject to that provider’s terms and data controls. Wukong does not make a third-party model local merely because you supplied the key.
> What it costs
The Wukong CLI is currently free. Model usage is not necessarily free: your selected provider charges your account according to its own token pricing, subscription, or local-model setup.
Use the editable Preflight to set iteration and provider-call ceilings plus an optional token budget, then choose a suitable writer/reviewer model pair. These local limits are safety and cost boundaries that you approve; they are not a Wukong subscription quota.
wukong loop "finish the API validation change" --max-iterations 5 --dry-run> Start an evidence-backed local Loop
After the provider is configured, run Wukong in the workspace you want to change. Review the editable Preflight and its separate local-read, provider-send, permission, and project-check confirmations before execution. The Loop returns PASS only with complete, fresh evidence; otherwise it reports NEEDS_WORK, ERROR, PAUSED, or STOPPED_BY_USER with a blocker or next action.
cd your-project
wukong
/loop add input validation and make the project checks pass> Related guides
Try the workflow in your repository
Wukong Code is free and BYOK for macOS, Linux, and Windows.
[DOWNLOAD_WUKONG]