Skip to main content
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 is the sum of remaining pages across all active paid plans. remaining_free_pages_today is the remaining free quota for today. remaining_free_pages_this_month is the remaining free quota for this month.

Body

multipart/form-data
api_key
string
required

API 密钥,格式 sk-***

Example:

"sk-***"

Response

200 - application/json

查询成功

code
integer

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

Example:

0

message
string

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

Example:

""

data
object

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