메인 콘텐츠로 건너뛰기
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'와 집계된 메트릭 값이 포함됩니다.