创建产品
复制
询问AI
curl -X POST https://api.kyren.top/v1/products \
-H "Content-Type: application/json" \
-H "x-api-key: kyren_live_xxxxxxxxxxxx" \
-d '{
"name": "1000 AI Credits",
"description": "充值 1000 个 AI API 额度",
"price": 9.99,
"currency": "USD",
"metadata": {
"credits": "1000"
}
}'
创建 Checkout Session
复制
询问AI
curl -X POST https://api.kyren.top/v1/checkouts \
-H "Content-Type: application/json" \
-H "x-api-key: kyren_live_xxxxxxxxxxxx" \
-d '{
"productId": "prod_abc123",
"successUrl": "https://yoursite.com/success",
"cancelUrl": "https://yoursite.com/cancel",
"customerEmail": "customer@example.com",
"metadata": {
"userId": "user_456"
}
}'
查询订单列表
复制
询问AI
curl https://api.kyren.top/v1/orders?status=PAID&page=1&size=10 \
-H "x-api-key: kyren_live_xxxxxxxxxxxx"
查询账户余额
复制
询问AI
curl https://api.kyren.top/v1/balance \
-H "x-api-key: kyren_live_xxxxxxxxxxxx"