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

# Get machine cost

> Read credit debits and metered cost evidence for one machine.

## Authentication

Send your scoped bearer token in the `Authorization: Bearer <BEAD_TOKEN>` header, or send your API key in `X-API-Key`.

## Parameters

**id** `string` *required*

Machine identifier returned by creation.

```bash cURL theme={"theme":{"light":"github-light","dark":"github-dark-default"}}
curl --request GET \
  --url "https://api.bead.run/sandboxes/$SANDBOX_ID/cost" \
  --header "X-API-Key: $BEAD_API_KEY"
```

```python Python theme={"theme":{"light":"github-light","dark":"github-dark-default"}}
# sandbox is returned by Sandbox.create or Sandbox.connect.
print(sandbox.cost())
```

```typescript TypeScript theme={"theme":{"light":"github-light","dark":"github-dark-default"}}
// sandbox is returned by Sandbox.create or Sandbox.connect.
console.log(await sandbox.cost());
```

## Response

### 200

Current credit and metering totals for this machine.

**credit\_units** `integer` *required*

Total credit units debited for the machine and its starts.

**credit\_units\_per\_usd** `integer` *required*

Number of credit units in one USD.

**start\_credit\_units** `integer` *required*

Credit units debited for machine start admission.

**priced\_intervals** `integer` *required*

Usage intervals with a price.

**observed\_intervals** `integer` *required*

Observed usage intervals.

**uncertain\_intervals** `integer` *required*

Usage intervals with uncertain measurements.

**price\_version** `string` *required*

Tariff version used for this cost view.

**metered\_cost\_numerator** `string` *required*

Exact metered charge numerator.

**metered\_cost\_denominator** `string` *required*

Exact metered charge denominator.

**metered\_cost** `object` *required*

Exact charge with a decimal USD display value.

**Properties**

**usd** `string` *required*

USD amount rendered to twelve decimal places.

**numerator** `string` *required*

Exact charge numerator in credit units; encoded as a string to preserve precision.

**denominator** `string` *required*

Denominator for the exact charge numerator, before conversion to USD.

**partial** `boolean` *required*

True when usage is absent, unpriced, or uncertain.

## Errors

| Status | Meaning |
| - | - |
| 401 | Authentication credential is missing or rejected. |
| 403 | The credential lacks the required scope. |
| 404 | The requested resource does not exist or is outside your organization. |
| 429 | Request or resource admission limit exceeded (`admission_limit`). Follow limit.next\_action and Retry-After when present. |
| 503 | Service or persistence is temporarily unavailable. |


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