跳转到主要内容
GET
/
billing
/
usage
/api/v1/billing/usage
curl --request GET \
  --url https://api.venice.ai/api/v1/billing/usage \
  --header 'Authorization: Bearer <token>'
{
  "data": [
    {
      "amount": -0.1,
      "currency": "DIEM",
      "inferenceDetails": null,
      "notes": "API Inference",
      "pricePerUnitUsd": 0.1,
      "sku": "grok-imagine-image-image-unit",
      "timestamp": {},
      "units": 1
    },
    {
      "amount": -0.06356,
      "currency": "DIEM",
      "inferenceDetails": {
        "completionTokens": 227,
        "inferenceExecutionTime": 2964,
        "promptTokens": 339,
        "requestId": "chatcmpl-4007fd29f42b7d3c4107f4345e8d174a"
      },
      "notes": "API Inference",
      "pricePerUnitUsd": 2.8,
      "sku": "zai-org-glm-5-1-llm-output-mtoken",
      "timestamp": {},
      "units": 0.000227
    }
  ],
  "pagination": {
    "limit": 1,
    "page": 200,
    "total": 56090,
    "totalPages": 56090
  }
}
导出用户的用量数据。响应字段说明如下:
  • timestamp:账单使用条目的创建时间戳
  • sku:与账单使用条目关联的产品
  • pricePerUnitUsd:以美元计的单价
  • unit:消耗的单位数量
  • amount:账单使用条目的总收费金额
  • currency:账单使用条目所收取的货币
  • notes:关于账单使用条目的备注
  • inferenceDetails.requestId:与推理关联的请求 ID
  • inferenceDetails.inferenceExecutionTime:推理执行所用时间(毫秒)
  • inferenceDetails.promptTokens:prompt 中请求的 token 数量。仅在 LLM 用量中出现。
  • inferenceDetails.completionTokens:completion 中使用的 token 数量。仅在 LLM 用量中出现。

授权

Authorization
string
header
必填

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

请求头

Accept
string

Accept header to specify the response format

示例:

"application/json, text/csv"

查询参数

currency
enum<string>

Filter by currency

可用选项:
USD,
VCU,
DIEM,
BUNDLED_CREDITS
示例:

"USD"

endDate
string<date-time>

End date for filtering records (ISO 8601)

示例:

"2024-12-31T23:59:59.000Z"

limit
integer
默认值:200

Number of items per page

必填范围: 0 < x <= 500
示例:

200

page
integer
默认值:1

Page number for pagination

必填范围: x > 0
示例:

1

sortOrder
enum<string>
默认值:desc

Sort order for createdAt field

可用选项:
asc,
desc
示例:

"desc"

startDate
string<date-time>

Start date for filtering records (ISO 8601)

示例:

"2024-01-01T00:00:00.000Z"

响应

Successful response

The response schema for the billing usage endpoint

data
object[]
必填
pagination
object
必填
warningMessage
string

A warning message to disambiguate DIEM usage from legacy DIEM (formerly VCU) usage