Skip to content

Get usage

GET/v1/usageNeeds an API key

Summarise your organization's calls over the last days UTC days, today included.

days is 7, 30 or 90. Calls made by every key of the organization count, and so do those made from the console.

Query parameters

daysinteger· default 30

How many UTC days to cover, today included.

7
30
90

Response

Your workspace's calls over the window. Your organization's calls over a window of days, with money as decimal strings in USD. Days are UTC calendar days. The window is today (UTC) and the days before it, so its last day is still filling; totals.previous covers the same number of whole days immediately before the window. A call counts on the day it was created. daily has one entry per day of the window, oldest first, including days with no calls. by_tool and by_api_key list the most charged first, then the most called, and are capped.

totalsobject

The window's totals.

totals.callsinteger

Calls made.

totals.succeededinteger

Calls that succeeded.

totals.failedinteger

Calls that failed.

totals.pendinginteger

Calls still running.

totals.charged_usdstring

What the calls cost you.

totals.previousobject

The same totals for the window of equal length just before this one.

totals.previous.callsinteger

Calls made.

totals.previous.succeededinteger

Calls that succeeded.

totals.previous.failedinteger

Calls that failed.

totals.previous.pendinginteger

Calls still running.

totals.previous.charged_usdstring

What the calls cost you.

dailyarray of object

One entry per day of the window, oldest first.

daily.datestring

The UTC day.

Format date.

daily.callsinteger

Calls made.

daily.succeededinteger

Calls that succeeded.

daily.failedinteger

Calls that failed.

daily.charged_usdstring

What the calls cost you.

by_toolarray of object

The window's calls by tool, most charged first.

by_tool.toolstring

The tool called.

by_tool.callsinteger

Calls made.

by_tool.succeededinteger

Calls that succeeded.

by_tool.failedinteger

Calls that failed.

by_tool.charged_usdstring

What the calls cost you.

by_api_keyarray of object

The window's calls by API key, most charged first.

by_api_key.api_keyobject· nullable

Null for calls made without a key, such as from the console's playground.

by_api_key.api_key.idstring

The API key's ID.

by_api_key.api_key.labelstring

The API key's label.

by_api_key.callsinteger

Calls made.

by_api_key.charged_usdstring

What the calls cost you.