当前用户
返回当前 Key 的归属用户与 Key 信息,适合用来快速验证 Key 是否有效。
GEThttps://geo-api.geoeval.com/v1/me
需在 Authorization 请求头中传入 API Key。 前往下方在线调试
请求示例
curl "https://geo-api.geoeval.com/v1/me" \ -H "Authorization: Bearer $GEOEVAL_API_KEY"const response = await fetch(`https://geo-api.geoeval.com/v1/me`, { headers: { Authorization: `Bearer ${process.env.GEOEVAL_API_KEY}`, },});const data = (await response.json()) as Record<string, unknown>;if (!response.ok) throw new Error(`${data.code}: ${data.message}`);console.log(data);import os
import requests
response = requests.get( "https://geo-api.geoeval.com/v1/me", headers={ "Authorization": f"Bearer {os.environ['GEOEVAL_API_KEY']}", }, timeout=30,)response.raise_for_status()print(response.json())响应 200
userobject该 Key 所属的用户。
子字段: user
idstring用户 ID。
emailstring账号邮箱。
namestring显示名称。
created_atinteger (ms)账号创建时间。
api_keyobject本次请求使用的 Key。
子字段: api_key
idstringKey ID,对应其他接口中的 api_key_id。
namestring创建 Key 时设置的名称。
key_prefixstring用于区分不同 Key 的前缀。
expires_atinteger (ms) | null过期时间;null 表示永不过期。
created_atinteger (ms)Key 创建时间。
响应示例
{ "user": { "id": "01a224f1-0b7e-7f10-9a44-2c1d5e8b7a31", "email": "you@example.com", "name": "Your Name", "created_at": 1797000000000 }, "api_key": { "id": "01a22524-6869-7d2d-bdab-b3a29b49ccc2", "name": "production", "key_prefix": "geo_live_8hK2mPq4Xa1Z", "expires_at": null, "created_at": 1797000100000 }}错误
所有接口还可能返回 400、401、403 或 500,详见错误.