メインコンテンツへスキップ
POST
/
calls
/
stats
呼び出しの統計情報
curl --request POST \
  --url https://api.example.com/calls/stats \
  --header 'Authorization: Basic <encoded-value>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "project_id": "<string>",
  "start": "2023-11-07T05:31:56Z",
  "end": "2023-11-07T05:31:56Z",
  "granularity": 123,
  "usage_metrics": [
    {
      "metric": "input_tokens",
      "aggregations": [
        "sum"
      ],
      "percentiles": []
    }
  ],
  "call_metrics": [
    {
      "metric": "latency_ms",
      "aggregations": [
        "sum"
      ],
      "percentiles": []
    }
  ],
  "filter": {
    "op_names": [
      "<string>"
    ],
    "input_refs": [
      "<string>"
    ],
    "output_refs": [
      "<string>"
    ],
    "parent_ids": [
      "<string>"
    ],
    "trace_ids": [
      "<string>"
    ],
    "call_ids": [
      "<string>"
    ],
    "thread_ids": [
      "<string>"
    ],
    "turn_ids": [
      "<string>"
    ],
    "trace_roots_only": true,
    "wb_user_ids": [
      "<string>"
    ],
    "wb_run_ids": [
      "<string>"
    ]
  },
  "timezone": "UTC"
}
'
{
  "start": "2023-11-07T05:31:56Z",
  "end": "2023-11-07T05:31:56Z",
  "granularity": 123,
  "timezone": "<string>",
  "usage_buckets": [],
  "call_buckets": []
}

承認

Authorization
string
header
必須

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

ボディ

application/json

指定した時間範囲にわたる集計済みのコール統計情報のリクエスト。

project_id
string
必須
start
string<date-time>
必須

開始時刻(両端含む、UTC、ISO 8601)。

end
string<date-time> | null

終了時刻(UTC、ISO 8601)。省略した場合は現在時刻がデフォルト値になります。

granularity
integer | null

バケットサイズ(秒単位)(例: 1 時間なら 3600)。省略した場合は時間範囲に基づいて自動選択されます。バケット数が 1万 を超える場合は調整されます。

usage_metrics
UsageMetricSpec · object[] | null

計算する使用状況メトリクス(トークン数、コスト)。タイムスタンプとモデルごとに集計されます。

call_metrics
CallMetricSpec · object[] | null

計算する呼び出しレベルのメトリクス(レイテンシ、件数)。タイムスタンプごとにのみ集計されます。

filter
CallsFilter · object
timezone
string
デフォルト:UTC

バケットの整列に使用する IANA タイムゾーン(例: "America/New_York")

レスポンス

成功時のレスポンス

時系列の呼び出し統計情報を含むレスポンス。

start
string<date-time>
必須

解決済みの開始時刻(UTC)

end
string<date-time>
必須

解決済みの終了時刻(UTC)

granularity
integer
必須

使用されたバケットサイズ(秒単位)

timezone
string
必須

バケットの整列に使用されたタイムゾーン

usage_buckets
Usage Buckets · object[]

モデルごとの使用状況メトリクス。各バケットには「timestamp」「model」と集約されたメトリクス値が含まれます。

call_buckets
Call Buckets · object[]

呼び出しレベルのメトリクス。各バケットには「timestamp」と集約されたメトリクス値が含まれます。