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.
Endpoint
Section titled “Endpoint”GET https://amplerun-api.spiry.org/api/v1/hosts/machines/{id}/earnings
Authentication
Section titled “Authentication”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.
Parameters
Section titled “Parameters”| Name | Location | Presence | Type | Description |
|---|---|---|---|---|
id | path | Required | UUID | |
window | query | Optional | string | Trailing window as <n>d (default 30d, 1..365). |
Responses
Section titled “Responses”Daily earnings bars for this machine, oldest first.
application/json
| Field | Type | Presence | Description |
|---|---|---|---|
window_days | integer | Required | |
from | Rfc3339Utc | Required | |
to | Rfc3339Utc | Required | |
days | array of object | Required |
{ "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" } } } } }}default
Section titled “default”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
| Field | Type | Presence | Description |
|---|---|---|---|
error | object | Required |
{ "$ref": "#/components/schemas/ErrorEnvelope"}Static request outline
Section titled “Static request outline”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.
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