# 현재 키 정보

키가 읽을 수 있는 토픽, 한도, IP 허용 목록을 확인합니다.

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

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

`topics`는 실제 적용되는 토픽으로, 키에 설정한 범위와 플랜이 여는 소스의 교집합입니다. 연동 전에 한 번 호출해 범위를 확인하세요.

**API 키 필요**

## 파라미터

파라미터가 없습니다.

## 요청 예시

**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))
}
```

## 응답 예시

```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
}
```

## 오류

| 코드 | HTTP | 설명 |
|---|---|---|
| `missing_api_key` | 401 | 키가 없습니다. `Authorization: Bearer <키>`를 쓰세요. |
| `invalid_api_key` | 401 | 키가 없거나 재설정 또는 폐기되었습니다. |
| `key_expired` | 401 | 체험 키가 만료되었습니다. 새 체험 키를 신청하거나 구독 후 정식 키를 만드세요. |
| `plan_required` | 403 | 현재 플랜에 개발자 API(또는 해당 기능)가 없습니다. |
| `ip_not_allowed` | 403 | 키에 IP 허용 목록이 설정되어 있고 요청 IP가 목록에 없습니다. |
| `rate_limited` | 429 | 이 키의 요청 빈도를 넘었습니다(REST와 MCP 합산, 간격은 `/v1/me`의 `limits.rest_interval_seconds`). Retry-After 초만큼 기다린 뒤 다시 시도하세요. |
