翻篇收录说明
翻篇网页快照

Continue CLI with AI Gateway

https://vercel.com/docs/ai-gateway/coding-agents/continue

最近抓取:2026-12-04 03:12:52(北京时间)

最近内容变化:2026-12-04 03:12:52(北京时间)

这是最近一次有效抓取的文本快照,不含网页脚本、图片和动态交互内容。实际网页可能已更新。

访问原网页

页面简介

Connect Continue CLI to AI Gateway with the Vercel CLI or a YAML model configuration that reads your API key from the environment.

正文摘录

Copy pageCopy pageContinue CLI with AI GatewayCopy pageCopy pageContinue is an open-source AI coding agent with a CLI (cn) and IDE extensions. You can configure the CLI to use AI Gateway for unified model access and spend monitoring. Set up with the Vercel CLI Run the Vercel CLI setup command for Continue CLI: terminalnpx vercel@latest ai-gateway setup --agent continue The command writes a shortlist of the gateway's most-used models into ~/.continue/config.yaml in leaderboard spend order, references the key through Continue's secrets syntax, and stamps the onboarding marker so an interactive cn doesn't rewrite the config. Re-run it to refresh the shortlist. Configuring Continue CLI If you can't use the Vercel CLI, configure Continue CLI manually: Create an API keyGo to the AI Gateway section in the Vercel dashboard sidebar and click API keys to create a new API key.Export the keyContinue resolves its secrets syntax from environment variables. Export the key in your shell:Terminalexport AI_GATEWAY_API_KEY="your-ai-gateway-api-key"To persist the key, add the same line to your shell's startup file.Point Continue at the gatewayAdd a gateway model to the models array in ~/.continue/config.yaml:~/.continue/config.yamlname: Local Config version: 1.0.0 schema: v1 models: - name: openai/gpt-6-astra provider: openai model: openai/gpt-6-astra apiBase: https://ai-gateway.vercel.sh/coding-agent/v1 apiKey: ${{ secrets.AI_GATEWAY_API_KEY }}apiKey: ${{ secrets.AI_GATEWAY_API_KEY }} is Continue's literal secrets syntax. It resolves the AI_GATEWAY_API_KEY environment variable at runtime, so the key never lands in the file. cn launches with the first entry in the list, so put your preferred model first.Skip the onboarding promptIf cn has never run before, create the onboarding marker next to the config so the interactive onboarding doesn't rewrite your models:Terminaltouch ~/.continue/.onboarding_completeIf cn ever asks for an Anthropic API key, the marker is missing. Re-create the marker instead of answering the prompt, which would overwrite the gateway models.Start ContinueTerminalcnSwitch models with /model. Add more gateway models to the models array the same way, each with the same apiBase and secrets reference. Monitor usage and spend View your usage, spend, and request activity in the AI Gateway section in the Vercel dashboard sidebar. See the observability documentation for more details. Environment variables VariableDescriptionAI_GATEWAY_API_KEYYour AI Gateway API key, read through ${{ secrets.AI_GATEWAY_API_KEY }}. Required Continue calls AI Gateway through the OpenAI-compatible Chat Completions API, so any model that supports Chat Completions works. Next steps Browse the models catalog for available models Configure spend limits on your API key Read the Continue documentation for IDE extensions and rules Last updated October 16, 2026PreviousConductorNextCrushWas this helpful?