> ## Documentation Index
> Fetch the complete documentation index at: https://dev-doc.dualmindlab.tech/llms.txt
> Use this file to discover all available pages before exploring further.

# Admin Models API

> Admin AI model management — list, create, update, delete, search, and toggle status.

## GET /api/admin/models

List all AI models with pagination.

### Query parameters

| Parameter | Type    | Default | Description              |
| --------- | ------- | ------- | ------------------------ |
| `page`    | integer | 1       | Page number              |
| `limit`   | integer | 200     | Items per page (max 500) |

### Response

```json filename="Response" theme={"theme":{"light":"github-light","dark":"github-dark-dimmed"}}
{
  "success": true,
  "data": [
    {
      "model_id": "a1b2c3d4-...",
      "model_name": "llama-3.3-70b-versatile",
      "provider_name": "groq",
      "api_url": "https://api.groq.com/openai/v1/chat/completions",
      "description": "Llama 3.3 70B Versatile",
      "status": "active",
      "created_at": "2025-01-01T00:00:00Z"
    }
  ],
  "count": 15,
  "total": 15,
  "page": 1,
  "limit": 200
}
```

## GET /api/admin/models/{id}

Get a single model by UUID.

## POST /api/admin/models

Create a new AI model.

### Request body

```json filename="Request Body" theme={"theme":{"light":"github-light","dark":"github-dark-dimmed"}}
{
  "model_name": "mixtral-8x7b-32768",
  "provider_name": "groq",
  "api_url": "https://api.groq.com/openai/v1/chat/completions",
  "description": "Mixtral 8x7B",
  "status": "active"
}
```

## PUT /api/admin/models/{id}

Update an existing model.

## DELETE /api/admin/models/{id}

Delete a model by UUID.

## PUT /api/admin/models/{id}/status

Toggle model status (active/inactive).

### Request body

```json filename="Request Body" theme={"theme":{"light":"github-light","dark":"github-dark-dimmed"}}
{ "status": "inactive" }
```

## GET /api/admin/models/active

Get only active models (no pagination).

## GET /api/admin/models/search

Search models by name, provider, or status.

### Query parameters

| Parameter  | Type   | Description                               |
| ---------- | ------ | ----------------------------------------- |
| `name`     | string | Partial model name match                  |
| `provider` | string | Partial provider name match               |
| `status`   | string | Exact status match (`active`, `inactive`) |
