github dtzp555-max/ocp v3.8.0
v3.8.0 — Per-Key Quota + Response Cache

10 hours ago

What's New

Per-Key Quota (Budget Control)

  • Set daily/weekly/monthly request limits per API key
  • HTTP 429 with structured error when exceeded
  • PATCH /api/keys/:id/quota — partial update
  • GET /api/keys/:id/quota — view limits + usage
  • Only successful requests count; admin/anonymous exempt

Response Cache

  • Opt-in via CLAUDE_CACHE_TTL env var (default 0 = disabled)
  • SHA-256 hash of model + messages + temperature/max_tokens/top_p
  • Streaming and non-streaming support
  • Multi-turn sessions never cached
  • GET /cache/stats + DELETE /cache admin endpoints
  • Runtime-tunable via PATCH /settings
  • Auto-cleanup every 10 minutes

Bug Fix

  • SQLite datetime format mismatch with JS .toISOString() — same-day comparisons were broken

Code Quality

  • Route conflict fix for DELETE /api/keys/:id vs /quota
  • Quota check: single SQL query instead of 3 separate COUNTs
  • findKey() encapsulation replaces raw getDb() in server.mjs
  • 24-test integration suite (test-features.mjs)

Full Changelog: v3.7.0...v3.8.0

Don't miss a new ocp release

NewReleases is sending notifications on new releases.