# Create Custom Model

Create a new custom model with an initial set of phrases.

```
POST https://api.reson8.dev/v1/custom-model
```

## Request

### Headers

| Header         | Value                                         |
|----------------|-----------------------------------------------|
| Authorization  | `ApiKey <api_key>` or `Bearer <access_token>` |
| Content-Type   | `application/json`                            |

### Body

| Field         | Type     | Required | Description                          |
|---------------|----------|----------|--------------------------------------|
| `name`        | string   | Yes      | Name of the custom model             |
| `description` | string   | Yes      | Description of the custom model      |
| `phrases`     | string[] | Yes      | List of phrases (must not be empty)  |

### Example

=== "curl"

    ```bash
    curl -X POST "https://api.reson8.dev/v1/custom-model" \
      -H "Authorization: ApiKey <your_api_key>" \
      -H "Content-Type: application/json" \
      -d '{
        "name": "Cardiology",
        "description": "Cardiology-specific terminology",
        "phrases": ["myocardial infarction", "atrial fibrillation", "echocardiogram"]
      }'
    ```

=== "Python"

    ```python
    import requests

    response = requests.post(
        "https://api.reson8.dev/v1/custom-model",
        headers={
            "Authorization": "ApiKey <your_api_key>",
            "Content-Type": "application/json",
        },
        json={
            "name": "Cardiology",
            "description": "Cardiology-specific terminology",
            "phrases": ["myocardial infarction", "atrial fibrillation", "echocardiogram"],
        },
    )

    custom_model = response.json()
    ```

## Response

`201 Created`

| Field         | Type   | Description                            |
|---------------|--------|----------------------------------------|
| `id`          | string | Unique identifier of the custom model  |
| `name`        | string | Name of the custom model               |
| `description` | string | Description of the custom model        |
| `phraseCount` | number | Number of phrases in the custom model  |

### Example

```json
{
  "id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
  "name": "Cardiology",
  "description": "Cardiology-specific terminology",
  "phraseCount": 3
}
```

## Errors

| Status | Code              | Description                          |
|--------|-------------------|--------------------------------------|
| 400    | `INVALID_REQUEST` | Missing or invalid fields            |
| 401    | `UNAUTHORIZED`    | Invalid or expired credentials       |
| 500    | `INTERNAL_ERROR`  | Unexpected server error              |
