Skip to content

AI Models

Endpoints

GET    /api/v1/ai-models                  list (admin)
GET    /api/v1/ai-models/active           list active (any authenticated user)
GET    /api/v1/ai-models/:id              fetch one (admin)
POST   /api/v1/ai-models                  create (admin)
PUT    /api/v1/ai-models/:id              update (admin)
DELETE /api/v1/ai-models/:id              delete (admin)
PUT    /api/v1/ai-models/:id/api-key      set per-model API key (admin)
POST   /api/v1/options/test/ai-model/:id  send a test prompt (admin)

Model fields

typescript
{
  id: number,                    // legacy sequential id
  id_secure: string,             // public identifier
  provider: "qevron" | "openai" | "anthropic" | "google" | "cohere" | "ollama" | "custom",
  model_key: string,             // e.g. "gpt-4", "claude-3-5-sonnet", "verinova"
  name: string,                  // display label
  category: string,              // "text" | "image" | "video"  (default "text")
  type: string | null,
  is_active: boolean,            // default true
  api_type: "chat" | "completion" | "embedding",
  api_params: Record<string, any>, // default max_tokens, temperature
  meta: Record<string, any>,
}

Operations

  • Test before enablingPOST /options/test/ai-model/:id runs a one-shot prompt and returns the model's response. Useful when a new model is added or an API key rotates.
  • Per-model API keyPUT /:id/api-key writes to the Options table as ai-model-<id>_api-key. The text-generation service uses this key first; if absent, falls back to the global QEVRON_API_KEY.
  • Disable — flip is_active to false. The user-facing /ai-models/active endpoint stops returning the model and pickers refresh on next reload.

See AI → Models for the user-side view.