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.

3. 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).

4. 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.

4. 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.

5. 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.