Skip to main content
POST
/
usage
/
events
/
adjust
curl -X POST "https://api-meter.metrifox.com/usage/events/adjust" \
  -H "x-api-key: your_api_key" \
  -H "Content-Type: application/json" \
  -d '{
    "customer_key": "cust-6d11ca90",
    "event_id": "evt_12345",
    "actual_quantity": 4
  }'
{
  "data": {
    "event_id": "evt_12345",
    "adjusted": true,
    "actual_quantity": 4,
    "actual_credit_used": 0,
    "refunded_quantity": 1,
    "refunded_credit": 0,
    "deducted_quantity": 0,
    "deducted_credit": 0,
    "message": "Usage adjusted"
  }
}
Usage endpoints are served from https://api-meter.metrifox.com. Other API calls stay on https://api.metrifox.com.
For example, if you recorded 5 image generations but the customer only used 4, send the actual amount and the difference is refunded.

Authorizations

x-api-key
string
header
required

Body

application/json
customer_key
string
required

The unique customer identifier in your application.

event_id
string
required

The event_id of the original usage event to adjust.

actual_quantity
number | null

The true quantity the customer used. Omit to leave quantity unchanged.

actual_credit_used
number | null

The true credits the customer used (prepaid features). Leave out to keep credits unchanged.

reason
string | null

Optional human-readable note stored on the adjustment for audit.

Response

Adjustment applied (or a no-op if already at the requested amount).

data
object