# Nothing in the dashboard (/docs/troubleshooting/nothing-in-dashboard)



Your app runs, the LLM calls work — but the dashboard stays empty. Because TokenPolice is
[fail-open](/docs/concepts/fail-open), a wiring problem never crashes your app: it just goes
quiet. So the fix is almost always one of a short list. Work down it in order.

<Steps>
  <Step>
    **Is `init` the very first thing your app does?**

    `tp.init(...)` must run **before** you import or construct any LLM client. In Python this usually
    just works; in native ESM (Next.js, Vite, Bun) an import resolved before `init` is silently left
    un-instrumented. If you're on ESM, this is almost certainly it — see
    [ESM / instrumentation order](/docs/troubleshooting/esm-instrumentation-order).
  </Step>

  <Step>
    **Is the collector URL right?**

    `base_url` must be your collector, `https://collect.tokenpolice.ai`, unless you self-host:

    ```python
    import token_police as tp

    tp.init(
        api_key=os.environ["TOKENPOLICE_API_KEY"],
        base_url="https://collect.tokenpolice.ai",
    )
    ```

    ```typescript
    import { init } from "token-police";

    init({
      apiKey: process.env.TOKENPOLICE_API_KEY!,
      baseUrl: "https://collect.tokenpolice.ai",
    });
    ```
  </Step>

  <Step>
    **Is the API key present and spelled right?**

    The key looks like `tp_sk_…` and lives in the `TOKENPOLICE_API_KEY` env var — one word, no
    underscore between `TOKEN` and `POLICE`. A missing or malformed key is swallowed silently by
    design. Grab a fresh one from the [API Keys page](/docs/dashboard/api-keys) if unsure.
  </Step>

  <Step>
    **Does the process live long enough to send?**

    Usage ships in the background, after your call returns. A script or serverless function that
    exits immediately can freeze before anything is sent. If that's you, drain first — see
    [Serverless flush](/docs/troubleshooting/serverless-flush).
  </Step>

  <Step>
    **Is the client actually supported?**

    Most providers are metered on the base install, but an unusual or gateway-wrapped client may need
    a manual wrap. See [`protect()`](/docs/sdk/protect) and the
    [support matrix](/docs/integrations/matrix).
  </Step>
</Steps>

## Still nothing? [#still-nothing]

Turn on error logging and watch stderr — TokenPolice will print what it swallowed:

```python
tp.init(
    api_key=os.environ["TOKENPOLICE_API_KEY"],
    base_url="https://collect.tokenpolice.ai",
    log_errors=True,      # off by default
)
```

```typescript
init({
  apiKey: process.env.TOKENPOLICE_API_KEY!,
  baseUrl: "https://collect.tokenpolice.ai",
  logErrors: true,        // off by default
});
```

## Only one provider missing? [#only-one-provider-missing]

If everything else meters but a single provider goes quiet, check the boot log.

<Steps>
  <Step>
    **Node + `openai` 7 or newer.** If auto-discovery prints that the installed version is *not yet
    supported*, chat-completion calls are recorded with **0 input / 0 output tokens** — so budgets
    never accumulate, even though the calls run and are still checked against your rules. The fix is
    not to downgrade: pass the module to `init()`.

    ```typescript
    import OpenAI from "openai";

    init({ /* … */ instrumentModules: { openAI: OpenAI } });
    ```

    That patches the module directly and meters chat completions normally. Responses-API, image,
    audio and embedding calls were never affected. See [Node & ESM](/docs/sdk/node-esm).
  </Step>

  <Step>
    **Any other provider.** The same warning on another library means TokenPolice can't tap the
    installed version. Check [Supported versions](/docs/sdk/supported-versions), and pass the module
    via `instrumentModules` if it's a Node app.
  </Step>
</Steps>

If the warning instead says instrumentation *stopped after re-initialization*, the process called
[`uninstrument()`](/docs/sdk/uninstrument) and then `init()` again — restart the process and call
`init()` once per process.

## Next [#next]

<Cards>
  <Card title="ESM / instrumentation order" href="/docs/troubleshooting/esm-instrumentation-order" description="The most common cause on Next.js, Vite, and Bun." />

  <Card title="Serverless flush" href="/docs/troubleshooting/serverless-flush" description="Short-lived processes must drain before they exit." />
</Cards>
