# Current key

See which topics the key can read, its limits and IP allowlist.

> Source: https://tokenearly.com/en/developers/rest/me · Docs index: https://tokenearly.com/en/developers/llms.txt · OpenAPI: https://api.tokenearly.com/v1/openapi.json

`GET https://api.tokenearly.com/v1/me`

`topics` is the effective set: the key's own scope intersected with the sources your plan includes. Call it once before going live to confirm the scope.

**Requires an API key**

## Parameters

No parameters.

## Example request

**cURL**

```bash
curl "https://api.tokenearly.com/v1/me" \
  -H "Authorization: Bearer $TOKENEARLY_API_KEY"
```

**Python**

```python
import os, requests

resp = requests.get(
    "https://api.tokenearly.com/v1/me",
    headers={"Authorization": f"Bearer {os.environ['TOKENEARLY_API_KEY']}"},
    timeout=10,
)
resp.raise_for_status()
print(resp.json())
```

**Node.js**

```javascript
// Node 18+ (built-in fetch)
async function main() {
  const resp = await fetch("https://api.tokenearly.com/v1/me", {
    headers: { Authorization: `Bearer ${process.env.TOKENEARLY_API_KEY}` },
  });
  const body = await resp.json();
  if (!resp.ok) throw new Error(`${body.error.code}: ${body.error.message}`);
  console.log(body);
}

main().catch((err) => {
  console.error(err);
  process.exit(1);
});
```

**Go**

```go
package main

import (
	"fmt"
	"io"
	"net/http"
	"os"
)

func main() {
	req, _ := http.NewRequest("GET", "https://api.tokenearly.com/v1/me", nil)
	req.Header.Set("Authorization", "Bearer "+os.Getenv("TOKENEARLY_API_KEY"))
	resp, err := http.DefaultClient.Do(req)
	if err != nil {
		panic(err)
	}
	defer resp.Body.Close()
	body, _ := io.ReadAll(resp.Body)
	fmt.Println(resp.Status, string(body))
}
```

## Example response

```json
{
  "key": {
    "id": "key_3f9c2a71d0b84e6c5a12",
    "name": "prod-bot",
    "prefix": "te_live_Ab12",
    "topics": [
      "*"
    ],
    "allowed_ips": [
      "203.0.113.5"
    ],
    "kind": "standard",
    "status": "active",
    "created_at": 1794100000,
    "last_used_at": 1794200000,
    "expires_at": null
  },
  "limits": {
    "api_keys": 1,
    "streams_per_key": 1,
    "rest_interval_seconds": 3,
    "api_history_days": 30
  },
  "topics": [
    "announcement.binance",
    "announcement.okx",
    "announcement.mexc"
  ],
  "trial": false,
  "expires_at": null,
  "access_expires_at": 1796800000
}
```

## Errors

| Code | HTTP | Description |
|---|---|---|
| `missing_api_key` | 401 | No key sent. Use `Authorization: Bearer <key>`. |
| `invalid_api_key` | 401 | The key does not exist, or it was reset or revoked. |
| `key_expired` | 401 | The trial key has expired. Apply for a new trial key, or subscribe and create a regular key. |
| `plan_required` | 403 | Your plan does not include the developer API, or this part of it. |
| `ip_not_allowed` | 403 | The key has an IP allowlist and the request came from an address outside it. |
| `rate_limited` | 429 | Over this key's request rate (REST and MCP combined; the interval is `limits.rest_interval_seconds` in `/v1/me`); wait `Retry-After` seconds and retry. |
