ai-credits

Get AI credit usage breakdown.

Changed on

Returns AI credit consumption for the project, broken down by end user and feature type. Filterable by date range, end user, and feature type. Usage is updated near real time and grouped by the UTC date when the AI activity occurred. Recent activity may take a short time to appear. Defaults to the current billing period. Only credit counts are returned; token counts, model names, and costs are never exposed. Per-end-user attribution requires the partner to pass endUserId on editor initialization.

get/v3/projects/{id}/ai-credits/usage

Request

  • Base URL: https://api.unlayer.com
  • URL: https://api.unlayer.com/v3/projects/{id}/ai-credits/usage
  • Auth: one of:
    • HTTP bearer
    • HTTP bearer

Path parameters

idstring required

The resource ID

Query parameters

startstring

Start date (inclusive), YYYY-MM-DD.

endstring

End date (inclusive), YYYY-MM-DD.

end_user_idstring

Filter to a single end user id.

feature_type'full_template_gen' | 'block_edit' | 'html_import' | 'image_import' | 'image_generation'

Filter to a single feature type.

limitinteger

Max breakdown rows to return (1-1000).

offsetinteger

Number of breakdown rows to skip (pagination).

sort'credits' | 'end_user_id' | 'feature_type'

Field the breakdown is ordered by. Defaults to credits.

order'asc' | 'desc'

Sort direction. Defaults to desc (highest credits first).

Response

Default Response

total_credits_usedinteger required

Total AI credits used across the full filtered range (not just the returned page).

totalinteger required

Number of breakdown rows matching the filter (ignores paging).

Changes

    • info

      the response property became required for the status

    • info

      the response property // became required for the status

    • info

      the response property // became required for the status

    • info

      the response property // became required for the status

    • info

      the response property became required for the status

    • info

      the response property became required for the status