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}'

Request Body

FieldTypeReqDefaultDescription
actionstringYUsage action type (e.g. 'load', 'parse', 'search')
creditsnumberYCredits to deduct
metadataobjectNAdditional usage metadata

Try it out

Sign in to use your API key
Request Body
Response
Click Execute to test