---
title: "Oauth Usage History"
method: GET
path: "/oauth/usage_history"
tags: ["Authentication"]
---

# Oauth Usage History

`GET /oauth/usage_history`

## Request

- Base URL: `https://qveris.ai/api/v1`
- URL: `https://qveris.ai/api/v1/oauth/usage_history`
- Auth: HTTP bearer

Requires an Account Resource access token with the `usage_history` scope.

## Query parameters

- `start_date` string, nullable: 开始日期 (YYYY-MM-DD)
- `end_date` string, nullable: 结束日期 (YYYY-MM-DD)
- `event_type` string, nullable: 事件类型过滤
- `kind` string, nullable: 事件分组过滤
- `success` boolean, nullable: 是否成功
- `billable_success` boolean, nullable: 是否可计费
- `outcome` string, nullable: 执行 outcome 过滤
- `reason_code` string, nullable: 执行 reason_code 过滤
- `has_execution_outcome` boolean, nullable: 是否存在 execution_outcome
- `charge_outcome` string, nullable: 收费结果过滤
- `anomaly` string, nullable: 异常类型过滤
- `search_id` string, nullable: search_id 聚焦过滤
- `execution_id` string, nullable: execution_id 聚焦过滤
- `api_key_id` string, uuid, nullable: API Key 归因过滤
- `oauth_client_id` string, nullable: OAuth client_id 归因过滤
- `credential_type` string, nullable: 凭证类型过滤
- `page` integer: 页码
- `page_size` integer: 每页数量
- `include_details` boolean: 是否返回完整审计详情字段
- `min_credits` number, nullable
- `max_credits` number, nullable
- `bucket` string, nullable
- `summary` boolean
- `limit` integer, nullable: 摘要模式最多返回条数

## Response `200`

Successful Response

