Skip to main content
Glama

Billing Events

get_billing_events
Read-onlyIdempotent

Retrieve individual billing events by endpoint and date range to audit costs, track usage patterns, and debug specific API requests.

Instructions

Returns paginated individual billing event records with filters for endpoint and date range. Each record includes the request ID, timestamp, endpoint, output units billed, and a cost breakdown in USD (cost_subtotal, cost_discount, cost_total; cost_estimate_nano_usd carries cost_total in nano USD).

Key Features:

  • Individual billing event records for each API request

  • Per-request cost breakdown before and after discounts

  • Flexible date range filtering

  • Optional endpoint filtering

  • Cursor-based pagination for efficient large dataset queries

  • Limited to 10000 records per page for performance

  • Date range capped at 90 days per request

Common Use Cases:

  • Audit individual billing events

  • Track request patterns and volumes

  • Debug specific requests by ID

  • Monitor billing unit consumption per request

See fal.ai docs for more details.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
endNoEnd date in ISO8601 format, exclusive (e.g., '2025-02-01T00:00:00Z' or '2025-02-01'). Data up to but not including this timestamp is returned. Defaults to current time.
limitNoMaximum number of items to return. Actual maximum depends on query type and expansion parameters.
startNoStart date in ISO8601 format (e.g., '2025-01-01T00:00:00Z' or '2025-01-01'). Defaults to 24 hours ago.
cursorNoPagination cursor from previous response. Encodes the page number.
expandNoData to include in the response. Use 'auth_method' for a formatted authentication method label, and 'auth_method_structured' for a machine-readable auth method object (detail, api_key_id, login_username).
accountNoExact private account key profile label, not an authenticated provider owner ID.
api_key_idNoFilter by specific API key ID(s). Accepts 1-50 key IDs. Supports comma-separated values: ?api_key_id=key1,key2 or array syntax: ?api_key_id=key1&api_key_id=key2
request_idNoFilter by specific request ID(s). Accepts 1-50 request IDs. Supports comma-separated values: ?request_id=req1,req2 or array syntax: ?request_id=req1&request_id=req2
endpoint_idNoFilter by specific endpoint ID(s). Accepts 1-50 endpoint IDs. Supports comma-separated values: ?endpoint_id=model1,model2 or array syntax: ?endpoint_id=model1&endpoint_id=model2
login_usernameNoFilter by team member login username(s) (nickname). Accepts 1-50 usernames. Supports comma-separated values: ?login_username=alice,bob or array syntax: ?login_username=alice&login_username=bob

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv2.0.0

TDQS

A3.9/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Annotations already declare readOnly/idempotent/non-destructive, so safety is covered; the description adds genuinely useful operational context the annotations don't: a 10,000-record page cap, a 90-day date-range cap, cursor pagination, and the shape of the per-record cost breakdown including the nano-USD field. It omits auth/permission requirements and default date-window semantics beyond brief hints.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Well front-loaded: the core behaviour and returned fields come first, then bulleted features and use cases. It is somewhat padded — the 'Individual billing event records for each API request' bullet restates the opening sentence, and the use-case list is somewhat generic — but structure and scannability are good.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a 10-parameter read tool with no output schema, the description covers the pagination model, page/range limits, and the fields returned, which is enough for correct invocation. Missing pieces are minor: no explicit output envelope/pagination response shape and no note on what happens when no filters are supplied.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so the schema already explains every parameter (dates, cursor, expand, api_key_id, request_id, endpoint_id, login_username, account) with formats and array syntax. The description adds little parameter-level detail beyond the 90-day range cap, which justifies the baseline 3 rather than higher.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

Opens with a specific verb+resource ('Returns paginated individual billing event records') and enumerates the returned fields (request ID, timestamp, endpoint, units, cost breakdown). It implicitly distinguishes itself from aggregate siblings like get_account_billing and get_usage by emphasizing 'individual ... records', but never names an alternative, so a perfect 5 isn't earned.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The 'Common Use Cases' block gives concrete contexts (audit individual billing events, debug specific requests by ID, monitor unit consumption) that tell an agent when this tool fits. However, it provides no exclusions or routing advice against siblings such as get_account_billing or get_usage, so guidance is contextual rather than prescriptive.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.