> For the complete documentation index, see [llms.txt](https://docs.cortecs.ai/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.cortecs.ai/integration-examples/coding/zed.md).

# Zed

Use Cortecs models with Zed's native coding agent

[Zed](https://zed.dev/) is a collaborative code editor with a native agent, inline assistance, and other model-backed development features. Because Zed supports custom OpenAI-compatible providers, you can connect these features directly to Cortecs.

{% hint style="info" %}
Before you begin, create a Cortecs API key by following the [Member quickstart](/member-quickstart.md) and choose a tool-calling model from the [model catalog](https://cortecs.ai/serverlessModels).
{% endhint %}

## 1. Add Cortecs as a provider

1. Install or update [Zed](https://zed.dev/download).
2. Open the Command Palette and run **agent: open settings**.
3. Open **LLM Providers**, select **Add Provider**, and choose an OpenAI-compatible provider.
4. Configure the provider with the following values:

| Field          | Value                                                                      |
| -------------- | -------------------------------------------------------------------------- |
| Provider name  | `Cortecs`                                                                  |
| API URL        | `https://api.cortecs.ai/v1`                                                |
| Model ID       | The exact ID from the [model catalog](https://cortecs.ai/serverlessModels) |
| Context window | The selected model's context size                                          |
| API key        | Your Cortecs API key                                                       |

Save the provider. Zed stores API keys entered through the provider settings in the system keychain instead of `settings.json`.

{% hint style="warning" %}
Do not add your Cortecs API key directly to `settings.json` or commit it to source control.
{% endhint %}

## 2. Start a Zed Agent thread

1. Open the Command Palette and run **agent: new thread**, or select the agent icon in the status bar.
2. Open the model selector in the message editor.
3. Select the model listed under **Cortecs**.
4. Choose the **Write** profile when you want the agent to edit files or run terminal commands.
5. Enter a prompt and submit it.

The Cortecs provider can also power Zed's Inline Assistant, Git commit generation, thread summaries, and similar Zed-owned AI features.

{% hint style="info" %}
Tool use depends on the selected model. Choose a model with tool-calling support for agentic editing and terminal workflows.
{% endhint %}

## Add another model

Open **agent: open settings**, return to **LLM Providers**, and edit the Cortecs provider. Add each model with its exact model ID and context window from the [model catalog](https://cortecs.ai/serverlessModels).

After saving, use the model selector in the Agent Panel to switch between the configured Cortecs models.

## Troubleshooting

### The Cortecs model does not appear

Confirm that the provider is enabled and that the model ID exactly matches the [model catalog](https://cortecs.ai/serverlessModels). Reopen the Agent Panel or restart Zed after changing the provider configuration.

### Requests return `401` or `403`

Open the Cortecs provider settings and enter the API key again. Check that an old `CORTECS_API_KEY` environment variable is not overriding the key stored by Zed.

### Requests return `404`

Use `https://api.cortecs.ai/v1` as the API URL and verify the model ID. Do not use the full `/chat/completions` path as the provider URL.

### The model shows `No tools`

The selected model does not expose tool calling to Zed. Select a tool-calling model from the [model catalog](https://cortecs.ai/serverlessModels), then start a new thread.

### Edit predictions use another provider

LLM Provider settings apply to the Zed Agent, Inline Assistant, commit generation, and summaries. Zed configures tab-style [Edit Prediction](https://zed.dev/docs/ai/edit-prediction) separately, so adding Cortecs does not change the current Edit Prediction provider.

For more details, see Zed's [OpenAI-compatible endpoint documentation](https://zed.dev/docs/ai/use-api-access#openai-compatible-endpoints) and [Agent Panel guide](https://zed.dev/docs/ai/agent-panel).
