> ## 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.

# Report usage

> Record a model call Navige did not carry, so its cost appears with the rest of your spend.

Send this after a model call that did not go through the proxy. Navige records it against the key's agent and prices it. It decides nothing: the kill switch, budgets and policies do not run on this path. [Usage import](https://docs.navige.ai/connect/usage.md) explains when to use it.

> [!NOTE]
>
> The key field is filled with a public demo key, so you can send a request without signing up. It reaches a shared demo workspace that resets every night, so do not send anything private. To call your own workspace, replace it with your key from Agents in the console.

## What to send

Send `costUsd`, or at least one of `inputTokens` and `outputTokens`. A field sent as `null` is treated as not sent.

## Status codes

`201` with the fields described below. A body Navige refuses gets `400` with `{ "error": "…" }` naming the problem, and nothing is stored. A key that is missing or not valid gets `401`, and an agent that is inactive or expired gets `403`.

```bash cURL 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-11-11T22:05:00Z"
  }'
```

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

```python Python theme={null}
import os, requests

r = requests.post(
    "https://api.navige.ai/usage",
    headers={"x-navige-key": os.environ["NAVIGE_KEY"]},
    json={
        "model": "claude-sonnet-5-5",
        "provider": "anthropic",
        "inputTokens": 18400,
        "outputTokens": 2100,
        "occurredAt": "2026-11-11T22:05:00Z",
    },
)
print(r.json())
```

```json Priced theme={null}
{ "id": "0193a1f2-6c4d-7e8f-9a0b-1c2d3e4f5a6b", "costUsd": 0.0578, "costSource": "computed" }
```

```json Cost you sent theme={null}
{ "id": "0193a1f2-6c4d-7e8f-9a0b-1c2d3e4f5a6c", "costUsd": 0.0612, "costSource": "reported" }
```

```json No price for the model theme={null}
{ "id": "0193a1f2-6c4d-7e8f-9a0b-1c2d3e4f5a6d", "costUsd": null, "costSource": "unknown" }
```

```json Late report theme={null}
{
  "id": "0193a1f2-6c4d-7e8f-9a0b-1c2d3e4f5a6e",
  "costUsd": 0.0578,
  "costSource": "computed",
  "warning": "occurredAt is more than 35 days ago; recorded, but a closed month, budget or bill will not change"
}
```

```json Refused theme={null}
{ "error": "provide either costUsd or inputTokens/outputTokens" }
```


## OpenAPI

````yaml POST /usage
openapi: 3.1.0
info:
  title: Navige API
  version: 1.0.0
  description: >-
    The gateway's public API: ask for a decision before an agent acts, report
    usage and outcomes, and read what a task usually costs.
servers:
  - url: https://api.navige.ai
security:
  - navigeKey: []
  - bearer: []
tags:
  - name: Decisions
    description: Ask before an agent acts, and read what applies to your calls.
  - name: Usage and tasks
    description: Report what happened, and read what a task costs.
paths:
  /usage:
    post:
      tags:
        - Usage and tasks
      summary: Report usage
      description: >-
        Record a model call that did not pass through Navige. Send `costUsd`, or
        at least one of `inputTokens` and `outputTokens`. A field sent as null
        is treated as not sent.
      operationId: reportUsage
      parameters:
        - schema:
            type: string
          in: header
          name: x-navige-client
          required: false
          description: >-
            Which app on a computer connected with `navige connect` is calling.
            The call lands on that app's own agent. You rarely send it by hand.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - model
              properties:
                model:
                  type: string
                  maxLength: 200
                  examples:
                    - claude-sonnet-5-5
                  description: >-
                    The model id as the provider spells it. Leading and trailing
                    spaces are removed, and an empty value is refused.
                provider:
                  type: string
                  maxLength: 100
                  examples:
                    - anthropic
                  description: >-
                    Who served the call. Used to find the price when the same
                    model id has more than one.
                inputTokens:
                  type: integer
                  minimum: 0
                  maximum: 2147483647
                  examples:
                    - 1200
                  description: Prompt tokens.
                outputTokens:
                  type: integer
                  minimum: 0
                  maximum: 2147483647
                  examples:
                    - 350
                  description: Completion tokens.
                costUsd:
                  type: number
                  minimum: 0
                  exclusiveMaximum: 1000000
                  description: >-
                    What the call cost, in US dollars, if you know it. Stored to
                    six decimal places. When you send it, Navige uses it and
                    does not price the tokens.
                occurredAt:
                  type: string
                  examples:
                    - '2026-11-11T22:05:00Z'
                  description: >-
                    When the call happened, in ISO 8601: a date, or a date and
                    time with an optional offset; no offset is read as UTC.
                    Defaults to now. Refused before the year 2000 or more than
                    five minutes in the future. More than 35 days ago is
                    recorded with a `warning`.
            example:
              model: claude-sonnet-5-5
              provider: anthropic
              inputTokens: 1200
              outputTokens: 350
      responses:
        '201':
          description: The usage event was recorded.
          content:
            application/json:
              schema:
                type: object
                required:
                  - id
                  - costUsd
                  - costSource
                additionalProperties: false
                properties:
                  id:
                    type: string
                    format: uuid
                    description: The recorded usage event.
                  costUsd:
                    type:
                      - number
                      - 'null'
                    description: >-
                      The cost recorded, in US dollars. null when Navige has no
                      price for the model: recorded as unpriced, not as free.
                  costSource:
                    type: string
                    enum:
                      - reported
                      - computed
                      - unknown
                    description: >-
                      `reported`: you sent `costUsd`. `computed`: Navige priced
                      the tokens. `unknown`: no price, and `costUsd` is null.
                  warning:
                    type: string
                    description: Present when `occurredAt` is more than 35 days ago.
        '400':
          description: The body was refused and nothing was stored.
          content:
            application/json:
              schema:
                type: object
                required:
                  - error
                additionalProperties: false
                properties:
                  error:
                    type: string
                    description: What was wrong, in words.
        '401':
          description: The key is missing (`missing`) or not valid (`invalid_key`).
          content:
            application/json:
              schema:
                type: object
                required:
                  - error
                additionalProperties: false
                properties:
                  error:
                    type: string
                    description: What was wrong, in words.
        '403':
          description: >-
            The key's agent is inactive (`agent_inactive`) or expired
            (`agent_expired`).
          content:
            application/json:
              schema:
                type: object
                required:
                  - error
                additionalProperties: false
                properties:
                  error:
                    type: string
                    description: What was wrong, in words.
components:
  securitySchemes:
    navigeKey:
      type: apiKey
      in: header
      name: x-navige-key
      description: >-
        Your agent's Navige key, from Agents in the console. The docs fill in a
        public demo key that reaches a shared demo workspace, reset every night;
        paste your own to call your workspace.
      x-default: nv_docs_demo_nuJM-1NFjNqDKAeGoZ5-QaAfFAdVXv79
    bearer:
      type: http
      scheme: bearer
      description: >-
        The same key as `Authorization: Bearer <key>`. Used only when
        `x-navige-key` is absent.

````

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