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

# Get API key info

> Get the scopes, expiry date, limits, creator and creation date of the API key you are using. Works with a key of any scope.

This route takes no parameters. Use it to check that a key has the [scope](https://docs.weflayr.com/product/api-keys.md#scopes) a task needs before using it.

```python Python theme={null}
import weflayr

client = weflayr.client()  # reads WEFLAYR_API_KEY

client.get_api_key_info()
```

```js Node.js theme={null}
const weflayr = require('weflayr');

const client = weflayr.client(); // reads WEFLAYR_API_KEY

await weflayr.api.getApiKeyInfo({
  client,
  throwOnError: true,
});
```

```bash cURL theme={null}
curl "https://app.weflayr.com/api/api-key/" \
  -H "Authorization: Bearer $WEFLAYR_API_KEY"
```

```json 200 theme={null}
{
  "name": "Coding agent",
  "scopes": ["gateway", "management"],
  "expires_at": "2027-02-03T09:30:00.123456+00:00",
  "rate_limit_requests_per_minute": 600,
  "spend_limits": [{"amount_usd": 100.0, "every": 1, "unit": "day"}],
  "created_by_user_email": "jane@acme.com",
  "created_at": "2026-11-05T09:30:00.123456+00:00"
}
```

| Field | Description |
| - | - |
| `scopes` | `gateway`, `management`, or both |
| `expires_at` | When the key stops working, `null` if it never expires |
| `rate_limit_requests_per_minute` | Cap on the key's gateway calls, `null` if none |
| `spend_limits` | Caps on the key's gateway spend: at most `amount_usd` every `every` `unit`s (`hour`, `day` or `month`) |
| `created_by_user_email` | Who created the key, `null` if unknown |


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