# Get AI assistant configuration status

> Source: https://docs.clonepartner.com/api-reference/server/get-server-ai-config/

`GET /api/server/ai-config`

Returns whether an Anthropic API key is configured and its source. Never returns the key itself.

**Operation ID:** `getServerAiConfig`

## Authentication

### Option 1

- **BearerAuth** (`http bearer`)
  API key token. Create via POST /api/api-keys. Format: `envoy_<hex>`

### Option 2

- **CookieAuth** (`apiKey`)
  Session cookie set after login + TOTP verification

## Success responses

### 200

AI configuration status

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

- Type: `object`
- Properties:
  - `configured` (`boolean`, `required`)
  - `source` (`string | null`, `required`)
    - Allowed values: `settings`, `yaml`, `null`
    - Nullable: yes
  - `default_model` (`string | null`)
    - Nullable: yes

## Examples

### cURL

```bash
curl --request GET \
  --url 'https://your-envoy.example.com/api/server/ai-config' \
  --header 'Authorization: Bearer $API_KEY'
```

### JavaScript (fetch)

```javascript
const response = await fetch('https://your-envoy.example.com/api/server/ai-config', {
  method: 'GET',
  headers: {
    'Authorization': 'Bearer YOUR_API_KEY',
  },
});

if (!response.ok) throw new Error(`Request failed: ${response.status}`);
const data = response.status === 204 ? null : await response.json();
console.log(data);
```
