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

# Usage import

> Send spend Navige did not proxy, so the picture is whole.

Some model calls never go through the proxy: a batch job on a different network, a vendor product that bills you for AI you cannot intercept, or a team that has not migrated yet. Report them here and they appear alongside everything else.

`POST /usage`

> [!NOTE]
>
> This endpoint records usage; it does not decide anything. The call has already happened, so the kill switch, budgets and policies do not run on this path.

## Request

| Field | Type | What it does |
| - | - | - |
| `model` (required) | `string` | The model id as the provider spells it, such as `claude-sonnet-5-5`. |
| `provider` | `string` | Who served it. Helps resolve a price where the same model id exists at more than one host and more than one rate. |
| `inputTokens` | `number` | Prompt tokens. |
| `outputTokens` | `number` | Completion tokens. |
| `costUsd` | `number` | What it actually cost, if you know. Takes precedence over anything we would compute. Zero or more. |
| `occurredAt` | `string` | ISO 8601. Defaults to now; set it when backfilling, or the whole import lands in today. A time with no offset is read as UTC. |

Send `costUsd`, or at least one of `inputTokens` and `outputTokens`. A report with none of them is refused with a `400`. A field sent as `null` is treated as not sent. Every spend figure in the console includes these reports, so a report that would corrupt them is refused with a `400` and not stored:

* a negative, non-numeric or impossibly large `costUsd`;
* token counts that are negative, fractional, or too large to store;
* an `occurredAt` that is not ISO 8601, is not a real date or time (30 February, 24:30), is before 2000, or is in the future (a few minutes of clock difference is allowed);
* a `model` that is not text of at most 200 characters, or a `provider` that is not text of at most 100.

A report more than 35 days old is recorded and marked, and the response carries a `warning`: the report may fall in a month, budget or bill that is already closed, and will not change it.

```bash bash theme={null}
curl -X POST https://api.navige.ai/usage \
  -H "x-navige-key: $NAVIGE_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "claude-sonnet-5-5",
    "provider": "anthropic",
    "inputTokens": 18400,
    "outputTokens": 2100,
    "occurredAt": "2026-10-13T22:05:00Z"
  }'
```

```powershell Windows PowerShell theme={null}
$body = @'
{
    "model": "claude-sonnet-5-5",
    "provider": "anthropic",
    "inputTokens": 18400,
    "outputTokens": 2100,
    "occurredAt": "2026-10-13T22:05:00Z"
  }
'@
Invoke-RestMethod -Method Post -Uri https://api.navige.ai/usage `
  -Headers @{ "x-navige-key" = $env:NAVIGE_KEY } `
  -ContentType "application/json" -Body $body
```

## Response

A stored report answers `201`:

```json theme={null}
{ "id": "01937c50-…", "costUsd": 0.0578, "costSource": "computed" }
```

`costSource` says where the cost came from:

* `reported`: you sent `costUsd` and we used it.
* `computed`: we priced your token counts at that model's rate, using your organisation's declared price where you set one (the same price your proxied calls use) and otherwise the catalogue's.
* `unknown`: we have no price for that model and did not invent one. The event is recorded with a null cost, which the console shows as unpriced, with a note that real spend is higher, never as `$0.00`.

If you are seeing `unknown` for a model you care about, tell us the id and we will add the price.

## Token semantics

> [!WARNING]
>
> Providers do not agree on what input tokens means. Anthropic's `input_tokens` *excludes* cached tokens; OpenAI's and Gemini's *include* them. If you are computing `inputTokens` yourself from a provider's response, check which convention you are reading before you send it, or the same traffic will price differently depending on where it came from.


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