Skip to main content

QwenWork BYOK integration overview and API inventory

Audience: FDEs and developers of customer model or metering platforms.

Audience: FDEs and developers of customer model or metering platforms. Call direction: QwenWork server → Customer API. This is the entry point for BYOK integration. Quota and usage SPI names, fields, examples and acceptance criteria follow the existing BYOK limits and usage documentation and current code. Model and search integration follows the current Model BYOK and search APIs protocol. All examples use synthetic data; replace organizations, users, current periods and credentials for real integration testing.

Reading guide

DocumentContents
This guideComplete SPI inventory, dependencies and delivery requirements
Quota and usage SPI integration overviewOverview of the eight existing SPI endpoints and call relationships
Quick startURLs, authentication, identities and configuration
Usage APIsDates, organization usage, member usage and trends
Quota APIsRules and periods, member quotas, limit writes and organization quota
Validation and troubleshootingIntegration checklist, errors and diagnosis
Model BYOK and search APIsChat, image, video, music, ASR and search protocols, with streaming and asynchronous examples

Complete SPI inventory

The model module is required: connect at least one primary Agent Chat model. Implement specialized models and search according to enabled capabilities. The quota and usage SPI is optional. When enabled, its eight endpoints form one BYOK limits and usage group sharing a URL, token and switch.
CapabilityMethod / reference pathRequirements and details
Chat, VL and text polishingPOST to a complete Chat URL, such as /v1/chat/completionsPrimary Chat required; model guide §3
Synchronous image generation/editingPOST /api/v1/services/aigc/multimodal-generation/generationWhen Sync is selected; model guide §5.2 and §5.3
Asynchronous image submissionPOST /api/v1/services/aigc/image-generation/generationWhen Async is selected, also implement image/video task queries; model guide §5.2 and §5.4
Image/video task queryGET using the configured …/{task_id} templateCompanion to asynchronous image and four-mode video submissions; model guide §4, §5.4 and §6
Four-mode video submissionPOST /api/v1/services/aigc/video-generation/video-synthesisImplement enabled modes with image/video task queries; model guide §6
Synchronous music generationPOST /api/v1/services/audio/music/generationWhen music is selected; no additional task query; model guide §7
Realtime ASRWS/WSS /api-ws/v1/realtime?model=…Base64 audio and session events; model guide §8.2
Streaming ASRWS/WSS /api-ws/v1/inferenceBinary audio and task events; model guide §8.1
Web searchPOST to the complete configured URL, such as /search/unifiedWhen enabled; web search request; model guide §9.1
Image searchPOST to the complete configured URL, such as /search/multimodalWhen enabled; sends only query; model guide §9.2

Quota and usage SPI

The entries below reuse existing endpoint names. Complete protocols and examples are maintained only in their source guides.
EndpointMethod and pathResponsibilityCall timing
Get latest statistics dateGET /spi/v1/usage/metaLatest complete data dateStatistics refresh and manual connectivity check
Query organization usage overviewGET /spi/v1/usage/overviewHistorical organization usageBuild snapshots by date and five periods
Query member usage listGET /spi/v1/usage/membersHistorical member usageBuild snapshots by reading every page
Query member daily usage trendGET /spi/v1/usage/members/{external_user_id}/trendDaily member trendsRead on demand when viewing a member's trend
Query quota rules and periodGET /spi/v1/quota/contextQuota constraints and current periodValidate quotas and determine period boundaries
Query member quotasPOST /spi/v1/quota/users/queryApplied member quotasExplicit SDK query; the product does not require read-after-write
Set member limitPUT /spi/v1/quota/usersSet one member's absolute limitBackground dispatch and retries of quota changes
Query organization quotaGET /spi/v1/quota/orgReal-time organization total quota and usageOrganization quota queries
Models use complete endpoints; reference paths can be customized within the selected protocol's constraints. The quota and usage SPI appends fixed paths to the base URL. Model capabilities may share URLs and asynchronous query templates; customers do not need 18 separate URLs. You do not need to implement model subscription queries, user creation, department aggregation, CSV exports, Console/IAM Internal APIs, configuration publishing or per-call accounting callbacks. License/IAM continues to supply product subscriptions.

