sandboxes

List hourly sandbox usage costs

Changed on

Returns priced usage per sandbox or snapshot and UTC hour in the half-open requested interval. LCU uses the recorded compute amount for sandboxes; snapshots have zero LCU. LSU allocates the recorded workspace storage amount proportionally to attributed bytes, including checkpoints on their sandbox and snapshots as separate resources. Resource filters preserve each resource's share. Rate changes do not reprice recorded amounts. An access-filtered page can have no items and a non-null next_cursor; continue until next_cursor is null.

get/api/v2/sandboxes/usage/costs

Request

  • Base URL
    https://api.smith.langchain.com
  • URL
    https://api.smith.langchain.com/api/v2/sandboxes/usage/costs
  • Auth
    • API key in header X-API-Key and API key in header X-Tenant-Id
    • or HTTP bearer and API key in header X-Tenant-Id

Query parameters

start_timestring date-time required

Inclusive RFC3339 start time

end_timestring date-time required

Exclusive RFC3339 end time; the range must not exceed 31 days

resource_type'SANDBOX' | 'SNAPSHOT'

Resource type filter

resource_idsstring[]

Resource UUID filter; repeat this parameter up to 100 times

page_sizeinteger

Maximum rows to return

granularity'HOUR' | 'RESOURCE'

HOUR returns hourly buckets. RESOURCE sums each resource over the requested interval and sets period_start to start_time.

cursorstring

Opaque pagination cursor

include_totalsboolean

Include usage totals across the filtered interval (RESOURCE only). Omitted when unrestricted resource access cannot be verified or the service does not support totals.

Response

OK

next_cursorstring nullable required

Example response

{
  "items": [
    {
      "lcu": "1.234567",
      "lsu": "0.000123"
    }
  ]
}

Changes

    • info

      added the optional property // to the response with the status

    • info

      added the optional property // to the response with the status

    • info

      added the optional property ///// to the response with the status

    • info

      added the optional property ///// to the response with the status

    • info

      endpoint added