Skip to content
Ibby docs
Esc
↑↓navigate↵open⌘Jpreview

List this lane's runs and their estimated cost

This lane’s runs, newest first, with their durations and estimated costs. Only this key’s lane is ever shown. Every cost is an estimate.

GET/v1/usage
Authorization
AuthorizationBearer token (ibk_<public id>_<secret>) · headerrequired

A lane's API key. The lane is taken from the key, never from the request.

Query parameters
cursorstring

The next_cursor of the page before. Opaque: pass it back unchanged, with the same since, until and limit.

min length 1 · max length 512
limitinteger

Runs per page. 50 when absent, at most 200.

min 1 · max 200 · default: 50
sincestring<date-time>

Only runs that started at or after this time, as an RFC 3339 time.

matches ^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(?:\.\d+)?(?:Z|[+-]\d{2}:\d{2})$
untilstring<date-time>

Only runs that started before this time, as an RFC 3339 time.

matches ^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(?:\.\d+)?(?:Z|[+-]\d{2}:\d{2})$
Responses
200

A page of runs, with totals for the page.

next_cursorstring | nullrequired

Pass as cursor for the next page, or null on the last page.

runsUsageRun[]required

Newest first.

Show properties
Array of UsageRun
cpunumberrequired

CPU cores the run had.

duration_msinteger | nullrequired

How long the run lasted, or null while it runs.

ended_atstring<date-time> | nullrequired

When the run ended, or null while it runs.

Show properties
Any of:
string<date-time>
string<date-time>
null
null
estimated_costEstimatedCost | nullrequired

The run's estimated cost, or null while it runs.

Show properties
Any of:
EstimatedCost
amountstringrequired

The amount as a decimal string, such as 0.004210. Parse it as a decimal, not a float.

matches ^\d+\.\d+$
currencystringrequired

An ISO 4217 code. Always USD today.

estimatebooleanrequired

Always true: the figure is worked out from published rates, not read from a bill.

null
null
memory_mibintegerrequired

Memory the run had, in MiB.

namestring | nullrequired

The sandbox's name, or null.

outcomestring | nullrequired

How the sandbox ended, or null while it runs: removed (the caller removed it), lifetime_reached (its lifetime_ms ran out), resource_limit (its size limit stopped it) or failed (the create failed or the platform lost it). New values may be added; treat one you do not know as ended.

regionstringrequired
sandbox_idstringrequired

The sandbox the run was, sbx_....

started_atstring<date-time>required

A UTC time in RFC 3339 form.

totalsUsageTotalsrequired

Totals for the runs on this page that have ended: their durations and their estimated costs, added up. An estimate.

Show properties
duration_msintegerrequired

The ended runs' durations on this page, added up.

estimated_costEstimatedCostrequired

An estimate of what the run cost: its seconds times its CPU and memory size times published rates. Never a bill.

Show properties
amountstringrequired

The amount as a decimal string, such as 0.004210. Parse it as a decimal, not a float.

matches ^\d+\.\d+$
currencystringrequired

An ISO 4217 code. Always USD today.

estimatebooleanrequired

Always true: the figure is worked out from published rates, not read from a bill.

400

invalid_request: The request does not match the contract.

errorErrorDetailrequired
Show properties
codestringrequired

A stable, machine-readable code. Known codes: env_name_refused, file_not_found, file_too_large, idempotency_mismatch, image_not_built, in_progress, internal_error, invalid_request, lane_limit, name_in_use, not_found, payload_too_large, resources_over_cap, region_mismatch, sandbox_stopped, unavailable, store_prefix_refused, store_unavailable, unauthorized. New codes may be added, so treat an unknown one by its HTTP status.

messagestringrequired

A sentence for a person. Do not parse it.

request_idstringrequired

The same value as the X-Request-Id header.

401

unauthorized: The API key is missing, unknown or revoked.

errorErrorDetailrequired
Show properties
codestringrequired

A stable, machine-readable code. Known codes: env_name_refused, file_not_found, file_too_large, idempotency_mismatch, image_not_built, in_progress, internal_error, invalid_request, lane_limit, name_in_use, not_found, payload_too_large, resources_over_cap, region_mismatch, sandbox_stopped, unavailable, store_prefix_refused, store_unavailable, unauthorized. New codes may be added, so treat an unknown one by its HTTP status.

messagestringrequired

A sentence for a person. Do not parse it.

request_idstringrequired

The same value as the X-Request-Id header.

500

internal_error: The platform failed. A retry may succeed; for a call that creates or writes, retry with the same Idempotency-Key.

errorErrorDetailrequired
Show properties
codestringrequired

A stable, machine-readable code. Known codes: env_name_refused, file_not_found, file_too_large, idempotency_mismatch, image_not_built, in_progress, internal_error, invalid_request, lane_limit, name_in_use, not_found, payload_too_large, resources_over_cap, region_mismatch, sandbox_stopped, unavailable, store_prefix_refused, store_unavailable, unauthorized. New codes may be added, so treat an unknown one by its HTTP status.

messagestringrequired

A sentence for a person. Do not parse it.

request_idstringrequired

The same value as the X-Request-Id header.

503

unavailable: A service behind the API could not be reached. Retry after a short wait; for a call that creates or writes, with the same Idempotency-Key.

errorErrorDetailrequired
Show properties
codestringrequired

A stable, machine-readable code. Known codes: env_name_refused, file_not_found, file_too_large, idempotency_mismatch, image_not_built, in_progress, internal_error, invalid_request, lane_limit, name_in_use, not_found, payload_too_large, resources_over_cap, region_mismatch, sandbox_stopped, unavailable, store_prefix_refused, store_unavailable, unauthorized. New codes may be added, so treat an unknown one by its HTTP status.

messagestringrequired

A sentence for a person. Do not parse it.

request_idstringrequired

The same value as the X-Request-Id header.

Request
curl -X GET 'https://api.ibby.ai/v1/usage' \
  -H 'Authorization: Bearer YOUR_TOKEN' \
  -H 'Accept: application/json'
Response
{
  "next_cursor": "string",
  "runs": [
    {
      "cpu": 0,
      "duration_ms": 0,
      "ended_at": "2019-08-24T14:15:22Z",
      "estimated_cost": {
        "amount": "0.004210",
        "currency": "USD",
        "estimate": true
      },
      "memory_mib": 0,
      "name": "string",
      "outcome": "removed",
      "region": "string",
      "sandbox_id": "sbx_7Hc2mQ",
      "started_at": "2019-08-24T14:15:22Z"
    }
  ],
  "totals": {
    "duration_ms": 0,
    "estimated_cost": {
      "amount": "0.004210",
      "currency": "USD",
      "estimate": true
    }
  }
}

Was this page helpful?