---
summary: "Added: per-call cost and remaining daily-budget enrichment on every API-calling tool. Fixed: retried requests under-reporting cost."
breaking: false
security: false
---

# 0.7.6 — 2026-07-26

## Added

- **`budget` enrichment field on `openalex_search_entities`, `openalex_analyze_trends`, `openalex_get_citation_graph`, and `openalex_resolve_name`** — reports `costUsd`, `remainingUsd`, and `resetsInSeconds` against the OpenAlex daily budget, with a one-line trailer (`**Budget:** $0.0010 this call · $0.0676 left today (resets in 1h 22m)`) rendered by the new `renderBudgetTrailer` (`src/mcp-server/tools/render-budget.ts`). A zero cost renders as `free` rather than `$0.0000` — the signal that batching by ID beats paging a filtered list. The field is emitted only when all three response headers parse; a partial reading is omitted rather than shown incomplete. ([#57](https://github.com/cyanheads/openalex-mcp-server/issues/57))
- **`src/services/openalex/budget.ts`** — `parseUpstreamBudget` reads `X-RateLimit-Cost-USD`, `X-RateLimit-Remaining-USD`, and `X-RateLimit-Reset` off the response headers rather than the parsed body's `meta.cost_usd`, since a singleton `/works/{id}` response carries no `meta` key at all and the headers are the only channel every response shape carries. `mergeUpstreamBudget` accumulates cost across the multiple upstream requests one tool call can bill (a sampled search pairs the sample with a population count; a citation-graph walk gates on a seed lookup), so the reported figure is the true cost of the call, not the last response's line item.

## Fixed

- **Retried requests no longer under-report cost** — `OpenAlexService.request()` recorded the budget accounting after `parseResponse()`, so an attempt whose truncated body threw (and was retried) had its cost dropped — OpenAlex bills the 200 response whether or not its body survives. The budget read now happens before the parse, off the same `Response` headers, so a retried request's cost is counted. ([#59](https://github.com/cyanheads/openalex-mcp-server/issues/59))
