Usage and billing
Read what each of your users' apps used, and turn it into your own plans, credits, or pass-through charges.
Easel bills your workspace for everything your users' apps use. The usage API breaks that down by project, so you can charge each user for their apps in whatever way your product prices: plans, credits, or straight pass-through.
Read usage
GET /v1/usage returns usage per project for a date range. Without from and
to, it covers the current calendar month (UTC) so far:
Pass projectId for one app. The token needs usage:read, and a token
limited to projects only sees those projects.
- Ranges cover whole UTC days: a range that starts or ends mid-day counts all of that day. For the longest range, see Limits.
- A project with no usage in the range isn't listed.
- Usage that doesn't belong to a project isn't included.
Fields
The values are the units Easel bills, the same as your workspace's Usage page. Usage in higher-priced regions is converted into base-region units first; see Meters.
| Field | Meter |
|---|---|
requests | Edge Requests |
functionInvocations | Function Requests |
functionDurationGbHours | Function Duration, in GB-hours |
dataTransferGb | Edge Data Transfer, in GB |
buildMinutes | Build Execution, in vCPU-minutes |
meters | Every metered quantity for the project, by meter ID |
meters includes meters the named fields don't cover, such as Origin
Transfer, cache reads and writes, and image transformations.
Charge your users
Your Easel invoice is for the whole workspace. How you charge your users is up to you:
- Plans. Give each plan an allowance per field, such as requests and data transfer, and compare each user's apps against it.
- Credits. Convert usage into credits at your own rates, and deduct them on a schedule.
- Pass-through. Price each meter with Easel's rates and add your margin.
Keep your own mapping from project to user, because Easel doesn't know your
users. Attaching your app's ID as
deployment meta
helps when reading webhooks, but usage is reported per project.
Cap what an app can use
Easel has no per-project spending cap. To cap one user's apps, read their
usage on a schedule, and when an app passes its allowance, stop publishing it
in your product, or delete its project with DELETE /v1/projects/:id.
For the workspace as a whole, set a spend budget so usage charges can't grow without bound. See Spend budget.