generate_invoice
Generate verifiable client invoices from cryptographically signed AI agent receipts. Aggregate costs, token usage, and actions by date range, grouping line items by agent or activity in JSON, CSV, or Markdown formats.
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 |
|---|---|---|---|
| from | Yes | Invoice period start date in ISO 8601 format (e.g., "2026-01-01" or "2026-01-01T00:00:00Z") | |
| to | Yes | Invoice period end date in ISO 8601 format (e.g., "2026-01-31" or "2026-01-31T23:59:59Z") | |
| client_name | No | Client or bill-to name for the invoice header | |
| client_email | No | Client email address | |
| provider_name | No | Your company or provider name | |
| provider_email | No | Your email address | |
| group_by | No | How to group line items: "action" (by action name), "agent" (by agent ID), "day" (by date), or "none" (single total) | |
| format | No | Output format: "json" (structured data), "csv" (spreadsheet), or "md" (markdown table) | |
| include_receipts | No | If true, includes full receipt objects in JSON output for full auditability | |
| agent_ids | No | Filter to specific agent IDs only | |
| actions | No | Filter to specific action names only | |
| constraints_passed_only | No | If true, only include receipts where all constraints passed | |
| notes | No | Additional notes to include in the invoice | |
| payment_terms | No | Payment terms text (e.g., "Net 30", "Due on receipt") |