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

# Zed Editor

Configure Zed's Agent Panel to use the TensorX API.

***

## Overview

[Zed](https://zed.dev) is an open-source code editor with an Agent Panel and support for OpenAI-compatible providers.

***

## Prerequisites

* **Zed** (latest version) — [download here](https://zed.dev/download)
* A TensorX API key ([sign up here](https://app.tensorx.ai/register))

***

## Setup

### Step 1: Add TensorX as a Provider

1. Open Zed
2. Open the Agent Panel (`Cmd+Shift+A` on macOS / `Ctrl+Shift+A` on Linux)
3. Click **Settings** (gear icon) → **Add Provider**
4. Choose **OpenAI Compatible** and fill in:

| Setting           | Value                       |
| ----------------- | --------------------------- |
| **Provider Name** | `TensorX`                   |
| **API URL**       | `https://api.tensorx.ai/v1` |

### Step 2: Set Your API Key

Set the `TENSORX_API_KEY` environment variable. Zed derives the env var name from the provider name:

```bash
export TENSORX_API_KEY=your-tensorx-api-key-here
```

To make it permanent, add to your `~/.zshrc` or `~/.bashrc`:

```bash
echo 'export TENSORX_API_KEY=your-tensorx-api-key-here' >> ~/.zshrc
```

### Step 3: Configure Models

Alternatively, configure everything via Zed's settings file (`Cmd+,` → Edit `settings.json`):

```json
{
  "language_models": {
    "openai_compatible": {
      "TensorX": {
        "api_url": "https://api.tensorx.ai/v1",
        "available_models": [
          {
            "name": "<MODEL_ID>",
            "display_name": "TensorX model"
          }
        ]
      }
    }
  }
}
```

Replace `<MODEL_ID>` with an ID returned by `GET /v1/models`. Query `GET /v1/model/info` if you also add optional context, output, tool, or image capability metadata.

### Step 4: Select Model

Open the Agent Panel and select a TensorX model from the model dropdown.

***

## Model selection

Call `GET /v1/models` with your TensorX API key and use one of the returned IDs. If the integration depends on a capability or token limit, query `GET /v1/model/info` before selecting the model. See [Models](/api-reference/models.md) for examples.

***

## Using the AI Features

### Agent Panel

Open with `Cmd+Shift+A` (macOS) / `Ctrl+Shift+A` (Linux). The agent can:

* Write and edit code across multiple files
* Run terminal commands
* Search your codebase
* Explain code and answer questions

### Inline Assistant

Select code and press `Cmd+Enter` (macOS) / `Ctrl+Enter` (Linux) to get inline AI suggestions.

***

## Troubleshooting

### Models Not Appearing

Ensure your `TENSORX_API_KEY` environment variable is set and Zed was restarted after setting it.

### Authentication Errors

The API key env var name is derived from the provider name. If you named your provider "TensorX", the env var must be `TENSORX_API_KEY`.

***

## See Also

* [Zed Documentation](https://zed.dev/docs)
* [Zed LLM Providers](https://zed.dev/docs/ai/llm-providers)
* [Zed on GitHub](https://github.com/zed-industries/zed)
* [TensorX Models](https://tensorx.ai/models)


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.tensorx.ai/ai-coding-assistants/zed.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
