Xcode with AI Gateway
Xcode is Apple's IDE for building apps across Apple platforms. Xcode 26's AI chat accepts any model provider that supports the Chat Completions API. This allows you to add AI Gateway as a model provider and chat with any model in the gateway catalog, with your project files as context and your usage tracked in one place.
- Xcode 26 or later
- Apple Intelligence turned on in System Settings (Xcode's intelligence features require it)
Go to the AI Gateway section in the Vercel dashboard sidebar and click API keys to create a new API key.
In Xcode, open Settings with
Cmd+,, go to Intelligence, and under Chat click Add a Model Provider. Select Internet Hosted and fill in the dialog:- URL:
https://ai-gateway.vercel.sh- API Key: paste your AI Gateway key exactly as issued
- API Key Header: leave empty, so Xcode sends the standard
Authorizationheader - Description: a label for your own reference, for example
Vercel AI Gateway
If you provisioned the key with the Vercel CLI, copy it out of your environment without echoing it to the terminal:
Terminalprintf %s "$AI_GATEWAY_API_KEY" | pbcopyXcode labels the provider by its domain, so it appears as Vercel in the settings list.
Click the new Vercel provider row. The Models table fills from the gateway catalog automatically. Star the models you plan to use as Favorites so they appear at the top of the model picker instead of scrolling the full catalog.
Model IDs use the gateway's
creator/model-nameformat, for exampleanthropic/claude-opus-5. The models catalog lists what's available.Open AI chat from the left navigator in a project window. Use the model picker on the message field to select one of your favorited gateway models, then send a prompt. The conversation includes the project context Xcode normally provides, such as the file you're working in.
Send a prompt, then check your AI Gateway Overview in the Vercel dashboard to see the request, the model that served it, and the cost.
- Model providers you add power Xcode's chat interface. Xcode's agent integrations, such as Claude Agent and ChatGPT Codex, install and authenticate separately and don't route through a custom model provider.
- Xcode stores the provider configuration in its own settings, so
vercel ai-gateway setupcan't complete this setup for you. The steps above are the whole process.
- No Apple Intelligence toggle in System Settings: your Mac's language and Siri's language must match before the toggle appears. Set them to the same language under System Settings > Apple Intelligence & Siri > Language, then turn Apple Intelligence on
- The provider's model list stays empty: confirm the URL is exactly
https://ai-gateway.vercel.shwith no/v1suffix, and that the key was pasted without extra characters - 401 Unauthorized: verify the key is an AI Gateway key and hasn't been revoked
- Browse the models catalog for available models
- Configure spend limits on your API key
- Connect your terminal agents with the Vercel CLI
Was this helpful?