# Add Router One as a chat provider in Xcode 26 Intelligence settings

> Markdown mirror of https://router.one/integrations/xcode for AI assistants and crawlers. Router One is an OpenAI-compatible LLM API gateway.
> Last updated: 2026-09-15

Xcode 26 ships a coding assistant: a conversation sidebar where you prompt an agent or a chat model to explain, generate, and fix code, with project context gathered automatically. Next to the built-in ChatGPT and Claude sign-ins, Intelligence settings accept any provider that supports the Chat Completions API, so Router One is added once as an Internet Hosted chat provider: its /v1/models list fills Xcode's model picker with the GPT, Claude, Gemini, Grok, and DeepSeek families on one key, and every prompt leaves a cost and latency trace in Dashboard → Logs. This guide covers the two values the dialog needs, why the URL is the host root without /v1, how to pick a model in New Conversation, and what a conversation costs when Xcode re-sends the transcript and attachments. The agents Xcode 26.3 added (Claude Agent and Codex, with Gemini from 26.6) sign in on their own and are outside this guide.

## Check the Xcode release and create a dedicated key

Coding intelligence is built into Xcode 26. Apple states the macOS floor per release: Xcode 26 through 26.3 require macOS Sequoia 15.6 or later, and Xcode 26.4 through 26.6 require macOS Tahoe 26.2 or later. The 26.3 release notes fix an issue that caused custom model providers to disappear between launches of Xcode, so use 26.3 or later where you can. Then create a Router One key for this Mac with a maxSpend cap; it is entered only in the Add a Chat Provider dialog. Keep the /v1 base URL that SDKs and most clients use out of Xcode: this dialog takes the host root, explained below. On a managed Mac, the CodingAssistantAllowExternalIntegrations key set to false in an MDM profile turns the coding assistant off, and no provider can be added until it is allowed.

## Configure Xcode to use the Router One base URL

Choose Xcode > Settings, select Intelligence in the sidebar, and click Add a Chat Provider under Chat. In the dialog, select Internet Hosted; Locally Hosted is for a model server on your Mac and asks for a port and an optional description instead of a URL. URL takes the host root https://api.router.one with no /v1: Apple's article writes the two endpoints a provider must serve as {Model provider URL}/v1/models and {Model provider URL}/v1/chat/completions, so Xcode joins /v1/models and /v1/chat/completions onto whatever you enter, and the /v1 base URL used by OpenAI-compatible SDKs would double that segment. The key line is the Router One key created for this Mac. Apple's article describes the rest of the dialog only as 'the URL and other details', and the WWDC25 session What's new in Xcode 26 says to 'enter your API key' for another provider; the gateway accepts it as Authorization: Bearer. Click Add. Xcode lists models from GET /v1/models, which on Router One needs the key, and the picker shows the catalog IDs it returns, such as anthropic/claude-sonnet-5 or openai/gpt-5.5; you can choose which models to show and mark favorites. To use one, click the Coding Assistant button or press Command-0, click New Conversation, and choose the ID under Chat; the placeholder text of the message field names the current model. Each prompt you submit then goes to POST /v1/chat/completions with that ID:

`xcode-intelligence-settings`

```text
# Xcode → Settings → Intelligence → Chat → Add a Chat Provider
# Select Internet Hosted (Locally Hosted asks for a port on your Mac instead)
URL:      https://api.router.one
API key:  sk-your-router-one-key
# Xcode itself requests {URL}/v1/models and {URL}/v1/chat/completions
# Coding Assistant (Command-0) → New Conversation → Chat: <exact-model-id-from-/models>
```

## Which value goes where, and how to verify it

Two values from Router One go into the dialog; everything else is Xcode's own behavior, and the last two rows mark what this URL does not configure:

