How can I use private AI agents in Xcode 26.3?

I work on some proprietary codebases and can only use private AI services with them (currently MiniMax M2.1 and GLM 4.7). It all works great with both Claude Code and OpenCode agents, and I'd like to leverage the new agentic capabilities that are now in Xcode 26.3.

I'm not seeing any option to connect to OpenCode, and both the Anthropic and OpenAI providers require an enterprise account (which I don't have access to).

Are there any options that I'm missing here?

Answered by Product Manager in 874863022

Hi!

you can check our new documentation:

https://developer.apple.com/documentation/xcode/giving-agentic-coding-tools-access-to-xcode

https://developer.apple.com/documentation/xcode/setting-up-coding-intelligence#Customize-the-Codex-and-Claude-Agent-environments

To run Claude Code with a local model, you can use tools like Ollama and LMStudio:

https://lmstudio.ai/blog/claudecode

https://docs.ollama.com/integrations/claude-code

Was wondering the same thing.

I tried adding Z.ai models via Settings > Intelligence > Add a Provider... but it doesn't work. I used https://api.z.ai/api/coding/paas/v4 as URL and added my API key but I always get:

Provider is not valid.
Models could not be fetched with the provided account details

This is a different issue, which a long-standing bug in Xcode Intelligence. Many model providers don't support the /v1/models uri, and Xcode chokes on it. You can probably work around the problem with a proxy like tingly-box, but it's one more thing to set up.

Accepted Answer

Hi!

you can check our new documentation:

https://developer.apple.com/documentation/xcode/giving-agentic-coding-tools-access-to-xcode

https://developer.apple.com/documentation/xcode/setting-up-coding-intelligence#Customize-the-Codex-and-Claude-Agent-environments

To run Claude Code with a local model, you can use tools like Ollama and LMStudio:

https://lmstudio.ai/blog/claudecode

https://docs.ollama.com/integrations/claude-code

By piecing together instructions from various places, I was able to make it work. Thank you very much!

For those in a similar situation, here's how to do it:

  1. Create a free-tier account at claude.ai and then go to platform.claude.com and click "Get API Key". Create a new key for Xcode, and keep it somewhere secure.

  2. Install and setup Claude Code to use your custom/private model provider, by configuring ~/.claude/settings.json

  3. In Xcode, enable the Claude Agent and authorize it with the API key that you generated (attempting to use the "Sign In with Claude.ai..." option seems to fail if you don't have an enterprise account). Leave the model selection as "Default".

  4. Copy your config to a place where Xcode can find it: cp ~/.claude/settings.json ~/Library/Developer/Xcode/CodingAssistant/ClaudeAgentConfig/

  5. Relaunch Xcode, and ask the Claude Agent "What model is this?", and you should get the response you want. :)

How can I use private AI agents in Xcode 26.3?
 
 
Q