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

# Inference API Token

> Issue a new inference token from a model's page for direct API usage.

Every deployed model has its own **API Keys** tab where you generate a key scoped to that model, then call its endpoint directly, from `curl`, your own backend, or any OpenAI-compatible client.

<Info>
  This works on any deployed model, a router like `benchgen-router-lite`, a model you uploaded, or one you fine-tuned in Train. If you don't have a deployed model yet, see [Deploy an Inference Model](/docs/eval/run-an-inference-model).
</Info>

***

## Step 1: Open your model

In **Models**, find the model you want a key for, it needs to be **Deployed** or **Running** to serve an endpoint. Here, [`benchgen-router-lite`](https://benchgen.com/models/benchgen/benchgen-router-lite) is running.

<Frame caption="AI Models: a running router (benchgen-router-lite) and deployed models beneath it">
  <img src="https://mintcdn.com/benchgen-8fc81371/DpsTe90KZwkCVWAv/images/inference/api-token/01-models-list.png?fit=max&auto=format&n=DpsTe90KZwkCVWAv&q=85&s=127a3b95f857161b2c1cdc89315222c9" alt="The AI Models page listing benchgen-router-lite under Running, and deployed models such as CRM Agent and Finance Agent below it" width="1478" height="941" data-path="images/inference/api-token/01-models-list.png" />
</Frame>

Open it. Its card has four tabs: **Model Card**, **Usage**, **API Keys**, and **Evaluations**. Notice the sidebar on the right already carries an **API key** field with a **Generate key** shortcut, that same control is there no matter which tab you're on.

<Frame caption="The Model Card tab, with the same Generate key shortcut already sitting in the sidebar">
  <img src="https://mintcdn.com/benchgen-8fc81371/DpsTe90KZwkCVWAv/images/inference/api-token/02-model-card-tabs.png?fit=max&auto=format&n=DpsTe90KZwkCVWAv&q=85&s=cdb04fc80aaea89239fec1d42e9e1243" alt="A model card's Model Card tab, showing tab navigation for Model Card, Usage, API Keys, and Evaluations, and an API key field with a Generate key button in the sidebar" width="1478" height="941" data-path="images/inference/api-token/02-model-card-tabs.png" />
</Frame>

## Step 2: The quick way, or the full API Keys tab

Click that sidebar **Generate key** button any time you just need a key fast. For naming keys or seeing everything you've already issued, click the **API Keys** tab instead, it's the same action dialog either way, just with more around it.

<Frame caption="The API Keys tab: endpoint, key name field, Generate key, and a table of existing keys">
  <img src="https://mintcdn.com/benchgen-8fc81371/DpsTe90KZwkCVWAv/images/inference/api-token/03-api-keys-tab.png?fit=max&auto=format&n=DpsTe90KZwkCVWAv&q=85&s=6b53e4f3ab1a5c61438aeb2014d0c395" alt="The API Keys tab showing the endpoint URL with a Copy button, a Key name input, a Generate key button, and a table of four active keys with their creation date, last used, spend, and a Revoke button" width="1478" height="941" data-path="images/inference/api-token/03-api-keys-tab.png" />
</Frame>

Optionally name the key (useful if you're issuing separate keys per app or environment), then click **+ Generate key**.

## Step 3: Copy the key now, it won't be shown again

A dialog shows your new **secret key** plus a ready-to-run example request.

<Frame caption="The new API key dialog: the secret key, a Copy button, and an example curl request using it">
  <img src="https://mintcdn.com/benchgen-8fc81371/DpsTe90KZwkCVWAv/images/inference/api-token/04-new-api-key-modal.png?fit=max&auto=format&n=DpsTe90KZwkCVWAv&q=85&s=79a09ff2b92468c1f6ef7a87d328519b" alt="A dialog titled Your new API key, warning that only a hash is stored so the key cannot be recovered later, with the secret key, a Copy button, and an example curl request against the chat completions endpoint" width="1478" height="941" data-path="images/inference/api-token/04-new-api-key-modal.png" />
</Frame>

<Warning>
  **Copy it now.** BenchGen stores only a hash of the key, so if you close this dialog without saving it, you can't recover it, you'd have to generate a new one. If a key is ever exposed, revoke it and generate a replacement.
</Warning>

Click **Copy** to grab just the key, or copy the example request as-is:

```bash theme={null}
curl https://gateway.benchgen.com/v1/chat/completions \
  -H "Authorization: Bearer sk-..." \
  -H "Content-Type: application/json" \
  -d '{"model":"benchgen-router-lite","messages":[{"role":"user","content":"hi"}]}'
```

Click **I have saved it** to dismiss the dialog.

## Managing keys afterward

Your new key appears in the table on the API Keys tab, **Active**, with its creation date, last-used timestamp, and running spend. Click **Revoke** on any key you no longer want live, it flips to a **Revoked** status immediately and stops authenticating.

<Frame caption="A revoked key: status changes to Revoked and its Revoke button disappears">
  <img src="https://mintcdn.com/benchgen-8fc81371/DpsTe90KZwkCVWAv/images/inference/api-token/05-revoked-key.png?fit=max&auto=format&n=DpsTe90KZwkCVWAv&q=85&s=4859083376162652d6c2ff5892d8551e" alt="The same keys table with one key now showing a Revoked badge instead of Active and a Revoke button" width="1478" height="941" data-path="images/inference/api-token/05-revoked-key.png" />
</Frame>

***

## Watching it get used

Every call made with the key rolls up into the model's **Usage** tab: total requests, tokens, spend, and average latency, plus a log of every individual request.

<Frame caption="The Usage tab after two calls: requests, tokens, spend, and latency, with each call logged below">
  <img src="https://mintcdn.com/benchgen-8fc81371/DpsTe90KZwkCVWAv/images/inference/api-token/07-usage-overview.png?fit=max&auto=format&n=DpsTe90KZwkCVWAv&q=85&s=17151234c741dc014ba851304fd13221" alt="The Usage tab showing 2 requests, 175 tokens, $0.001526 spend, 4066 ms average latency, and a Requests table with two successful calls" width="1478" height="941" data-path="images/inference/api-token/07-usage-overview.png" />
</Frame>

Click any row to see that exact call in full: its tags, request details, token and cost metrics, and the actual prompt and response.

<Frame caption="One request opened: tags, request details, metrics, and cost so far, with the full prompt and response below">
  <img src="https://mintcdn.com/benchgen-8fc81371/DpsTe90KZwkCVWAv/images/inference/api-token/08-request-detail.png?fit=max&auto=format&n=DpsTe90KZwkCVWAv&q=85&s=4d8de9163019d68bc69785efea160b56" alt="A request detail drawer showing owner and source tags, request details including model and provider, token and cost metrics, and the start of the request and response payload" width="1478" height="941" data-path="images/inference/api-token/08-request-detail.png" />
</Frame>

See [Monitor Model Usage](/docs/eval/monitor-model-usage) for the full breakdown of everything on this tab.

***

## Next Steps

<CardGroup cols={2}>
  <Card title="Monitor Model Usage" icon="chart-column" href="/docs/eval/monitor-model-usage">
    Track requests, tokens, spend, and inspect individual calls made with your key.
  </Card>

  <Card title="BenchGen Router Lite" icon="shuffle" href="/docs/inference/benchgen-router-lite">
    Point your key at the router endpoint instead of a single model.
  </Card>

  <Card title="benchgen-router-lite model page" icon="microchip" href="https://benchgen.com/models/benchgen/benchgen-router-lite" cta="View on BenchGen" arrow>
    Open the model card these screenshots were taken from.
  </Card>
</CardGroup>
