Plan/Credits: Search Billing History
get_plan_and_credit_billing[Subscribe/Credits]
[What it does] Returns exactly one billing result selected by billing_kind: subscription_billing (paid recurring and one-time subscription purchase records), credit_usage (AI Credits consumption history), or invoice_download (one invoice download URL).
[When to use] Use when the user wants to see subscription payment history, AI Credits usage history, or download an invoice.
[When not to use] For the current plan or Credits balance, use get_plan_and_credits. For order-level billing, use get_order_paymentlink_and_billing. This tool never creates a payment, changes a subscription, or recharges Credits.
[How to use] billing_kind is required and selects exactly one mode per call. Each mode accepts only its own fields: subscription_billing uses start_time/end_time/billing_id/sort_by/pagination; credit_usage uses granularity/model/pagination; invoice_download uses only billing_id and invoice_id. subscription_billing is server-fixed to paid DSers subscription and one-time-purchase records only.
[Side effects] None; read-only.
[Confirmation] Not required.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"billing_kind": "<billing_kind>"
},
"name": "get_plan_and_credit_billing"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| model | No | credit_usage only. Optional exact upstream model code filter. | |
| sort_by | No | subscription_billing only. Sort order; defaults to time_desc. | |
| end_time | No | subscription_billing only. Optional Unix end timestamp. When both time fields are omitted, defaults to now. | |
| page_size | No | Items per page for the selected mode, up to 100. | |
| billing_id | No | subscription_billing only: optional exact subscription or one-time subscription Billing ID as a decimal string. invoice_download: required exact Billing ID returned by subscription_billing. | |
| invoice_id | No | invoice_download only. Required exact invoice ID returned by subscription_billing as a decimal string. | |
| start_time | No | subscription_billing only. Optional Unix start timestamp. Ignored as a default window when billing_id is set; when both time fields are omitted, defaults to 30 days before end_time. | |
| granularity | No | credit_usage only. per_round returns individual usage records; daily, weekly, and monthly return aggregated periods. Defaults to per_round. | |
| page_number | No | 1-based page number for the selected mode. | |
| billing_kind | Yes | Required result kind. subscription_billing returns recurring subscription and one-time subscription purchase Billing records; credit_usage returns AI Credits consumption history; invoice_download returns a generated invoice URL. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| billing_kind | Yes | Selected result kind: subscription_billing, credit_usage, or invoice_download | |
| credit_usage | No | AI Credits usage records; present only when billing_kind is credit_usage | |
| invoice_download | No | Invoice download URL; present only when billing_kind is invoice_download | |
| toolcall_response_at | Yes | UTC timestamp when the Tool response was returned, formatted as RFC3339. | |
| subscription_billings | No | Subscription billing records; present only when billing_kind is subscription_billing |