메인 콘텐츠로 건너뛰기
POST
/
calls
/
stats
Call 통계
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

시간 범위에 대한 집계된 call 통계 요청입니다.

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

계산할 사용 메트릭(토큰, 비용)입니다. timestamp와 모델별로 그룹화됩니다.

call_metrics
CallMetricSpec · object[] | null

계산할 call 수준 메트릭(지연 시간, 개수)입니다. timestamp 기준으로만 그룹화됩니다.

filter
CallsFilter · object
timezone
string
기본값:UTC

버킷 정렬에 사용할 IANA 표준 시간대(예: 'America/New_York')

응답

성공적인 응답

시계열 call 통계를 포함한 응답입니다.

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[]

call 수준 메트릭입니다. 각 버킷에는 'timestamp'와 집계된 메트릭 값이 포함됩니다.