跳到主要内容
限时活动每支视频只要 HK$1限量 1000 支,先到先得立即抢购
Axiom Lab
开发者文档

参考

API 参考 · 余额与用量

查看余额、流水和用量,在线充值。

查看 Markdown

Wallet

GET/v1/wallet

需要 API Key成功 200

参数

名称类型说明
X-Project-IDheaderstring要操作的项目;省略时使用默认项目; 可为 null

返回 200 application/json

名称类型说明
balance_cents必填integer
held_cents必填integerReserved for videos in production; released or charged when each one ends
available_cents必填integer
low_balance_cents必填integer可为 null
currency必填stringAlways HKD: every amount is in Hong Kong dollar cents
organization_id必填string
mock_left_centsintegerDemo payments only: how much more demo credit this organization can top up in total; absent when payments are real; 可为 null

示例

curl "https://axiomlab.online/v1/wallet" \
  -H "Authorization: Bearer $AZIMO_API_KEY"

Wallet Entries

GET/v1/wallet/entries

需要 API Key成功 200

参数

名称类型说明
afterquerystring长度 ≤ 64; 可为 null
limitqueryinteger默认 50; 范围 1–200
X-Project-IDheaderstring要操作的项目;省略时使用默认项目; 可为 null

返回 200 application/json

名称类型说明
data必填array<object>
data[].id必填string
data[].organization_id必填string
data[].kind必填string
data[].amount_cents必填integer
data[].hold_cents必填integer
data[].job_id必填string可为 null
data[].note必填string可为 null
data[].actor必填string可为 null
data[].created_at必填number
data[].currency必填stringUnit of amount_cents and hold_cents: HKD, or USD for entries written before the wallet switched to HKD (the switch itself is an adjust entry whose note states the conversion rate)
next_cursorstringOpaque; pass as cursor (or the after alias) for the next page; 可为 null
has_moreboolean默认 false

示例

curl "https://axiomlab.online/v1/wallet/entries" \
  -H "Authorization: Bearer $AZIMO_API_KEY"

Checkout

POST/v1/wallet/checkout

需要 API Key成功 201

参数

名称类型说明
Idempotency-Key必填headerstring调用方生成并保存的唯一值;超时重试时复用它,同一请求不会被执行两次; 长度 1–128
X-Project-IDheaderstring要操作的项目;省略时使用默认项目; 可为 null

请求体 application/json

名称类型说明
amount_cents必填integerHKD cents, HK$20–HK$100,000; 范围 2000–10000000

返回 201 application/json

名称类型说明
id必填string
url必填string
amount_cents必填integerHKD cents credited to the wallet once paid
currencystring默认 HKD
charge_currencystringCurrency Stripe charges: HKD, the wallet's own currency; 默认 HKD
charge_amountintegerAmount Stripe charges, in charge_currency cents (equal to amount_cents); 默认 0

示例

curl -X POST "https://axiomlab.online/v1/wallet/checkout" \
  -H "Authorization: Bearer $AZIMO_API_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{"amount_cents": 2000}'

Usage

GET/v1/usage

需要 API Key成功 200

The amount billed to this project's wallet in [from, to) (default: the last 30 days) and its paid calls and job counts, grouped on request. group_by=job pages by job id with after.

参数

名称类型说明
fromquerynumber范围 ≥ 0; 可为 null
toquerynumber范围 ≥ 0; 可为 null
group_byquerystring默认 none
limitqueryinteger默认 50; 范围 1–200
afterquerystring长度 ≤ 32; 可为 null
X-Project-IDheaderstring要操作的项目;省略时使用默认项目; 可为 null

返回 200 application/json

名称类型说明
project_id必填string
range必填map<string, number>
jobs必填map<string, integer>
billed_cents必填integerAmount charged to the wallet in the range, in cents of currency
currency必填stringAlways HKD
group_by必填string
groups必填array<object>可为 null
next_cursor必填string可为 null

示例

curl "https://axiomlab.online/v1/usage" \
  -H "Authorization: Bearer $AZIMO_API_KEY"

← 全部接口