算力卡查询
查询当前用户的算力卡信息,包括卡类型、余额、到期时间等。请求参数
页码,从1开始
每页数量
响应参数
响应码
响应信息
算力卡数据
Show data
Show data
算力卡列表
Show card_list
Show card_list
余额
面值
售价
绑定时间,秒级时间戳
过期时间,秒级时间戳
绑定信息
卡号
状态信息
算力卡名称
算力卡uuid
算力卡有效期
总记录数量
代码示例
Copy
import requests
url = "https://www.chenyu.cn/api/open/v2/card/list"
headers = {
"Authorization": "Bearer your_api_key"
}
params = {
"page": 1,
"page_size": 10
}
response = requests.get(url, headers=headers, params=params)
result = response.json()
if result['code'] == 0:
card_data = result['data']
print(f"总记录数: {card_data['total']}")
for card in card_data['card_list']:
print(f"算力卡名称: {card['title']}")
print(f"卡号: {card['card_no']}")
print(f"余额: {card['leave_amount']}")
print(f"面值: {card['face_amount']}")
print(f"状态: {card['status_txt']}")
print(f"过期时间: {card['expire_date']}")
print("---")
else:
print(f"查询失败: {result['msg']}")
响应示例
Copy
{
"code": 0,
"msg": "查询成功",
"data": {
"card_list": [
{
"leave_amount": 100.5,
"face_amount": 200.0,
"sale_price": 180.0,
"bind_time": 1705294225,
"expire_date": 1735689599,
"bind_txt": "已绑定",
"card_no": "CARD20240115001",
"pods": [
{
"uuid": "pod_12345678-1234-1234-1234-123456789012",
"title": "PyTorch环境"
}
],
"status_txt": "正常",
"title": "GPU算力卡",
"uuid": "card_12345678-1234-1234-1234-123456789012",
"valid_days": 365
}
],
"total": 1
}
}