Configuration is stored in the MongoDBDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/gcapella0/agente-inteligente-expedientes/llms.txt
Use this file to discover all available pages before exploring further.
sistema_config collection and takes priority over .env variables, enabling hot-reload of both LLM provider selection and per-agent tuning parameters without restarting the API process. When no database record exists the system falls back to the values loaded from .env at startup.
GET /config/llm
Return the currently active LLM provider configuration. Authentication:Authorization: Bearer <token> required.
Response 200 OK
Active provider. One of
ollama | openrouter.Model name currently in use for the active provider.
Ollama base URL (e.g.
http://localhost:11434). Always null when provider is openrouter.Sorted list of supported providers:
["ollama", "openrouter"].Models discovered from the
OLLAMA_MODELS environment variable (comma-separated list), falling back to OLLAMA_MODEL.Models from
OPENROUTER_MODEL plus any entries in OPENROUTER_FALLBACK_MODELS.PUT /config/llm
Persist a new LLM provider configuration to MongoDB. Changes take effect on the next agent run — the config is read fresh bycreate_llm_provider() each time an agent starts.
Authentication: Authorization: Bearer <token> required.
Request body
Target provider. Must be
ollama or openrouter.Model identifier for the chosen provider (e.g.
phi3:mini, minimax/minimax-m2.5:free).Base URL for the Ollama server. Required when
provider is ollama. Ignored for openrouter.Response 200 OK
Error responses
| Status | Condition |
|---|---|
400 Bad Request | provider is ollama but host was not provided. |
422 Unprocessable Entity | provider is not ollama or openrouter. |
POST /config/llm/probar
Test connectivity to an LLM provider without persisting any changes. If the request body is empty (or omitted), the currently saved configuration is tested. Authentication:Authorization: Bearer <token> required.
Request body (optional)
How the test works
- Ollama — sends
GET {host}/api/tags(5-second timeout) and parses the returned model list. - OpenRouter — calls
OpenRouterProvider.health_check()which verifies the API key via the OpenRouter client.
Response 200 OK
true if the provider responded successfully.Round-trip time in milliseconds.
null on connection failure.The provider that was tested.
For Ollama: list of model names returned by
/api/tags. For OpenRouter: null (the health check only verifies the API key, it does not enumerate models).Human-readable error detail when
ok is false. null on success."Conexión exitosa" or "No se pudo conectar al servidor".GET /config/agentes
Return the current per-agent tuning configuration. If no custom configuration has been saved, the endpoint returns built-in defaults. Authentication:Authorization: Bearer <token> required.
Response 200 OK
| Agent | Parameters | Defaults |
|---|---|---|
watcher | timeout_segundos, retry_veces | 60 s, 3 retries |
ocr | timeout_segundos, retry_veces | 120 s, 2 retries |
classifier | temperatura, max_tokens | 0.7, 2000 |
storage | timeout_segundos | 30 s |
PUT /config/agentes
Save a new agent configuration to MongoDB (sistema_config collection, document key agentes_config). The full object for all four agents must be provided.
Authentication: Authorization: Bearer <token> required.
Request body
Response 200 OK
GET /health
Check MongoDB connectivity. No authentication required.503 Service Unavailable if the MongoDB ping command fails.
GET /info
Return API metadata. No authentication required.GET /config/tipos-documento
Return the full catalog of document types recognised by the system. No authentication required.Full list of 22 document type definitions. Each entry includes
id, nombre, obligatorio, descripcion, formatos_aceptados, and tamaño_maximo_mb.Number of mandatory document types (
obligatorio: true). Currently 10.Total number of document type definitions in the catalog. Currently
22.cedula_identidad, rif, partida_nacimiento, titulo_bachiller, certificado_notas_bachillerato, titulo_universitario, certificado_notas_pregrado, fondo_negro_titulo, acta_grado, resolucion_nombramiento. All others (postgrado certificates, diplomas, constancias, etc.) are optional.
GET /config/estados-validacion
Return the enumeration of valid document validation states. No authentication required.id values as the estado_validacion filter parameter on GET /estadisticas/documentos.
GET /config/estados-docente
Return the enumeration of valid docente status values. No authentication required.id values as the agrupar_por=status grouping on GET /estadisticas/expedientes.