Connect your enterprise quota and usage system to QwenWork so administrators can manage member limits and view consumption statistics in the console.
Connect your enterprise quota and usage system to QwenWork so administrators can manage member limits and view consumption statistics in the console.
This guide applies to K8S versions offering the BYOK limits and usage extension, using protocol /spi/v1. The installed version must support all eight endpoints. Access to this documentation does not mean the installation has enabled the capability.
Models remain separately configured in model management. The business SPI does not proxy model requests or provide metering and quota enforcement for enterprise models. Once customer quotas are enabled, model requests require a valid external user identity. The enterprise model service must associate consumption with the same identity.
All eight endpoints share one service URL, token and enable switch. The console cannot enable statistics and quotas separately. The Call timing column describes current host behavior; a successful connectivity check alone does not prove that every endpoint is implemented.
The domains, identities and data in examples are illustrative. Use a test organization, bound test users and dedicated test credentials for integration testing.
Next: Prepare the connection and send the first request.
Start here
| Goal | Read |
|---|---|
| First integration: confirm URLs, credentials and user identities | Quick start |
| Provide organization, member and daily consumption data | Usage APIs |
| Receive member limits and return real-time organization quota | Quota APIs |
| Verify integration results or diagnose failures | Validation and troubleshooting |
Call direction
Implement the HTTP endpoints on the right. QwenWork sends requests; the enterprise service validates the token and organization, performs the operation and returns the agreed JSON. The browser does not call the enterprise SPI directly.
| Integration | Direction | Credentials and purpose |
|---|---|---|
| OpenAPI | Enterprise application → QwenWork | Open Platform application API key; invokes QwenWork capabilities |
| Business SPI in this guide | QwenWork → Enterprise service | Dedicated SPI token; reads statistics and reads or sets limits |
| Model BYOK | QwenWork → Model provider | Endpoint and optional API key from model configuration; executes model requests |
Required endpoints
All eight endpoints share one service URL, token and enable switch. The console cannot enable statistics and quotas separately. The Call timing column describes current host behavior; a successful connectivity check alone does not prove that every endpoint is implemented.
| Endpoint | Method and path | Responsibility | Call timing |
|---|---|---|---|
| Get latest statistics date | GET /spi/v1/usage/meta | Latest complete data date | Statistics refresh and manual connectivity check |
| Query organization usage overview | GET /spi/v1/usage/overview | Historical organization usage | Build snapshots by date and five periods |
| Query member usage list | GET /spi/v1/usage/members | Historical member usage | Build snapshots by reading every page |
| Query member daily usage trend | GET /spi/v1/usage/members/{external_user_id}/trend | Daily member trends | Read on demand when viewing a member's trend |
| Query quota rules and period | GET /spi/v1/quota/context | Quota constraints and current period | Validate quotas and determine period boundaries |
| Query member quotas | POST /spi/v1/quota/users/query | Applied member quotas | Explicit SDK queries; the product does not currently require read-after-write |
| Set member limit | PUT /spi/v1/quota/users | Set one member's absolute limit | Background dispatch and retries of quota changes |
| Query organization quota | GET /spi/v1/quota/org | Real-time organization total quota and usage | Organization quota queries |
Agree on three values before integration
| Value | Meaning | Synthetic example in this guide |
|---|---|---|
| Organization ID | QwenWork organization UUID mapped to an enterprise ledger tenant | 11111111-1111-4111-8111-111111111111 |
| External user ID | Enterprise user identifier currently bound in IAM; preserve case and leading zeros | employee-1001 |
| Metering unit | Statistics use credit numbers; quotas use minor-unit integer strings | 500 credit = "5000000" minor |