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

# Costs

> Query and manage cost allocation

## Get Costs

<ParamField path="GET" type="string" required>
  /v1/costs
</ParamField>

Query costs with filters.

### Query Parameters

<ParamField query="agent_id" type="string">
  Filter by agent ID
</ParamField>

<ParamField query="customer_id" type="string">
  Filter by customer ID
</ParamField>

<ParamField query="start_date" type="string">
  Start date (ISO 8601)
</ParamField>

<ParamField query="end_date" type="string">
  End date (ISO 8601)
</ParamField>

<ResponseField name="costs" type="array">
  List of costs
</ResponseField>

<ResponseField name="total" type="number">
  Total cost amount
</ResponseField>

<RequestExample>
  ```bash theme={null}
  curl -X GET "https://api.valmi.io/v1/costs?agent_id=agent_abc123&start_date=2024-01-01&end_date=2024-01-31" \
    -H "Authorization: Bearer sk_api_abc123xyz"
  ```
</RequestExample>

<ResponseExample>
  ```json theme={null}
  {
    "costs": [
      {
        "id": "cost_xyz789",
        "agent_id": "agent_abc123",
        "cost_type": "llm",
        "amount": 100.50,
        "currency": "USD",
        "period": "2024-01"
      }
    ],
    "total": 100.50
  }
  ```
</ResponseExample>
