System

System API

Health checks, metrics, and gateway logs for monitoring and observability.

GET
/healthz

Health check. Returns 200 when healthy, 503 when degraded.

jsonResponse
{
  "status": "ok",
  "components": {
    "postgresql": { "status": "ok" },
    "redis": { "status": "ok" }
  }
}

Gateway Metrics

GET
/api/v1/metrics

Process-wide operator snapshot; /api/metrics is also registered.

All three metrics routes require a dedicated operator token in Authorization: Bearer. Configure server.metrics_token or INGATE_SERVER_METRICS_TOKEN on the gateway with a secret of at least 32 bytes and no whitespace. An unset token disables metrics access. Missing or invalid credentials return 401, including when admin_auth is false. Organization API keys and dashboard sessions cannot read these instance-wide counters.

Infrastructure operators should keep the secret on the server and scraper only. Never put it in browser code, tenant onboarding or general agent setup. The operator token does not authorize ordinary tenant APIs. For organization investigations, use dashboard Activity and Usage Analytics.

In an operator shell, set INGATE_URL to your gateway origin and INGATE_METRICS_TOKEN to the configured operator secret, then read:

bashRead JSON metrics
curl --fail-with-body "$INGATE_URL/api/v1/metrics" \
  -H "Authorization: Bearer $INGATE_METRICS_TOKEN"
bashCompatibility alias
curl --fail-with-body "$INGATE_URL/api/metrics" \
  -H "Authorization: Bearer $INGATE_METRICS_TOKEN"

The following example shows the request-related fields. The response also includes a retention object with cleanup diagnostics.

jsonExample snapshot fields
{
  "uptime_seconds": 120.5,
  "total": {
    "requests": 1,
    "errors": 0,
    "tokens": 0,
    "active_requests": 0,
    "audit_append_success": 0,
    "audit_append_failure": 0
  },
  "by_provider": {
    "openai": {
      "requests": 1,
      "errors": 0,
      "tokens": 0,
      "avg_latency_ms": 100,
      "status_counts": { "2xx": 1 }
    }
  }
}
GET
/metrics

Prometheus-compatible text; requires the same dedicated operator Bearer token.

bashRead Prometheus metrics
curl --fail-with-body "$INGATE_URL/metrics" \
  -H "Authorization: Bearer $INGATE_METRICS_TOKEN"

When migrating an existing Prometheus scrape, provision the same operator secret in a protected file on the scraper, then add authorization.credentials_file. The file contains only the token; Prometheus adds the Bearer header. Replace the target with your gateway host and port, and use HTTPS with your deployment's trusted TLS configuration outside loopback.

yamlPrometheus scrape authentication
scrape_configs:
  - job_name: ingate
    metrics_path: /metrics
    scheme: http # Local loopback example; use https outside loopback.
    static_configs:
      - targets: ["127.0.0.1:8080"]
    authorization:
      type: Bearer
      credentials_file: /run/secrets/ingate_metrics_token

Keep deployment network controls in place. Counters are process-wide, not scoped to the requesting organization, and reset when the process restarts. Metrics reads do not create inference traffic.

GET
/api/logs

Recent gateway logs. Filter with ?provider= and ?model=.

ParameterDescription
providerFilter by provider name
modelFilter by model name

Metrics Exposed

  • Proxy request/error counters, active requests and uptime
  • Provider request counts grouped by status class, such as 2xx and 5xx
  • Provider arithmetic average latency in milliseconds, not percentiles
  • Token counters as recorded by the metrics collector; not complete usage or billing evidence
  • Audit append outcomes and retention cleanup diagnostics

These endpoints do not expose model breakdowns, latency distributions or evaluation pass rates. The current proxy path records zero tokens in this collector even when stored usage is known; use Usage Analytics for recorded usage investigations.

A refused or failed read is not a zero-traffic snapshot. After correcting credentials or connectivity, a read-only retry repeats the same GET and does not replay a model request. Concurrent traffic may change counters between successful reads; this snapshot is not historical storage.