메인 콘텐츠로 건너뛰기
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초). 생략하면 시간 범위에 따라 자동으로 선택됩니다. 버킷이 10,000개를 초과하는 경우 자동으로 조정됩니다.

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' 및 집계된 메트릭 값들이 포함됩니다.