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

# Costs resource

> Reference for client.costs.

Access these methods through `client.costs`.

## `client.costs.by_project`

List spend per month, vendor and project for costs that ended in the `[start, end)` window.

A date is a UTC day, and a datetime must carry a timezone. `runs` lists every run alive during the window or holding a cost in it, with its project.

```python Signature theme={null}
async def by_project(
    start: date | datetime,
    end: date | datetime,
) -> CostsByProjectResponse
```

**Parameters**

startrequired · date | datetime

endrequired · date | datetime

**Returns**

[`CostsByProjectResponse`](https://docs.valkyrie.vals.ai/reference/sdk/models/costs#costs-by-project-response)

For examples, see the [Python SDK guide](https://docs.valkyrie.vals.ai/sdk/resources.md).

## `client.costs.project_model`

Return one project's model spend per UTC month for its runs placed in the `[start, end)` window.

A run counts in the month it finished, or started if it has not finished. `unattributed_usd` is the project key's all-time spend outside any run or on runs in no project, and `through` is when the usage data ends.

```python Signature theme={null}
async def project_model(
    project: str,
    start: date | datetime,
    end: date | datetime,
) -> ProjectModelCosts
```

**Parameters**

projectrequired · str

startrequired · date | datetime

endrequired · date | datetime

**Returns**

[`ProjectModelCosts`](https://docs.valkyrie.vals.ai/reference/sdk/models/costs#project-model-costs)

For examples, see the [Python SDK guide](https://docs.valkyrie.vals.ai/sdk/resources.md).

## `client.costs.run`

Return one run's spend in total, per cost type and per provider, resource and unit.

Model spend from the Gateway appears as the `model` cost type. When the Gateway is unavailable it is left out and `model_spend_available` is false.

```python Signature theme={null}
async def run(run_id: UUID | str) -> RunCosts
```

**Parameters**

run\_idrequired · UUID | str

**Returns**

RunCosts

For examples, see the [Python SDK guide](https://docs.valkyrie.vals.ai/sdk/resources.md).


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