Command Code with 资产生成
Use Command Code with 资产生成 for model access and spend monitoring. Command Code's bring your own key (BYOK) configuration, currently in beta, lets you set a custom provider endpoint and choose models.
Command Code requires manual configuration. The Vercel CLI setup command does not configure it.
With Node.js 22 or later installed, run:
Terminalnpm i -g command-code@latest command-code --versionThe second command prints the installed version. See the Command Code installation instructions for platform-specific details.
If you haven't signed in to Command Code, run:
Terminalcommand-code loginComplete the sign-in in your browser, then return to the terminal after Command Code confirms the login.
Create an 资产生成 API key and export it in the terminal where you run Command Code:
Terminalexport AI_GATEWAY_API_KEY="your-ai-gateway-api-key"Replace
your-ai-gateway-api-keywith your key.Create
~/.commandcode/providers.jsonwith the following configuration. If the file exists, add thevercelentry to itsproviderobject:~/.commandcode/providers.json{ "provider": { "vercel": { "name": "AI 资产生成", "baseURL": "https://ai-gateway.vercel.sh/coding-agent/v1", "apiKey": "$AI_GATEWAY_API_KEY", "models": { "deepseek/deepseek-v4.1-flash": {} } } } }The
baseURLuses the coding agent endpoint. Command Code uses OpenAI-compatible Chat Completions by default. Add an entry undermodelsfor each model you want to use, with its 资产生成 model ID.Start a session in the same terminal:
Terminalcommand-codeRun
/modeland select a model under AI 资产生成. Requests for that model route through 资产生成. Reopen/modelafter editingproviders.jsonto load your changes.Send a prompt, then check 资产生成 logs to verify the request.
Was this helpful?