跳转到主要内容
POST
/
usage
Python
import requests

url = "https://somark.tech/api/v1/usage"

data = {
    "api_key": "sk-***",
}

response = requests.post(url, data=data)
print(response.json())
{
  "code": 0,
  "message": "",
  "data": {
    "remaining_paid_pages": 104410,
    "remaining_free_pages_today": 295,
    "remaining_free_pages_this_month": 578,
    "dashboard_url": "https://somark.tech/workbench"
  }
}
remaining_paid_pages 为所有未过期付费套餐剩余页数之和;remaining_free_pages_today 为今日剩余免费页数;remaining_free_pages_this_month 为本月剩余免费页数。

请求体

multipart/form-data
api_key
string
必填

API 密钥,格式 sk-***

示例:

"sk-***"

响应

200 - application/json

查询成功

code
integer

状态码,0 为成功,非 0错误码

示例:

0

message
string

错误信息。成功时通常为空字符串。

示例:

""

data
object

当前 API Key 对应账号的剩余额度信息。