Skip to main content

GET /api/admin/models

List all AI models with pagination.

Query parameters

ParameterTypeDefaultDescription
pageinteger1Page number
limitinteger200Items per page (max 500)

Response

{
  "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/

Get a single model by UUID.

POST /api/admin/models

Create a new AI model.

Request body

{
  "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/

Update an existing model.

DELETE /api/admin/models/

Delete a model by UUID.

PUT /api/admin/models//status

Toggle model status (active/inactive).

Request body

{ "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

ParameterTypeDescription
namestringPartial model name match
providerstringPartial provider name match
statusstringExact status match (active, inactive)