Verify an API key
curl --request GET \
--url https://ipcrazy.com/api/v1/access \
--header 'Authorization: Bearer <token>'import requests
url = "https://ipcrazy.com/api/v1/access"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://ipcrazy.com/api/v1/access', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"data": {
"customer_id": "example-customer-id",
"credential_id": "00000000-0000-4000-8000-000000000000",
"capabilities": [
"access:read"
],
"proxy_enabled": false
},
"trace_id": "9f2c7a8e-0000-4000-8000-000000000000"
}{
"error": {
"code": "UNAUTHORIZED",
"message": "Valid API key required",
"retryable": false
},
"trace_id": "9f2c7a8e-0000-4000-8000-000000000000"
}API 参考
验证 API 密钥
Checks that the API key is valid and returns the account and key it belongs to. It does not grant or reveal proxy access.
GET
/
api
/
v1
/
access
Verify an API key
curl --request GET \
--url https://ipcrazy.com/api/v1/access \
--header 'Authorization: Bearer <token>'import requests
url = "https://ipcrazy.com/api/v1/access"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://ipcrazy.com/api/v1/access', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"data": {
"customer_id": "example-customer-id",
"credential_id": "00000000-0000-4000-8000-000000000000",
"capabilities": [
"access:read"
],
"proxy_enabled": false
},
"trace_id": "9f2c7a8e-0000-4000-8000-000000000000"
}{
"error": {
"code": "UNAUTHORIZED",
"message": "Valid API key required",
"retryable": false
},
"trace_id": "9f2c7a8e-0000-4000-8000-000000000000"
}用此接口确认你的程序配置了有效的密钥,例如在启动时或健康检查中调用。它返回本次请求认证所用的账户和密钥。
proxy_enabled 始终为 false:API 密钥不会授予代理访问权限。代理连接信息请在控制台获取。
401 响应表示密钥缺失、格式错误或已撤销,或者所属账户已停用或尚未验证。不要用同一个密钥重试 401。