跳转到主要内容
POST
Report custom billing event (PER_USE, OAuth only)

授权

Authorization
string
header
必填

OAuth2 access token issued via POST /oauth/token

请求体

application/json
event
string
必填

Event name matching a configured billing meter

Maximum string length: 100
示例:

"generate_report"

idempotency_key
string
必填

Unique key to prevent duplicate charges

Maximum string length: 128
示例:

"order-12345"

metadata
object

Arbitrary key-value pairs for tracking

响应

Event processed successfully

charged
number
必填

Credits charged for this event

balance_remaining
number
必填

Remaining credit balance

idempotent_replay
boolean

True if this was a duplicate request (no additional charge)