Statistics use a completed data date, ds.
Statistics use a completed data date, ds. Prepare all data for that date before publishing it through Get latest statistics date. QwenWork reads the organization overview and every member page, validates them, and only then publishes a local snapshot.
Support all five periods with inclusive date boundaries. Return 0 when a day is known to have no consumption. Return null for unknown values only in nullable fields; do not fill incomplete data with zeros. Organization totals, member totals and daily trends must use consistent measurement rules.
Every request includes the common headers. The following JSON is a complete success example: one test member on the same data date consumes 10 credits per day for the last seven days, totaling 70 credits.
HTTP 200:
For pure pay-as-you-go systems, keep the balance or next reset date null when unavailable. If there is no billing cycle, agree on a calendar month during integration and provide its actual boundaries. Do not fill a historical quota_snapshot with the current balance. Use Query organization quota for real-time quota. Ninety days is an example and recommendation, not a retention guarantee made by the platform on behalf of the enterprise.
Return HTTP 400 for invalid parameters; do not silently change the page number or size. Break ties using external_user_id for stable ordering, with nulls last.
Pagination for a given ds must be stable: non-final pages must be full, users must not repeat across pages, and total must not change. QwenWork reads every page, not just the first 200 members. Duplicates, omissions, unbound identities or organization mismatches fail the entire batch and retain the previous published snapshot.
Dates, periods and amounts
| Parameter or field | Convention |
|---|---|
| ds | YYYY-MM-DD; a completed, immutable data date |
| timezone | Asia/Shanghai |
| period=cycle | From the start of the billing cycle containing ds through ds |
| period=7d / 30d | The last 7 / 30 calendar days, including ds |
| period=month | From the start of the month containing ds through ds |
| period=last_month | The complete calendar month before ds |
| last_data_update_time | Must equal the requested ds; a date, not an RFC3339 timestamp |
| Usage and balance | A nonnegative JSON number in credits, with at most four decimal places |
| Ratios | Percentage points; 10 means 10%, not 0.1 |
Get latest statistics date
No request body or query parameters. HTTP 200:
Return a date only when the organization overview and all member pages for all five periods are readable. Return {"ds":null} when no complete data is available; do not default to today.
Statistics refresh runs by default at 04:00 Beijing time plus a stable installation-specific delay of 0–1 hour. If data is behind T-1, it waits one hour and retries once by default. Confirm data readiness with the delivery team. The console shows the latest successfully published local date, which may differ from the date this endpoint just returned.
Query organization usage overview
| Parameter | Type | Requirement |
|---|---|---|
| ds | string | Required; a published data date |
| period | string | Required; cycle/7d/30d/month/last_month |
| Field | Type | Requirement |
|---|---|---|
| qw_org_id | string | QwenWork organization UUID from the request, not the enterprise ledger tenant ID |
| ds / last_data_update_time | date string | Both must match the requested ds |
| subscribed | boolean | Must be true for valid BYOK data, indicating statistics availability; no model subscription purchase is required |
| period | object | key matches the request; boundaries match the period; days is the actual day count |
| metrics.total_credits_used | number | Equals the sum of member usage and the sum of daily usage for the period |
| metrics.daily_average_credits | number | Total usage divided by days |
| metrics.active_member_count | integer | Distinct members with consumption during the period |
| metrics.seat_count | integer | Population used for statistics; does not grant QwenWork seats |
| metrics.active_member_rate | number or null | active / seat × 100; null when seat is 0 |
| quota_snapshot.remaining_credits | number or null | Remaining cycle quota as of ds; null if unknown |
| quota_snapshot.cycle_start_date/cycle_end_date | date string | Complete billing-cycle boundaries containing ds, both inclusive |
| quota_snapshot.next_reset_date | date string or null | Next reset date; null if unknown |
| daily_trend | array | Ascending, unique dates covering the entire selected period |
| timezone / retention_days | string / integer | Fixed time zone and positive retention days matching the actual service agreement |
Query member usage list
| Parameter | Type | Constraint |
|---|---|---|
| ds / period | string | Same as Query organization usage overview |
| page_no | integer | Starts at 1 |
| page_size | integer | 1–200 |
| sort | string | used_credits/quota_usage_rate/last_used_at |
| order | string | asc/desc |
| keyword | optional string | At most 200 characters; no control characters |
| Field | Type | Requirement |
|---|---|---|
| rows | array | [] for no results; never null |
| rows[].external_user_id | string | The external ID currently bound in IAM; preserve case and leading zeros |
| rows[].used_credits | number | Consumption within the requested period |
| rows[].cycle_used_credits | number | Consumption from the start of the billing cycle containing ds through ds, regardless of the requested period |
| rows[].cycle_quota_credits | number or null | Limit for the cycle containing ds; null if unknown |
| rows[].quota_usage_rate | number or null | Cycle usage / cycle limit × 100; may exceed 100; null if the limit is 0 or unknown |
| rows[].last_used_at | string or null | RFC3339 recommended; null when there is no usage record |
| rows[].user_name/status/avatar | string or null | Supplemental information; QwenWork prefers the IAM snapshot for identity and department display |
| total | integer | Complete distinct member count for the current filter |
| page_no/page_size | integer | Match the request |
| has_more | boolean | Consistent with the page number, row count and total |
| next_reset_date | date string or null | Next reset date |
| last_data_update_time | date string | Equals the requested ds |
Query member daily usage trend
| Parameter | Location | Requirement |
|---|---|---|
| external_user_id | path | External user ID, URL-encoded as a single path segment |
| ds | query | End date of the query |
| days | query | Integer, 1–30 |
The response external_user_id must match the request. start_date is ds-(days-1), and end_date and last_data_update_time both equal ds. points must contain exactly days consecutive, ascending entries. credits is a nonnegative credit number; the name is nullable supplemental information.
Member daily trends are read on demand. The enterprise service must retain at least the trend data for the two published batches still displayed by QwenWork. Return snapshot_not_found for expired data; do not silently query the latest date. Do not infer historical account ownership after an identity is unbound or a member is removed.