| Xcode field | Value | What to verify |
| --- | --- | --- |
| Intelligence → Chat → Add a Chat Provider | Internet Hosted | Locally Hosted asks for a port on your Mac and an optional description instead of a URL; Router One is reached over the internet |
| URL | https://api.router.one | The picker fills after Add; a URL ending in /v1 makes Xcode request /v1/v1/models, which the gateway answers with 404 not_found |
| API key (the dialog's 'other details') | A Router One key created for this Mac, with maxSpend | The first prompt appears in Dashboard → Logs under that key; a wrong key is 401 invalid api key and the picker stays empty |
| New Conversation → Chat (model picker) | An exact catalog ID as returned by /v1/models, e.g. anthropic/claude-sonnet-5 | The model in each Logs trace matches /models character for character; every ID the picker lists is served on /v1/chat/completions |
| Project Context, @ references, Attachments | Xcode's defaults; Project Context is on by default for chat products | Context travels inside the Chat Completions request: input tokens in Logs grow with the transcript and attachments |
| Agents (Claude Agent, Codex, Gemini) | Not configured by this URL | Apple documents Get / Install, an Account sign-in row, and per-agent configuration folders, no URL field; this guide covers the Chat section only |

## Budget one Mac's conversations and reconcile them

Every prompt you submit in a conversation is at least one POST /v1/chat/completions, and so is each coding-tools action in the source editor: Explain, Document, Generate a Playground, Generate a Preview, and Generate Fix for Issue all go to the current chat model. Apple's release notes also refer to tools the coding assistant uses, such as 'find text in file'; when Xcode uses them, every further round trip to the model is another request with its own request_id and charge. Chat Completions keeps no conversation state on the server, and Apple describes new messages as preserving the context of earlier queries and replies, so each turn re-sends the transcript together with the project context Xcode gathered and the files you attached; the input tokens of a long conversation grow turn by turn, which is the first thing to check when one Logs row costs more than the last. The Stop button ends the response in Xcode: when the gateway sees the connection close before the response finishes, the trace shows HTTP 499 client_cancelled and is billed only for the usage the upstream reported; a response that already completed is billed in full, and Apple's Xcode 26 notes list a known issue where the status-bar Cancel button sometimes fails to stop the executing message. Give the Mac a dedicated key with maxSpend: a runaway conversation stops with HTTP 402 at the cap while the wallet and other keys continue. Reconcile by time, model, and request_id, and start a new conversation to reset the transcript rather than continuing a long one. Router One records the model call; applying changes, the modification history, Git snapshots, and Xcode's tools all run in Xcode.

## Which model ID should Xcode send?

Copy the exact model ID from /models, preserving case, hyphens, and version suffixes; do not substitute a display name. Open its detail page and match the supported API endpoints, context window, and capabilities such as tool calling to the provider and features selected in Xcode. A catalog listing does not mean the client can use every feature of that model. Give each tool a dedicated API key with a maxSpend cap.

## Which API protocol is Xcode using?

OpenAI-compatible describes an interface format; it does not make Chat Completions (/v1/chat/completions), Responses (/v1/responses), and Anthropic Messages (/v1/messages) interchangeable. Check the installed client version, provider configuration, and actual request path against the model detail page and API compatibility fact sheet. A successful plain-text chat does not establish support for hosted tools, conversation state, or file-editing features.

## Verify the Xcode call in your request trace

Send a simple text request from Xcode, then match its trace in Dashboard → Logs by time, model, and request_id: tokens, cost, latency, and status. Next, test streaming, tool calls, and multi-turn history separately. For failures, retain the actual request path, full error message, and request_id. If there is no matching log, check client configuration and connectivity before attributing the error to the gateway or upstream.

## FAQ

### I added the provider, but the model picker shows no Router One models. What went wrong?

Check the URL first. Apple's article writes the endpoints Xcode expects as {Model provider URL}/v1/models and {Model provider URL}/v1/chat/completions, so the URL field holds only the host root https://api.router.one. Enter https://api.router.one/v1 and Xcode requests https://api.router.one/v1/v1/models, which the gateway rejects with HTTP 404 not_found and a message saying that your client appends /v1/... to the base URL by itself and that the trailing /v1 should be removed; the picker has nothing to show. Remove the /v1, save, and retry. If the URL is right and the picker is still empty, the key was rejected: GET /v1/models needs a valid key and answers 401 invalid api key with a request_id for a wrong one. One version note applies as well: Xcode 26.3 fixed custom model providers disappearing between launches, so a provider that was there yesterday and is gone today is a reason to update. Once a model is listed, send one short prompt and match it in Dashboard → Logs by time, model, and request_id.

### Can Xcode reach a Claude-family model through the Anthropic Messages endpoint?

No. Apple states that an added provider 'needs to support the Chat Completions API' and names only /v1/models and /v1/chat/completions, so every custom chat provider in Xcode speaks Chat Completions; there is no setting for the Anthropic Messages format, and the Claude Sonnet & Opus entry under Chat is Apple's own sign-in, not a custom provider. That costs nothing on Router One: /v1/chat/completions serves every chat model in the catalog, so keep the same host-root URL and pick a Claude-family ID such as anthropic/claude-sonnet-5 in the model picker; the trace in Logs carries that ID. The gateway's /v1/messages endpoint is for clients that send Anthropic Messages requests themselves, such as Claude Code, and /v1/responses is served natively only for the listed GPT-family and DeepSeek IDs; neither can be selected from Xcode's dialog.

### Does the Router One provider need macOS 26 or an Apple silicon Mac?

Apple's requirements are per Xcode release, not per provider: Xcode 26 through 26.3 require a Mac running macOS Sequoia 15.6 or later, and Xcode 26.4 through 26.6 require macOS Tahoe 26.2 or later, so macOS 26 is needed only for the later 26.x releases. The Xcode 26 release notes attach Apple silicon to one option only, downloading and running a local model, and they list 'Coding intelligence features in Xcode require Apple Intelligence' among the resolved issues; an Internet Hosted provider such as Router One is described without either condition. The gateway side is the same on every Mac: the host-root URL, the key, and the catalog IDs do not change.

### Which models can Xcode use through the gateway?

Choose a current catalog model that supports both the endpoint and the features Xcode uses. Check /models and the model detail page for the exact ID, current rates, and capabilities; a family name such as GPT or Claude is not a compatibility guarantee. Seeing a model in the picker confirms discovery, so verify an actual request too.

### Models are listed, but requests fail with 400 or 404. What should I check?

Record the actual request path and error message, then check the exact model ID. A 400 can indicate invalid parameters, unsupported tools, or a model/endpoint mismatch; a 404 can indicate an incorrect path or missing resource, so it does not by itself establish that a model was retired. If the error says must be called via, use the named endpoint or select a model supported on the current endpoint. Do not add or remove /v1 or /chat/completions across all clients indiscriminately.

### Does this work from Mainland China?

Yes. The gateway is reachable from Mainland China without a VPN, and the configuration is identical to the global setup.

### How do I debug a 401/402/403/429?

Match the request and error message in Dashboard → Logs. For 401, check whether the key was sent and is valid; for 402, check wallet balance and maxSpend; for 403, check key permissions and access restrictions. For 429, distinguish request/token limits from upstream throttling using the error details. Keep the request_id and follow the error-codes reference.

## See also

- All integration guides: https://router.one/integrations
- Debug API errors in Xcode: https://router.one/llm-api-error-codes
- API compatibility: endpoints and supported features: https://router.one/facts/api-compatibility.md
- Responses API setup and limits: https://router.one/codex-responses-api
- Qwen Code setup: https://router.one/integrations/qwen-code
- Google ADK setup: https://router.one/integrations/google-adk
- One gateway behind every coding tool: https://router.one/use-cases/ai-coding-tools
- Connection and /v1 path troubleshooting: https://router.one/api-connection-troubleshooting
- Per-key model cost tracking: https://router.one/llm-cost-tracking
- Xcode: Setting up coding intelligence: https://developer.apple.com/documentation/xcode/setting-up-coding-intelligence
- Xcode: Writing code with intelligence in Xcode: https://developer.apple.com/documentation/xcode/writing-code-with-intelligence-in-xcode
- Xcode: Xcode 26 Release Notes: https://developer.apple.com/documentation/xcode-release-notes/xcode-26-release-notes
- What the gateway layer does: https://router.one/llm-api-gateway
- OpenAI-compatible API: https://router.one/openai-compatible-api
- API docs: https://router.one/docs
- Canonical page: https://router.one/integrations/xcode
- Models and per-model token rates: https://router.one/models (markdown: https://router.one/models.md)
- Pricing: https://router.one/pricing
- API docs (markdown): https://router.one/docs.md
- Company facts: https://router.one/facts/company.md
