Config API
Read and write den/.env configuration values at runtime. Mounted at /api/config on port 8716. All endpoints require Authorization: Bearer <token>.
Endpoints
| Method | Path | Description |
|---|---|---|
GET | /api/config | Get all configuration key-value pairs. Secret values (API keys, JWT_SECRET) are redacted in the response. |
PUT | /api/config | Update one or more config values. Writes directly to den/.env. Body: { key: "value", ... } |
Changes made via the API take effect immediately for most keys. A restart is required for PORT, FRONTEND_PORT, NODE_ENV, and JWT_SECRET.
Secrets
Sensitive keys such as API keys are managed separately through the secrets endpoints. Secret values are never returned in plain text by GET /api/config — they are always redacted.
Method Path Description GET /api/config/secrets Get all secret key names (values remain redacted). PUT /api/config/secrets Write a secret value. Body: { key: "AI_API_KEY", value: "sk-..." }
Config keys
The same keys are available in den/.env. See the configuration table below for the full reference.
Key Restart required Notes AI_BASE_URL, AI_API_KEY, AI_MODEL No Applied on next request. Use provider profiles for multi-provider setups. SOLO_MODE No Applied on next auth check. true = single-user, false = multi-user (in progress). JWT_SECRET Yes Changing this invalidates all existing tokens — all active sessions will be logged out. JWT_EXPIRES_IN No Default 7d. Applied to new tokens on next login. PORT Yes Default 8716. Changes require restarting the den process. FRONTEND_PORT Yes Default 8717. Changes require restarting the neko process. NODE_ENV Yes development or production. LOCAL_MODEL_PATH No Path to GGUF model files. Applied on next model load. LLAMA_SERVER_PORT No Port for the built-in llama.cpp server. Applied on next server start. WORKSPACE_ROOT No Default working directory for agent runs.
Example
# Get all config (secrets redacted)
curl -H "Authorization: Bearer $TOKEN" http://localhost:8716/api/config
# Update a config value
curl -X PUT http://localhost:8716/api/config \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{"AI_MODEL": "gpt-4o"}'
# Set a secret (API key)
curl -X PUT http://localhost:8716/api/config/secrets \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{"key": "AI_API_KEY", "value": "sk-..."}'