POST
/api/usage/record
Record usage and deduct credits
Records an API usage event and deducts the corresponding credits from the user's balance.
curl -s -X POST "$BASE/api/usage/record" \
-H "Authorization: Bearer $API_KEY" \
-H "Content-Type: application/json" \
-d '{"action": "load", "credits": 8}'请求体
| Field | Type | Req | Default | Description |
|---|---|---|---|---|
| action | string | Y | — | Usage action type (e.g. 'load', 'parse', 'search') |
| credits | number | Y | — | Credits to deduct |
| metadata | object | N | — | Additional usage metadata |