> ## Documentation Index
> Fetch the complete documentation index at: https://docs.stateset.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Get Usage By Tool V1

> Tool-level work breakdown across the tenant's jobs. Joins ToolExecution → Job to scope by tenant…

<Warning>
  **Confirm your deployment before running this request.** This page describes an API contract;
  a published reference does not establish hosted availability. Check the dated
  [host report](/api-reference/hosts) and obtain your deployment URL and credentials.
  Replace the example host if your provisioned service uses a different URL.
</Warning>

Tool-level work breakdown across the tenant's jobs.

Joins ToolExecution → Job to scope by tenant; aggregates call count,
total + average duration, and a heuristic error count per tool name.
Useful for spotting whether a slow rollout is 'computer is slow' vs.
'we issue 10x as many bash calls as we used to.'

### Response

`UsageByToolResponse`

<ResponseField name="rows" type="UsageByToolRow[]" required>
  Sorted by total\_duration\_ms descending — heaviest tool first.

  <Expandable title="UsageByToolRow">
    <ResponseField name="tool_name" type="string" required>
      Tool identifier (bash, computer, browser, ...).
    </ResponseField>

    <ResponseField name="calls" type="integer" required>
      Total invocations across all jobs.
    </ResponseField>

    <ResponseField name="total_duration_ms" type="integer" required>
      Sum of duration\_ms across calls.
    </ResponseField>

    <ResponseField name="avg_duration_ms" type="number" required>
      Mean duration per call.
    </ResponseField>

    <ResponseField name="error_calls" type="integer" required>
      Count of calls whose tool\_output starts with an 'error' marker — best-effort heuristic, not a strict success/fail classification.
    </ResponseField>
  </Expandable>
</ResponseField>

<ResponseField name="total_calls" type="integer" required />

### Status codes

| Code | Meaning |
| - | - |
| `200` | Successful Response |

### Using this contract

Read the [source OpenAPI document](/spec/computer-use.json) for declared schemas and alternatives.
This page also includes documented corrections from the [spec overlays](https://github.com/stateset/docs/tree/main/spec/overlays).
Example IDs and values are illustrative; replace them with records from your workspace.

<RequestExample>
  ```bash cURL theme={null}
  curl --silent --show-error --fail-with-body --request GET \
    --url 'https://api.computer.stateset.app/api/v1/usage/by-tool' \
    --header "X-API-Key: $STATESET_COMPUTER_USE_API_KEY"
  ```
</RequestExample>

<ResponseExample>
  ```json 200 theme={null}
  {
    "rows": [
      {
        "tool_name": "string",
        "calls": 1,
        "total_duration_ms": 8,
        "avg_duration_ms": 7.5,
        "error_calls": 1
      }
    ],
    "total_calls": 1
  }
  ```
</ResponseExample>


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.