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

# Pricing API quickstart

> Find model prices and calculate request costs with three public REST requests. No account or API key required.

You need `curl` and network access to `https://api.narev.ai`. These requests are free and require no authentication. They do not execute inference.

## Find a model

Search the pricing catalog for a model:

```bash theme={null}
curl --fail-with-body -G 'https://api.narev.ai/v1/prices/search' \
  --data-urlencode 'q=gpt-4o'
```

Read the returned `model_id` and `provider_id`. The same model can have different prices across providers.

## Retrieve provider prices

Use the identifiers from your search to select a price row:

```bash theme={null}
curl --fail-with-body -G 'https://api.narev.ai/v1/prices' \
  --data-urlencode 'provider_id=openai' \
  --data-urlencode 'model_id=gpt-4o'
```

Token rates in `pricing` are USD per token. Multiply a token rate by 1,000,000 to display a price per million tokens. Rates can change; use the returned values rather than copying a fixed example total.

## Calculate request cost

Supply estimated or recorded token counts:

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

Read `cost_breakdown.total` for the calculated USD cost. For workloads with caching, reasoning, or other billable dimensions, supply the applicable usage fields from the [cost reference](https://www.narev.ai/docs/pricing-api/reference/v1/traces/cost.md). A failed lookup is not a zero-cost request.

## Next steps

* [Connect an MCP client](https://www.narev.ai/docs/pricing-api/mcp.md) to query pricing from your agent.
* [Read the API reference](https://www.narev.ai/docs/pricing-api/reference/overview.md) for filters, pagination, and response fields.
* [Track usage with AI-billing](https://www.narev.ai/docs/ai-billing/quickstart.md) inside your application.


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