# Codex Disconnect

- **Method:** `POST`
- **Path:** `/api/v1/providers/codex/disconnect`
- **Operation ID:** `codex_disconnect`
- **Tags:** providers

Disconnect your ChatGPT login: Saram revokes it at OpenAI and forgets it, and no run can bill that
subscription any more. The revocation is best effort: if OpenAI cannot be reached the login is still
forgotten, and then stops serving within a minute and at OpenAI only when its token expires. Your run
specs keep their `providers` entry, so connecting again is all a later run needs. A 404 when there is no
login to disconnect.

## Effective servers

- `https://api.saram.sh`

  Saram

## Authentication

- **HTTPBearer**: HTTP bearer

  a Saram API key (`sk_saram_<env>_...`) or a person's AuthKit access token, as `Authorization: Bearer <credential>`. Both are told apart by shape and produce the same principal.

## Responses

### 200 Successful Response

**Content type:** `application/json`

schema: `CodexDisconnected`, no additional properties

A ChatGPT login disconnected: this caller's `state` is now `none`.

- **`caller` (required)**: `string`
- **`state` (required)**: `string`, possible values: `"none", "pending", "connected", "expired", "error"`

**Example:**

```json
{
  "caller": "",
  "state": "none"
}
```

### 403 the API key lacks the required scope

## Schemas

- `CodexDisconnected` — shown above.