Integration flow and responsibilities

  1. Confirm the organization, user IDs and metering rules; configure models and search separately.
  2. Configure and enable BYOK limits and usage; the connectivity check calls only Get latest statistics date.
  3. Query quota rules and the period, set member limits and confirm results; query organization quota for the quota overview.
  4. Make actual model calls using the same user to verify customer-side limit enforcement.
  5. After the customer finalizes statistics, get the latest date and query organization and member usage for all five periods.
  6. The existing statistics task validates data and publishes snapshots to local PostgreSQL; pages, department statistics and exports read these snapshots.
  7. Member details call Query member daily usage trend on demand.
The customer ledger defines credits; QwenWork does not automatically derive prices from model usage. QwenWork maps internal IAM user UUIDs to enterprise external IDs. Models, quotas and statistics must use the same ID. Customers use trusted credentials to authorize the organization UUID → customer ledger tenant mapping. Model requests are not guaranteed to carry the organization header used by the quota and usage SPI. Final quota values and retries follow existing quota tasks. Set member limit must be idempotent and preserve usage, and its success response must reflect the applied result. FDEs can verify with Query member quotas. Statistics snapshots are published by ds: scheduled tasks skip published dates, while manual tasks can rebuild the same date. Member daily trends use a published date.

Current configuration and integration entry points

  • Configuration: Console → Open Platform → Extensions → BYOK limits and usage. Configuration is stored in spi_configurations with encrypted credentials. Each new request/task reads it dynamically, while a single operation uses a fixed version. When unconfigured or disabled, K8S uses the empty implementation. When enabled, all eight endpoints use the customer SPI; other static extensions, including License, retain their existing paths.
  • URL: HTTP/HTTPS, domains/IPs, ports and path prefixes are supported. HTTP warns that tokens are transmitted in plaintext. HTTPS validates certificates normally, without custom CAs or a validation bypass. Configuration, connectivity checks and actual calls share validation and do not follow redirects.
  • Test connectivity: Checks only HTTP 200 from Get latest statistics date, with a maximum of 5 seconds. It does not validate JSON or the other seven endpoints, or save/enable configuration. Cluster Biz resolves .svc; the browser need not resolve it.
  • Quota overview: Organization total and usage in /api/console/biz/v1/quota-overview come from Query organization quota. Rule counts and default individual limits come from local configuration. When disabled, K8S reports unsupported; when enabled, the customer response is used.
  • Manual statistics synchronization: Authenticated POST /api/console/biz/v1/analytics/usage/sync-runs, with no UI button. A new or identical ds reloads and publishes all five periods; an earlier ds returns unchanged. See the synchronization notes in Usage APIs.
Configuration and call behavior follow the existing quota and usage SPI documentation and current code. Verify the actual image to determine whether changes are deployed in a target environment.

FDE delivery record and acceptance

ItemDeliver or confirm
Capabilities and versionsModel scope, whether this group is enabled, both builds and this package version
Model URLsModel IDs, complete URLs, protocols, query templates, authentication and supported parameters
General URLOne base URL/token, authorized organization UUID and customer tenant; QwenWork supplies binding_id in requests
User identityExternal ID source, actual IAM binding, offboarding/rebinding and cross-organization isolation
Metering cycleCredit definition, pricing, rounding, failed/canceled call charges, cycle boundaries and permanent quotas
Data serviceComplete-ds readiness SLA, five periods, stable pagination, trends and retention
Network capacityBiz reachability, certificates, timeouts, rate limits, asset and task expiration
Integration evidenceFields for all eight endpoints, idempotent member limit writes and actual enforcement, organization quota queries, statistics publication/repeated triggers and dynamic switching
Acceptance order: authentication and network → eight-endpoint fields → enable/disable configuration → quota/model/statistics flow for the same user → failure retries and cycle transitions → customer environment acceptance. Verify the identity and customer ledger for quota-limited model calls; a successful connectivity check alone is insufficient. Deliver credentials separately through a secure channel. The model and search guide defines customer-service requests, responses, asynchronous tasks and errors. Subsequent quota and usage SPI changes remain governed by the existing chapters and code; do not maintain duplicate versions here. Static documentation checks do not replace customer-network tests, actual quota writes, model quality checks or deployment acceptance.