# Amp

Source: https://docs.aicentos.com/en/clients/amp

Language: en

> Use aicentos in Amp — override the backend address through the configuration file

Amp is a coding agent from Sourcegraph; the CLI and the IDE extensions share the same account and settings. Instead of the usual "OpenAI-compatible Base URL" input, you point the entire backend at a custom endpoint via the `amp.url` setting, with credentials stored separately in a secrets file.

## Prerequisites

First create a dedicated key for Amp on the console's "API Keys" page (naming it `amp-cli` makes usage easier to track):

* Console: [https://aicentos.com](https://aicentos.com)
* Create a key: [https://aicentos.com/keys](https://aicentos.com/keys)
* Top up when the balance runs out: [https://aicentos.com/wallet](https://aicentos.com/wallet)

## Configuration to fill in

| Field    | Value                                              |
| -------- | -------------------------------------------------- |
| API Key  | The key created in the console                     |
| Base URL | `https://aicentos.com/v1`                          |
| Model    | A model name from the Model Gallery in the console |

## Setup steps

All of Amp's settings carry the `amp.` prefix; the user-level configuration file is located at:

* macOS / Linux: `~/.config/amp/settings.json`
* Windows: `%USERPROFILE%\.config\amp\settings.json`

Create the directories first, then write the backend address:

```bash
mkdir -p ~/.config/amp ~/.local/share/amp
```

```json
{
  "amp.url": "https://aicentos.com/v1"
}
```

The API Key does not go in this file; it lives in a separate secrets file under the key `apiKey@<your URL>`:

```json
{
  "apiKey@https://aicentos.com/v1": "sk-your-API-Key"
}
```

Once the configuration takes effect, `amp login` is no longer needed and requests go straight to the endpoint you specified. If you previously signed in, run `amp logout` first and then restart `amp` to avoid a leftover login state overriding the configuration.

You can also override temporarily with environment variables, which is handy for a one-off verification:

```bash
export AMP_URL="https://aicentos.com/v1"
export AMP_API_KEY="sk-your-API-Key"
```

**Note:** once these two variables are set, Amp skips the login flow and they take precedence over the configuration file.

## Test

Send a lightweight request first to confirm the endpoint has been switched:

```bash
amp -x "Answer in one sentence: what is 1+1?"
```

A normal response means the configuration is active. If you get a 401, the key in the secrets file most likely does not exactly match `amp.url` (including whether `/v1` is at the end).

## Notes

* Amp's backend protocol is its own management API, not the generic OpenAI-compatible protocol, so `amp.url` must point at an endpoint that also serves the Anthropic Messages (`/v1/messages`) style API.
* aicentos offers a native Claude format API (see [Native Claude format](https://docs.aicentos.com/en/api/chat/claude)) and an OpenAI-compatible API (see [Chat Completions](https://docs.aicentos.com/en/api/chat/openai/chat-completions)); Amp uses the former.
* Amp requests fixed model IDs; if the endpoint has no model with that name, it falls back or errors. When that happens, check the model name against the Model Gallery in the console.
* Settings for the IDE extensions (VS Code / Cursor / Windsurf) are maintained separately from the CLI; the Amp URL and Amp API Key need to be filled in there as well.
* A `.amp/settings.json` in the workspace overrides user-level settings; when troubleshooting, first make sure no such file exists in the current directory.

## Related links

* Official settings documentation: [https://ampcode.com/docs/cli/settings](https://ampcode.com/docs/cli/settings)