> ## 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 Job Cost Breakdown V1

> Per-job cost breakdown with priced input/output token lines. Useful when callers see an unexpectedly high cost_usd and want to know whether output tokens or…

Per-job cost breakdown with priced input/output token lines.

Useful when callers see an unexpectedly high `cost_usd` and want to
know whether output tokens or input tokens drove it. Pricing comes
from the worker's canonical rate table; jobs that ran without a
pinned model show prices at the deployment-default rate.

### Path parameters

<ParamField path="job_id" type="string (uuid)" required />

### Response

`CostBreakdownResponse`

<ResponseField name="job_id" type="string" required />

<ResponseField name="model" type="string,null" required>
  Canonical model id used to price the job. None if the job ran on the deployment default and no per-job model was pinned.
</ResponseField>

<ResponseField name="lines" type="CostBreakdownLine[]" required>
  <Expandable title="CostBreakdownLine">
    <ResponseField name="label" type="string" required>
      What was billed (e.g. 'input tokens', 'output tokens').
    </ResponseField>

    <ResponseField name="quantity" type="integer" required>
      Token count.
    </ResponseField>

    <ResponseField name="rate_per_token" type="number" required>
      USD per token.
    </ResponseField>

    <ResponseField name="cost_usd" type="number" required>
      quantity × rate\_per\_token, USD.
    </ResponseField>
  </Expandable>
</ResponseField>

<ResponseField name="total_cost_usd" type="number" required>
  Sum across lines. May not equal `Job.cost_usd` exactly if the deployment-default pricing differed from the canonical rate table; the response reflects what the priced lines compute to.
</ResponseField>

### Status codes

| Code  | Meaning             |
| ----- | ------------------- |
| `200` | Successful Response |
| `422` | Validation Error    |

<RequestExample>
  ```bash cURL theme={null}
  curl --request GET \
    --url 'https://api.computer.stateset.app/api/v1/jobs/{job_id}/cost-breakdown' \
    --header 'X-API-Key: YOUR_API_KEY'
  ```
</RequestExample>

<ResponseExample>
  ```json 200 theme={null}
  {
    "job_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
    "model": "string",
    "lines": [
      {
        "label": "Replacement tent pole set",
        "quantity": 2,
        "rate_per_token": 7.5,
        "cost_usd": 1.5
      }
    ],
    "total_cost_usd": 1.5
  }
  ```
</ResponseExample>
