メインコンテンツへスキップ
POST
/
calls
/
usage
calls 使用量
curl --request POST \
  --url https://api.example.com/calls/usage \
  --header 'Authorization: Basic <encoded-value>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "project_id": "<string>",
  "call_ids": [
    "<string>"
  ],
  "include_costs": false,
  "limit": 10000
}
'
{
  "call_usage": {},
  "unfinished_call_ids": [
    "<string>"
  ]
}

承認

Authorization
string
header
必須

Basic authentication header of the form Basic <encoded-value>, where <encoded-value> is the base64-encoded string username:password.

ボディ

application/json

複数のルート call の集計された使用状況を計算するリクエスト。

この Endpoint は、リクエストされた各ルート call の使用状況メトリクスを返します。各ルートのメトリクスには、そのルート自身の使用状況の合計に加えて、すべての子孫の使用状況の合計も含まれます。

注: 集計のために、条件に一致するすべての call がメモリに読み込まれます。結果セットが非常に大きい場合(>10k calls)は、ルート call ID をバッチ処理するか、application レイヤーでより限定的なフィルターを使用することを検討してください。

project_id
string
必須
call_ids
string[]
必須

集計するルート call ID。各結果キーは、それぞれ 1 つの入力 call ID に対応します。

include_costs
boolean
デフォルト:false

true の場合、使用状況にコスト計算を含めます。

limit
integer
デフォルト:10000

すべてのトレースにわたって処理する call の最大数。メモリ使用量が際限なく増えるのを防ぐための安全上限として機能します。

レスポンス

成功レスポンス

ルート call ごとの集計された使用状況メトリクスを含むレスポンス。

call_usage
Call Usage · object
unfinished_call_ids
string[]