Skip to content

GET /api/v1/hosts/machines/{id}/earnings

Operation: getMachineEarnings.

Per-machine earnings day-series (host owner)

The account-wide /hosts/earnings day-series narrowed to one machine and attributed through jobs.machine_id, in the identical shape so one chart renders both. Ledger-derived only: every bar links back to journal_lines on host_payable:<id> for jobs that ran on this machine, and the series reconciles exactly to those rows. paid_micro is zero throughout, because payout settlements carry no job_id and belong to the account rather than to any one machine — attributing them would double-count a payout across the fleet. A non-owner receives 404, never 403, so machine existence never leaks. A malformed window is refused rather than silently defaulted.

GET https://amplerun-api.spiry.org/api/v1/hosts/machines/{id}/earnings

Use the credential and scope required by this operation. For programmatic renter/host calls: Authorization: Bearer $AMPLERUN_API_KEY. A host-agent signature or other specialized proof is required where the description specifies it.

NameLocationPresenceTypeDescription
idpathRequiredUUID
windowqueryOptionalstringTrailing window as <n>d (default 30d, 1..365).

Daily earnings bars for this machine, oldest first.

application/json

FieldTypePresenceDescription
window_daysintegerRequired
fromRfc3339UtcRequired
toRfc3339UtcRequired
daysarray of objectRequired
{
"type": "object",
"additionalProperties": false,
"required": [
"window_days",
"from",
"to",
"days"
],
"properties": {
"window_days": {
"type": "integer",
"minimum": 1,
"maximum": 365
},
"from": {
"$ref": "#/components/schemas/Rfc3339Utc"
},
"to": {
"$ref": "#/components/schemas/Rfc3339Utc"
},
"days": {
"type": "array",
"items": {
"type": "object",
"additionalProperties": false,
"required": [
"day",
"earned_micro",
"fee_micro",
"paid_micro",
"rental_count"
],
"properties": {
"day": {
"type": "string",
"description": "UTC calendar day, YYYY-MM-DD"
},
"earned_micro": {
"type": "string",
"pattern": "^-?(0|[1-9][0-9]*)$"
},
"fee_micro": {
"type": "string",
"pattern": "^-?(0|[1-9][0-9]*)$"
},
"paid_micro": {
"$ref": "#/components/schemas/MicroAmount"
},
"rental_count": {
"type": "integer"
}
}
}
}
}
}

Error envelope. 401 unauthenticated, 403/404 forbidden, 409 conflict, 422 invalid input, 429 rate limited (code UNAVAILABLE, retryable:true, no Retry-After header), 503 unavailable money/provider state with retryable:true.

application/json

FieldTypePresenceDescription
errorobjectRequired
{
"$ref": "#/components/schemas/ErrorEnvelope"
}

Replace path/query placeholders and provide the required JSON body, headers and credential from the sections above. This is a request outline, not a command that chooses an amount or starts a rental for you.

Terminal window
curl --request GET 'https://amplerun-api.spiry.org/api/v1/hosts/machines/{id}/earnings' \
--header "Authorization: Bearer $AMPLERUN_API_KEY"

Schema definitions · Download OpenAPI · Authentication · Errors and recovery

Official AmpleRun documentation · Contract v3 · Generated from the API contract · Revision 52fe29de · Open AmpleRun · View Markdown · For agents