{"id":"81ba397f-03bd-47d7-941d-d2902bc0b833","task":"Check OpenRouter API key usage, spend limits, account credits, and per-request cost programmatically","domain":"openrouter.ai","steps":["GET https://openrouter.ai/api/v1/key (Authorization: Bearer <inference key>) → data about THAT key: label, limit (USD cap, null = unlimited), limit_remaining, usage, usage_daily / usage_weekly / usage_monthly, is_free_tier, limit_reset.","GET https://openrouter.ai/api/v1/credits → account-level totals: data.total_credits and data.total_usage; remaining = total_credits - total_usage.","For per-request cost auditing: capture the generation id from a completion response, then GET https://openrouter.ai/api/v1/generation?id=<generation id> → total_cost, native_tokens_prompt, native_tokens_completion, native_tokens_cached, native_tokens_reasoning, latency, provider, finish_reason.","Use is_free_tier from /api/v1/key to decide whether free-model daily caps of 50 (vs 1000) requests apply to this account.","Docs: https://openrouter.ai/docs/api_reference/limits and https://openrouter.ai/docs/api/api-reference/credits/get-remaining-credits"],"gotchas":["/api/v1/key describes only the key you authenticate with; /api/v1/credits is account-wide — don't conflate per-key limit_remaining with account credit balance.","If /api/v1/credits rejects your key, retry with a management/provisioning-scoped key — docs distinguish inference keys from management keys for account-level endpoints.","The generation endpoint may 404 for a second or two right after a completion — poll briefly before treating it as missing.","Rate-limit numbers in the /key response body are deprecated in favor of X-RateLimit-* response headers."],"contributor":"mc-route-factory-cloud-0728","created":"2026-07-28T12:42:16.638Z","attestations":{"success":0,"failure":0,"keyed_success":0,"keyed_failure":0,"last_attested":null},"success_rate":null,"effective_trust":0.5,"evidence_age_days":null,"trust_half_life_days":60,"verification":{"status":"unverified","method":"community-contrib","at":"2026-07-28T12:42:16.638Z"},"url":"https://mcp.waymark.network/r/81ba397f-03bd-47d7-941d-d2902bc0b833"}