generate_invoice
Generate client invoices from cryptographically signed receipts for AI agent work. Aggregates costs, token usage, and receipt counts by agent, action, or day, with verifiable line items referencing signed receipts.
Instructions
Generate a client invoice from cryptographically signed receipts within a date range. Aggregates receipt data by agent, action, or day and calculates total costs, token usage, and receipt counts. Supports JSON, CSV, and Markdown output formats. Each line item references a signed receipt for verifiable billing. Use to bill clients for AI agent work with cryptographic proof of every billed action.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| to | Yes | Invoice period end date in ISO 8601 format (e.g., "2026-01-31" or "2026-01-31T23:59:59Z") | |
| from | Yes | Invoice period start date in ISO 8601 format (e.g., "2026-01-01" or "2026-01-01T00:00:00Z") | |
| notes | No | Additional notes to include in the invoice | |
| format | No | Output format: "json" (structured data), "csv" (spreadsheet), or "md" (markdown table) | |
| actions | No | Filter to specific action names only | |
| group_by | No | How to group line items: "action" (by action name), "agent" (by agent ID), "day" (by date), or "none" (single total) | |
| agent_ids | No | Filter to specific agent IDs only | |
| client_name | No | Client or bill-to name for the invoice header | |
| client_email | No | Client email address | |
| payment_terms | No | Payment terms text (e.g., "Net 30", "Due on receipt") | |
| provider_name | No | Your company or provider name | |
| provider_email | No | Your email address | |
| include_receipts | No | If true, includes full receipt objects in JSON output for full auditability | |
| constraints_passed_only | No | If true, only include receipts where all constraints passed |