Developer Reference

Tharior Remedai API & Telemetry Reference

Endpoints for webhooks, 10-tier LLMs, Anvesh storage, Observability, and Prometheus metrics.

1. Issue Ingestion

bash — Ingest Issue Webhook
curl -X POST http://localhost:8000/api/v1/tickets/webhook \
  -H "Content-Type: application/json" \
  -H "X-Tenant: payments-team" \
  -H "Authorization: Bearer sk-cognito-token" \
  -d '{
    "ticket_id": "GH-4491",
    "repo_name": "org/payments-service",
    "title": "Fix null pointer exception in Stripe webhook deserializer",
    "description": "Deserializer crashes when event_id is absent from payload."
  }'

2. Observability & Dead-Letter Queue (DLQ)

Method Endpoint Description
GET /api/v1/telemetry/events Returns real-time structured telemetry events (Zero-Missed Guarantee).
GET /api/v1/telemetry/dlq Lists all quarantined failure records with stack traces.
POST /api/v1/telemetry/dlq/{dlq_id}/replay Replays a quarantined task with clean state without interrupting other tasks.
GET /api/v1/telemetry/circuit-breakers Returns live trip state and failure counters for all external circuits.
GET /metrics/prometheus Exposes OpenMetrics / Prometheus scrape metrics format.
WS /ws/events Live event stream (ping/pong); connect/disconnect recorded in observability.
GET /healthz Readiness with dependency checks; returns 503 under memory pressure.

3. Bifrost LLM Gateway (inference)

Method Endpoint Description
GET /api/v1/bifrost/status Runtime connectivity and persisted config summary.
GET / PUT /api/v1/bifrost/config Read or update embedded Bifrost settings (Anvesh-backed).
GET /api/v1/bifrost/providers Proxied Bifrost provider list (management API).
GET /api/v1/bifrost/models Proxied Bifrost model catalog.
POST /api/v1/bifrost/route-test Smoke-test a model through Bifrost from the gateway.

4. Platform & backlog (live-first)

Web Desk platform routes under /api/* include _simulated: false when served by the gateway.

Method Endpoint Description
GET /api/system/keda-status KEDA / queue scaling snapshot.
GET /api/redis/snapshot Redis quota and hold state.
GET /api/audit/logs Structured audit trail.
GET /api/vaagagraph/health VaagaGraph dependency health.
GET /api/v1/backlog/stories Unified backlog (ticketing + GitHub when GITHUB_TOKEN is set).

5. OpenRouter Dynamic Catalog & Live Pricing Sync

Method Endpoint Description
GET /api/v1/models/catalog Lists all models categorized across 10 tiers with context length, benchmarks, and pricing.
POST /api/v1/models/catalog Dynamically adds a custom model to a specified tier with custom pricing.
DELETE /api/v1/models/catalog Permanently removes a custom model from a tier and purges it from cache.
POST /api/v1/models/sync Triggers on-demand live synchronization of active models and rates from OpenRouter API.
GET / POST /api/v1/models/config Retrieves or updates OpenRouter API key and persistent sync interval (hourly, 6h, daily, weekly).

6. Autonomous Code Remediation & PR Automation

Method Endpoint Description
POST /api/v1/agent/remediate Synthesizes multi-file code patches with multi-model candidate failover and AST context.
POST /api/v1/code/patch/apply Applies unified patch to disk, creates branch remedai/patch-<hex>, commits, and opens PR.
GET /api/v1/repos/{repo_id}/knowledge-graph Fetches repo AST knowledge graph with limit and full query parameters.
GET /api/v1/repos/{repo_id}/files Lists repository file tree with paths, sizes, and file extension metadata.

7. Semantic Caching & Web Search Tools

Method Endpoint Description
GET /api/v1/cache/stats Returns cache hit rate, token savings count, and dollar cost savings.
POST /api/v1/cache/clear Flushes all semantic cache records from memory and Anvesh storage.
POST /api/v1/tools/search Searches live internet documentation and API specs for coding agents.
POST /api/v1/tools/search/toggle Enables or disables the internet search tool plugin dynamically.

8. Automation Playbooks & PR Review Agent

Method Endpoint Description
POST /api/v1/playbooks/story-webhook Ingests assigned story events (Jira/GitHub), auto-fixes, comments, and auto-merges.
GET / POST /api/v1/playbooks/config Configures issue listener rules, auto-commenting, and auto-merge criteria.
POST /api/v1/playbooks/review-pr Invokes Sentinel PR Review Agent to evaluate diffs, security, and emit review verdicts.
GET / POST /api/v1/tokens/budget Configures max output tokens, stream thinking suppression, and engagement mode.