Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

System API

System endpoints for health checks, metrics, and model information.


Models

List Models

Returns all available LLM models.

GET /v1/models

Response:

{
  "models": [
    {
      "name": "claude-sonnet-4-5-20250929",
      "provider": "anthropic",
      "context_window": 200000,
      "max_output_tokens": 8192,
      "supports_tools": true,
      "supports_vision": true
    },
    {
      "name": "claude-haiku-4-5-20251001",
      "provider": "anthropic",
      "context_window": 200000,
      "max_output_tokens": 8192,
      "supports_tools": true,
      "supports_vision": true
    }
  ]
}

Get Model

Returns details for a specific model.

GET /v1/models/{name}

Path Parameters:

ParameterTypeDescription
namestringModel name (e.g., “claude-sonnet-4-5-20250929”)

Response:

{
  "name": "claude-sonnet-4-5-20250929",
  "provider": "anthropic",
  "context_window": 200000,
  "max_output_tokens": 8192,
  "supports_tools": true,
  "supports_vision": true
}

Error Response (404):

{
  "error": {
    "code": "not_found",
    "message": "Model 'unknown-model' not found"
  }
}

System Time

Get Server Time

Returns the current server time. Useful for synchronization and debugging.

GET /v1/system/time

Response:

{
  "time": "2024-01-15T10:30:00Z"
}

Metrics

Get Metrics

Returns server metrics in Prometheus format.

GET /v1/metrics

Response:

# HELP archia_requests_total Total number of requests
# TYPE archia_requests_total counter
archia_requests_total{endpoint="/v1/responses"} 1523
archia_requests_total{endpoint="/v1/agent/config"} 42

# HELP archia_active_chats Number of active chat sessions
# TYPE archia_active_chats gauge
archia_active_chats 7

# HELP archia_request_duration_seconds Request duration in seconds
# TYPE archia_request_duration_seconds histogram
archia_request_duration_seconds_bucket{le="0.1"} 1200
archia_request_duration_seconds_bucket{le="0.5"} 1450
archia_request_duration_seconds_bucket{le="1.0"} 1510
archia_request_duration_seconds_bucket{le="+Inf"} 1523

Use with Prometheus:

Add to your prometheus.yml:

scrape_configs:
  - job_name: 'archia'
    static_configs:
      - targets: ['localhost:8080']
    metrics_path: '/v1/metrics'

Examples

Check Server Health

# Quick health check using time endpoint
curl http://localhost:8080/v1/system/time

List Available Models

curl http://localhost:8080/v1/models

Get Specific Model Info

curl http://localhost:8080/v1/models/claude-sonnet-4-5-20250929

Scrape Metrics

curl http://localhost:8080/v1/metrics

Next Steps