# Zed Agent

Source: https://docs.aicentos.com/en/clients/zed-agent

Language: en

> Connect aicentos in Zed's Agent Panel through an OpenAI-compatible provider

Zed ships with a built-in OpenAI-compatible provider type. Declare the endpoint, models and context lengths in `settings.json` and the Agent Panel can use the models aicentos offers.

## Prerequisites

First create a dedicated key for Zed on the console's "API Keys" page (naming it `zed-agent` is recommended).

* Console: [https://aicentos.com](https://aicentos.com)
* Create a key: [https://aicentos.com/keys](https://aicentos.com/keys)
* Wallet top-up: [https://aicentos.com/wallet](https://aicentos.com/wallet)

Zed does not read the API Key from `settings.json`; it reads an environment variable derived from the provider ID: the ID is converted to upper snake case with an `_API_KEY` suffix. So with the provider ID set to `aicentos`, the environment variable name is `AICENTOS_API_KEY`.

## Configuration to fill in

| Field                           | Value                                              |
| ------------------------------- | -------------------------------------------------- |
| Provider ID                     | Custom, e.g. `aicentos`                            |
| `api_url`                       | `https://aicentos.com/v1`                          |
| `available_models[].name`       | A model name from the Model Gallery in the console |
| `available_models[].max_tokens` | The model's context window                         |
| API Key                         | Environment variable `AICENTOS_API_KEY`            |

## Setup steps

* Open Zed's `settings.json` (run `zed: open settings` from the command palette).
* Add the `language_models.openai_compatible` configuration:

```json
{
  "language_models": {
    "openai_compatible": {
      "aicentos": {
        "api_url": "https://aicentos.com/v1",
        "available_models": [
          {
            "name": "gpt-5",
            "display_name": "GPT-5 (aicentos)",
            "max_tokens": 128000,
            "max_output_tokens": 16384,
            "capabilities": {
              "tools": true,
              "images": false,
              "chat_completions": true
            }
          }
        ]
      }
    }
  }
}
```

* Export the environment variable (add it to `~/.zshrc` and reload the shell):

```bash
export AICENTOS_API_KEY="sk-your-aicentos-key"
```

* Open the Agent Panel and pick a model under that provider in the model dropdown.

You can also click **Add Provider** in the Agent settings and fill in the provider name, API URL, model ID and context window through the graphical interface.

## Test

Once configured, start a new conversation in the Agent Panel and try a lightweight test with a simple prompt first; only rely on tool calls once responses come back normally.

## Notes

* `api_url` should only go up to `https://aicentos.com/v1`; do not append the full `/chat/completions` path — Zed assembles it itself.
* The API Key must not be written directly into `settings.json`; use an environment variable (or store it in the system keychain via the provider settings UI). A non-empty environment variable takes precedence over the keychain.
* `max_tokens` is the context window; set it to the model's actual value. Leaving it out breaks context management.
* Tool calling is enabled by default (`capabilities.tools`); image input and parallel tool calls are off by default — enable them manually if needed.
* Official documentation: [https://zed.dev/docs/ai/llm-providers](https://zed.dev/docs/ai/llm-providers)
* See the docs site for more details: [https://docs.aicentos.com](https://docs.aicentos.com)