- APIResponseUsageEventsResponse
  - `status` string, required
  - `message` string, required
  - `status_code` integer
  - `data` UsageEventsResponse
    - `items` UsageEventItem[], required
      - `anomalies` string[], nullable
      - `id` string, required
      - `event_type` string, required
      - `source_system` string, required
      - `source_ref_type` string, nullable
      - `source_ref_id` string, nullable
      - `credential_type` string, nullable
      - `api_key` UsageEventApiKey
        - `id` string, required
        - `name` string, required
        - `masked_value` string, required
      - `api_key_attribution_status` string
      - `oauth_client` UsageEventOAuthClient
        - `id` string, required
      - `credential_attribution_status` 'api_key' | 'oauth_client' | 'user_session' | 'non_api_key' | 'historical_unknown'
      - `session_id` string, nullable
      - `search_id` string, nullable
      - `execution_id` string, nullable
      - `tool_id` string, nullable
      - `model` string, nullable
      - `query` string, nullable
      - `success` boolean, required
      - `charge_outcome` string, required
      - `error_message` string, nullable
      - `duration_ms` number, nullable
      - `request_payload` object, nullable
      - `response_payload_summary` object, nullable
      - `execution_outcome` object, nullable
      - `outcome_schema_version` string, nullable
      - `transport_success` boolean, nullable
      - `provider_success` boolean, nullable
      - `result_valid` boolean, nullable
      - `billable_success` boolean, nullable
      - `outcome` string, nullable
      - `outcome_status` string, nullable
      - `reason_code` string, nullable
      - `outcome_message` string, nullable
      - `provider_status_code` string, nullable
      - `provider_status_message` string, nullable
      - `http_status_code` integer, nullable
      - `valid_result_count` integer, nullable
      - `raw_result_count` integer, nullable
      - `chargeable_quantity` number, nullable
      - `retryable` boolean, nullable
      - `display_severity` string, nullable
      - `billing_snapshot_status` string, nullable
      - `billing_rule_snapshot` object, nullable
      - `pre_settlement_bill` object, nullable
      - `settlement_result` object, nullable
      - `requested_amount_credits` number, nullable
      - `actual_amount_credits` number, nullable
      - `credits_ledger_entry_id` string, nullable
      - `charge_event_id` string, nullable
      - `settlement_state` string, nullable
      - `settlement_batch_id` string, nullable
      - `settlement_ledger_entry_id` string, nullable
      - `display_target` string, nullable
      - `billing_unit` string, nullable
      - `unit_price_credits` number, nullable
      - `quantity` number, nullable
      - `list_amount_credits` number, nullable
      - `minimum_charge_credits` number, nullable
      - `pricing_profile_id` string, nullable
      - `billing_summary` string, nullable
      - `pre_settlement_amount_credits` number, nullable
      - `settled_amount_credits` number, nullable
      - `pricing_context_id` string, nullable
      - `harbor_snapshot_id` string, nullable
      - `harbor_snapshot_version` string, nullable
      - `resolver_version` string, nullable
      - `created_at` string, date-time, required
    - `total` integer, required
    - `page` integer, required
    - `page_size` integer, required
    - `summary` UsageEventsSummary
      - `start_date` string, date-time, nullable
      - `end_date` string, date-time, nullable
      - `bucket` string, required
      - `total_count` integer, required
      - `success_count` integer, required
      - `failure_count` integer, required
      - `charge_outcome_counts` object, required
      - `pre_settlement_credits` number, required
      - `settled_credits` number, required
      - `max_charge_items` UsageEventItem[], required
        - `anomalies` string[], nullable
        - `id` string, required
        - `event_type` string, required
        - `source_system` string, required
        - `source_ref_type` string, nullable
        - `source_ref_id` string, nullable
        - `credential_type` string, nullable
        - `api_key` UsageEventApiKey
          - `id` string, required
          - `name` string, required
          - `masked_value` string, required
        - `api_key_attribution_status` string
        - `oauth_client` UsageEventOAuthClient
          - `id` string, required
        - `credential_attribution_status` 'api_key' | 'oauth_client' | 'user_session' | 'non_api_key' | 'historical_unknown'
        - `session_id` string, nullable
        - `search_id` string, nullable
        - `execution_id` string, nullable
        - `tool_id` string, nullable
        - `model` string, nullable
        - `query` string, nullable
        - `success` boolean, required
        - `charge_outcome` string, required
        - `error_message` string, nullable
        - `duration_ms` number, nullable
        - `request_payload` object, nullable
        - `response_payload_summary` object, nullable
        - `execution_outcome` object, nullable
        - `outcome_schema_version` string, nullable
        - `transport_success` boolean, nullable
        - `provider_success` boolean, nullable
        - `result_valid` boolean, nullable
        - `billable_success` boolean, nullable
        - `outcome` string, nullable
        - `outcome_status` string, nullable
        - `reason_code` string, nullable
        - `outcome_message` string, nullable
        - `provider_status_code` string, nullable
        - `provider_status_message` string, nullable
        - `http_status_code` integer, nullable
        - `valid_result_count` integer, nullable
        - `raw_result_count` integer, nullable
        - `chargeable_quantity` number, nullable
        - `retryable` boolean, nullable
        - `display_severity` string, nullable
        - `billing_snapshot_status` string, nullable
        - `billing_rule_snapshot` object, nullable
        - `pre_settlement_bill` object, nullable
        - `settlement_result` object, nullable
        - `requested_amount_credits` number, nullable
        - `actual_amount_credits` number, nullable
        - `credits_ledger_entry_id` string, nullable
        - `charge_event_id` string, nullable
        - `settlement_state` string, nullable
        - `settlement_batch_id` string, nullable
        - `settlement_ledger_entry_id` string, nullable
        - `display_target` string, nullable
        - `billing_unit` string, nullable
        - `unit_price_credits` number, nullable
        - `quantity` number, nullable
        - `list_amount_credits` number, nullable
        - `minimum_charge_credits` number, nullable
        - `pricing_profile_id` string, nullable
        - `billing_summary` string, nullable
        - `pre_settlement_amount_credits` number, nullable
        - `settled_amount_credits` number, nullable
        - `pricing_context_id` string, nullable
        - `harbor_snapshot_id` string, nullable
        - `harbor_snapshot_version` string, nullable
        - `resolver_version` string, nullable
        - `created_at` string, date-time, required
      - `buckets` UsageEventsSummaryBucket[], required
        - `bucket_start` string, date-time, required
        - `total_count` integer, required
        - `success_count` integer, required
        - `failure_count` integer, required
        - `charged_count` integer, required
        - `included_count` integer, required
        - `failed_not_charged_count` integer, required
        - `failed_charged_review_count` integer, required
        - `pre_settlement_credits` number, required
        - `settled_credits` number, required
  - `message_key` string, nullable

## Other responses

- `422`: Validation Error

---

[API](https://skmtc.dev/qveris/apis/qveris-public-rest-api.md) · [All operations](https://skmtc.dev/qveris/apis/qveris-public-rest-api/llms.txt) · [OpenAPI document](https://skmtc.dev/qveris/apis/qveris-public-rest-api/revisions/7b78aeef092a?raw)
