Blog · Engineering
Cut Repeated LLM Costs to $0.00 with X-Moyra-Cache
· Moyra Engineering
Enable tenant-isolated exact-match response caching with a single HTTP header for deterministic prompts, evaluations, and CI pipelines.
Opt-in exact response caching
Automated test suites, data classification jobs, and webhook workflows frequently send identical prompts. Paying upstream inference costs and waiting seconds for repeat calls wastes both budget and time.
By sending the X-Moyra-Cache: on header, Moyra hashes the canonical request payload within your tenant scope. Cache hits return in under 5ms (both non-streaming JSON and replayed SSE streams) and are billed at $0.00.
curl https://moyra.ai.id/v1/chat/completions \
-H "Authorization: Bearer $MOYRA_API_KEY" \
-H "X-Moyra-Cache: on" \
-H "Content-Type: application/json" \
-d '{
"model": "openai/gpt-4o-mini",
"temperature": 0,
"messages": [{"role": "user", "content": "Extract ISO country code: Jakarta, Indonesia"}]
}'Strict tenant isolation
Every cache key is scoped to your account and model ID. Cached responses are never shared across different customer accounts, ensuring complete data isolation.