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

# Calculate the cost of one LLM request

> Send prompt and completion token counts to POST /v1/traces/cost and read cost_breakdown.total in USD.

Price one request when you know the model, provider, and token counts. The Pricing API returns a dollar total. No SDK required.

## Request body

```bash theme={null}
curl -X POST 'https://api.narev.ai/v1/traces/cost' \
  -H 'Content-Type: application/json' \
  -d '{
    "model_id": "gpt-4o",
    "provider_id": "openai",
    "usage": {
      "prompt_tokens": 1200,
      "completion_tokens": 340
    }
  }'
```

## Response

```json theme={null}
{
  "model_id": "gpt-4o",
  "provider_id": "openai",
  "cost_breakdown": {
    "total": 0.0064
  }
}
```

Read `cost_breakdown.total` as USD for that single call.

## Optional usage fields

Include cache and reasoning token counts when your workload uses them:

```json theme={null}
"usage": {
  "prompt_tokens": 1200,
  "completion_tokens": 340,
  "cache_read_tokens": 0,
  "cache_write_tokens": 0,
  "reasoning_tokens": 0
}
```

## Compare models fairly

Reuse the same `usage` object across models. That isolates rate differences from prompt or output length changes. See [Compare cost between two models](/docs/guides/compare-two-models).

## API reference

* [`POST /v1/traces/cost`](/docs/platform/api-reference/v1/traces/cost)
