> ## Documentation Index
> Fetch the complete documentation index at: https://docs.venice.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Xcode

> Add Venice as a chat provider in Xcode's Intelligence settings to use private Venice models in the Xcode coding assistant on macOS.

[Xcode](https://developer.apple.com/xcode/) includes a coding assistant that can answer questions about your project, write and refactor code, and fix errors. Besides its built-in providers, Xcode accepts any chat provider that supports the Chat Completions API, so you can add Venice in Xcode's Intelligence settings and use Venice models in coding assistant conversations.

> **Coding Assistant**
>
> Ask questions, generate code, and refactor with Venice models

> **Direct Connection**
>
> Xcode sends requests from your Mac straight to Venice

> **Privacy Choice**
>
> Pick a model with the privacy tier your code needs

***

## Prerequisites

* A Venice API key from [venice.ai/settings/api](https://venice.ai/settings/api?utm_source=venice-api-documentation)
* [Xcode](https://developer.apple.com/xcode/) 26.3 or later (earlier Xcode 26 releases can lose custom chat providers when Xcode relaunches)
* macOS Tahoe 26 or later (Xcode 27 requires macOS Tahoe 26.6 or later and an Apple silicon Mac)

***

## Setup

**1. Get your Venice API key**

Generate a key from [venice.ai/settings/api](https://venice.ai/settings/api?utm_source=venice-api-documentation). An **Inference Only** key is enough for Xcode.

Consider creating a dedicated key with an **Epoch Consumption Limit**, so you can cap what Xcode spends and revoke the key without affecting other apps. See [Generating an API Key](https://docs.venice.ai/guides/getting-started/generating-api-key.md).

**2. Open Intelligence settings**

In Xcode, choose **Xcode > Settings** and select **Intelligence** in the sidebar.

**3. Add Venice as a chat provider**

Under **Chat**, click **Add a Chat Provider** and select **Internet Hosted**. Some Xcode 26 releases label the button **Add a Model Provider**.

Enter the following values, then click **Add**:

| Field | Value |
| - | - |
| URL | `https://api.venice.ai/api` |
| API Key | `Bearer your-venice-api-key` |
| API Key Header | `Authorization` |
| Description | `Venice` |

Keep the URL exactly as shown, with no `/v1` and no trailing slash. Xcode appends `/v1/models` and `/v1/chat/completions` to it, which produces Venice's standard endpoints under `https://api.venice.ai/api/v1`.

Xcode sends the **API Key** field as the entire value of the `Authorization` header. Replace `your-venice-api-key` with your key and keep the `Bearer ` prefix.

**4. Choose your models**

Select the Venice provider under **Chat**. Xcode fetches the model list from Venice. Turn on the models you want to use, and star the ones you use most so they appear at the top of the model menu.

The list includes every Venice text model, but the coding assistant only works with models that support tool calling. Check the [model requirements](#model-requirements) before you choose, or start with `z-ai-glm-5-3-flash`.

**5. Start a conversation**

Open a project, then click the **Coding Assistant** button or press **Command-0**. Click **New Conversation** and choose a Venice model under **Chat**. The placeholder text in the message field shows which model the conversation uses.

Send a short prompt to test the connection:

```txt theme={"system"}
Summarize what this project does in three bullet points.
```

***

## Verify the Setup

Sending the test prompt is the real check. A full model list in Xcode doesn't prove that your key works, because Venice's `GET /models` endpoint returns the catalog with or without a valid key. Venice only checks the key when you send a message.

If the prompt fails, verify your API key outside Xcode:

```bash theme={"system"}
curl https://api.venice.ai/api/v1/api_keys/rate_limits \
  -H "Authorization: Bearer $VENICE_API_KEY"
```

This endpoint requires a valid key, so a `401` here points at the key rather than at Xcode's configuration. If the key works, compare the provider settings against [Troubleshooting](#troubleshooting).

***

## Model Requirements

> [!WARNING]
>
> **The model must support tool calling.** In chat conversations, Xcode gives the model tools for searching and editing your project, so a model without tool calling can't handle the coding assistant's requests.

The [text model catalog](https://docs.venice.ai/models/text.md) lists this capability as **Function Calling**, and most Venice text models support it.

Ideally, the model should also have a context window of 200K tokens or more. Xcode has no context-window setting for chat providers, and with **Project Context** on, a request can include a lot of project code on top of Xcode's tool definitions.

To list the Venice models that meet both requirements:

```bash theme={"system"}
curl -s https://api.venice.ai/api/v1/models \
  | jq -r '.data[] | select(.model_spec.capabilities.supportsFunctionCalling and .model_spec.availableContextTokens >= 200000) | .id'
```

***

## Choosing Models

These models meet both requirements:

| Use case | Example model ID |
| - | - |
| Coding | `deepseek-v4-pro-0813` |
| Lower cost | `z-ai-glm-5-3-flash` |
| Hardest tasks | `grok-4-7` |
| Screenshots and mockups with **Upload files** | `qwen-3-8-27b` |

When you compare other models:

* [`GET /models/traits?type=text`](https://docs.venice.ai/api-reference/endpoint/models/traits) returns Venice's current picks, such as `default_code` for coding.
* **Project Context** makes requests large, so input-token pricing matters more than usual. Compare prices in the [text model catalog](https://docs.venice.ai/models/text.md).

Venice retires and replaces models regularly. If a model stops working, check [Deprecations](https://docs.venice.ai/overview/deprecations.md) and switch to a current one.

***

## Agents

Chat providers power chat conversations only. Xcode's built-in agents, such as Claude Agent and Codex, and any agents you add over the Agent Client Protocol (ACP) are configured separately and don't send requests through a chat provider. Agents also get more of Xcode's capabilities than chat does, such as building and testing your app.

To run an agent on Venice models with access to your Xcode project, configure a terminal agent for Venice and connect it to the Model Context Protocol (MCP) server that Xcode 26.3 and later provide:

**1. Allow external agents**

In Xcode's Intelligence settings, under **Model Context Protocol**, turn on **Allow external agents to use Xcode tools**.

**2. Set up the agent with Venice**

Follow the [Codex CLI](https://docs.venice.ai/guides/integrations/codex-cli.md) or [Claude Code](https://docs.venice.ai/guides/integrations/claude-code.md) guide.

**3. Connect the agent to Xcode**

Register Xcode's MCP server with the agent:

```bash Codex CLI theme={"system"}
codex mcp add xcode -- xcrun mcpbridge
```

```bash Claude Code theme={"system"}
claude mcp add --transport stdio xcode -- xcrun mcpbridge
```

**4. Prompt the agent**

Open your project in Xcode first, then prompt the agent in Terminal. Xcode alerts you when the agent connects.

***

## Privacy

Xcode sends chat requests from your Mac directly to Venice. **Project Context** is on by default in chat conversations, so Xcode includes relevant code and other context from your project in each request. To limit what Xcode sends, turn off **Project Context** in the message field and reference files and symbols explicitly with `@`.

Venice does not store or log prompt and response content at its proxy. The model you choose determines the runtime privacy tier:

* **Private** models use zero-data-retention infrastructure.
* **Anonymized** models hide your identity from the upstream provider, but that provider can process your code.
* **TEE** models, with `e2ee-` model IDs, run inside a hardware enclave. Xcode can't encrypt prompts on your Mac, so these models run in TEE mode rather than end-to-end encrypted mode when you use them from Xcode.

Check each model's privacy label in the [text model catalog](https://docs.venice.ai/models/text.md) and read [Venice privacy](https://docs.venice.ai/overview/privacy.md) before sending proprietary code.

***

## Troubleshooting

> **401 or authentication error**
>
> Confirm that **API Key** is `Bearer ` followed by a Venice key from [venice.ai/settings/api](https://venice.ai/settings/api?utm_source=venice-api-documentation), with no extra spaces. Xcode loads the model list even with a wrong key, because that list is public, so authentication errors only appear when you send a message. Test the key with the command in [Verify the Setup](#verify-the-setup).

> **Xcode can't load models or rejects the provider**
>
> Check that the URL is exactly `https://api.venice.ai/api`. A URL ending in `/v1` makes Xcode request `/api/v1/v1/models`, and a trailing slash produces `/api//v1/models`. Venice returns `404` for both. Add the provider again with the corrected URL.

> **Endpoint errors when you send a message**
>
> Check that the conversation uses a model that supports tool calling and, ideally, has a context window of 200K tokens or more. Xcode sends tool definitions and project context with each request: a model without tool calling can't handle them, and a large project can overflow a smaller context window. Turn on a model that meets the [model requirements](#model-requirements), then start a new conversation with it.

> **402 or payment required error**
>
> Venice returns `402` in two cases:
>
> * The request reached Venice without an `Authorization` header. Venice ignores other headers, such as `x-api-key`, and answers with an x402 payment challenge. Set **API Key Header** to `Authorization`.
> * The key reached its spend limit, or your balance ran out. See [Troubleshooting spend limit errors](https://docs.venice.ai/guides/getting-started/generating-api-key.md#troubleshooting-spend-limit-errors).

> **Model not found**
>
> Venice may have retired the model. Check [Deprecations](https://docs.venice.ai/overview/deprecations.md), choose a current model from the provider's model list, and start a new conversation.

***

## Resources

> **[Setting Up Coding Intelligence](https://developer.apple.com/documentation/xcode/setting-up-coding-intelligence)**
>
> Apple's guide to agents and chat providers in Xcode

> **[Writing Code with Intelligence](https://developer.apple.com/documentation/xcode/writing-code-with-intelligence-in-xcode)**
>
> Use the coding assistant, project context, and history

> **[Venice Text Models](https://docs.venice.ai/models/text.md)**
>
> Browse current model IDs, capabilities, and privacy tiers

> **[Generate an API Key](https://docs.venice.ai/guides/getting-started/generating-api-key.md)**
>
> Create a dedicated key with spend limits


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.