0%

$ACE 代币与折扣

Ace Data Cloud 平台支持 $ACE 代币质押折扣机制。用户可以绑定钱包地址,持有 $ACE 代币即可享受 API 调用费用折扣。

本文档介绍代币相关的 API 接口,所有接口需要身份验证,详情请参考 Platform Token

一、获取折扣策略列表

查询各服务对应的代币折扣策略,即持有多少代币可以享受多少折扣。

接口说明

内容
方法 GET
路径 /api/v1/coin-policies/
鉴权 Authorization: Bearer <platform_token>

查询参数

参数 类型 必填 说明
service_id string 按服务 ID 过滤
limit integer 每页返回数量
offset integer 偏移量

请求示例

1
2
3
4
curl -X GET \
-H "accept: application/json" \
-H "authorization: Bearer platform-v1-92eb****629c" \
"https://platform.acedata.cloud/api/v1/coin-policies/?limit=3"

响应示例(HTTP 200)

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
{
"count": 174,
"items": [
{
"id": "dc4b6e60-b4de-4853-92fc-cc566efd3e5b",
"service_id": "5d732942-4d44-48be-958e-dd8474d8aa8d",
"threshold": 1000000.0,
"discount": 0.03,
"created_at": "2026-03-21T13:11:47.766904Z",
"updated_at": "2026-03-21T13:11:47.766923Z",
"tags": null,
"metadata": null,
"service": {
"id": "5d732942-4d44-48be-958e-dd8474d8aa8d",
"title": "ChatDoc 问答"
}
}
]
}

字段说明

字段 类型 说明
id string 策略唯一标识
service_id string 关联的服务 ID
service object 服务信息
threshold number 持币门槛(需持有的 $ACE 数量)
discount number 折扣比例(百分比)

二、获取用户代币信息

查询当前用户的 $ACE 代币绑定和持有情况。

接口说明

内容
方法 GET
路径 /api/v1/coin-infos/
鉴权 Authorization: Bearer <platform_token>

⚠️ 必须传 user_id 查询参数。

请求示例

1
2
3
4
curl -X GET \
-H "accept: application/json" \
-H "authorization: Bearer platform-v1-92eb****629c" \
"https://platform.acedata.cloud/api/v1/coin-infos/?user_id=89518d07-5560-4b05-92c1-667f3ddf6a4b"

响应示例(HTTP 200)

1
2
3
4
{
"count": 0,
"items": []
}

如果用户未绑定钱包,返回空列表。绑定后会返回代币持有信息。

代码示例

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
import requests

# 获取折扣策略
url = "https://platform.acedata.cloud/api/v1/coin-policies/"
headers = {
"accept": "application/json",
"authorization": "Bearer platform-v1-92eb****629c"
}

response = requests.get(url, headers=headers, params={"limit": 100})
policies = response.json()

for policy in policies["items"]:
svc_title = policy.get("service", {}).get("title", "未知")
print(f"{svc_title}: 持有 {policy['threshold']} $ACE → {policy['discount']}% 折扣")

相关接口