# Get the current key

> Get the name, spend and remaining credit limit of the key you call with. Handy for checking a key works.

`GET https://api.openrobotics.dev/v1/key`

## Authorization

`Authorization: Bearer sk-orb-v1-…`, your [API key](https://www.openrobotics.dev/docs/authentication), or a free [test key](https://www.openrobotics.dev/docs/authentication#test-keys) (`sk-orb-test-…`; no account? get one with [`POST /sandbox/keys`](https://www.openrobotics.dev/docs/api/create-sandbox-key)).

## Response

- `data` (object): The key.
  - `label` (string): A shortened form of the key, safe to show, e.g. `sk-orb-v1-1a2...f9c`.
  - `name` (string): The name you gave it.
  - `usage` (number): What it has spent, in US dollars.
  - `limit` (number | null): Its credit limit in US dollars, or `null` for none.
  - `limit_remaining` (number | null): What it can still spend under that limit, or `null` for no limit.
  - `is_free_tier` (boolean): Always `true`; kept for OpenRouter compatibility.
  - `sandbox` (boolean): `true` for a [sandbox key](https://www.openrobotics.dev/docs/authentication#test-keys) (`sk-orb-test-…`): simulated output, never billed.
  - `expires_at` (integer | null): When the key stops working, in Unix seconds: set only for a [sandbox key made without an account](https://www.openrobotics.dev/docs/api/create-sandbox-key), `null` otherwise.

## Errors

Plus the errors every endpoint shares: see [Errors](https://www.openrobotics.dev/docs/errors).

## Example request

cURL:

```bash
curl https://api.openrobotics.dev/v1/key \
  -H "Authorization: Bearer $OPENROBOTICS_API_KEY"
```

Python:

```python
import os, requests

res = requests.get(
    "https://api.openrobotics.dev/v1/key",
    headers={"Authorization": f"Bearer {os.environ['OPENROBOTICS_API_KEY']}"},
)
print(res.json()["data"])
```

TypeScript:

```typescript
const res = await fetch("https://api.openrobotics.dev/v1/key", {
  headers: { Authorization: `Bearer ${process.env.OPENROBOTICS_API_KEY}` },
});
const { data } = await res.json();
```

## Example response

```json
{
  "data": {
    "label": "sk-orb-v1-1a2...f9c",
    "name": "Lab arm",
    "usage": 1.84,
    "limit": 25,
    "limit_remaining": 23.16,
    "is_free_tier": true,
    "sandbox": false,
    "expires_at": null
  }
}
```
