tokencoup
Edition: International · 国内版 Language: EN · ZH
Get API keys
Draft v0.1 · not legal advice

Cross-border Data Transfers

S1 / S2 / S3 flows, the GDPR–PIPL squeeze, and the five decisions still blocking launch.

Draft — not legal advice. This is the engineering compliance model from COMPLIANCE_C2.md, not a legal opinion. It relies on 2026-11 public regulatory information and Baidu public materials. A licensed lawyer must assess the final entity and data flows before launch.

1. Status

This notice explains why the gateway is split into two editions and why a domestic Qianfan key can never serve an international request. It is a design document made public for transparency.

2. Conclusion first

The compliance lifeline is keeping international traffic off mainland-China servers. Once data enters mainland China it is squeezed from both sides: GDPR has no adequacy decision for China (EU→CN), and PIPL export rules apply if tokencoup is a Chinese entity. If the Qianfan International upstream is confirmed to operate an overseas node, an overseas gateway plus that node would narrow the exposure to a single jurisdiction — that condition is not yet verified.

This conclusion depends on one unverified fact: the actual data-residency region of Qianfan International (§7). If its default endpoint lands in mainland China, the S1 design does not hold. Third-party due diligence (Kaamel, terms checked to 2026-09-17) reports that some Qianfan International personal data is stored in China and no public DPA exists; Baidu's Terms also permit sharing information with affiliates in other countries. Treat S1 as a target, not a guarantee — written confirmation has been requested and is pending.

3. The three data flows

FlowPathJurisdictionRiskDecision
S1 — intl + Mode B resaleUS/EU user → overseas gateway → Qianfan International upstream (intended overseas node, unverified)Intended: node country outside mainland China; actual residency unconfirmedMedium only if confirmed; otherwise EU→CN exposure🟡 Target path — blocked until written residency confirmation
S2 — cn + Mode A domestic keyCN user → domestic site → Qianfan DomesticMainland China only, PIPL domestic processingLow, closed path✅ Allowed, CN users only
S3 — intl + Mode A but domestic keyUS/EU user → overseas gateway → Qianfan Domestic China nodeGDPR EU→CN (no adequacy) and PIPL export if tokencoup is a Chinese entityHigh⛔ Permanently prohibited in code

4. S3 is blocked in code

gateway/common.py validates that the provider key's edition matches the serving edition. A mismatch returns 403 key_edition_mismatch; any key not explicitly registered in the edition registry fails closed with 403 key_edition_unknown — key prefixes are deliberately NOT used to infer the edition, because domestic and international Qianfan keys share the same bce-v3/ALTAK- prefix. Mode B is additionally disabled on the domestic edition (403 mode_B_not_allowed_on_cn).

This is a gateway-level guard, not a policy statement. It exists so a misconfigured client cannot silently pull EU prompts back to a China node.

5. GDPR side

  • No EU adequacy decision for mainland China (confirmed 2026-10; no agenda).
  • EU→China transfers require EU SCCs (2021/914) + a Schrems II transfer impact assessment + supplementary measures.
  • If the Qianfan International node is in Singapore (adequacy) or Frankfurt (inside the EU), the EU→node leg may need no SCC; the tokencoup↔Baidu contractual leg still needs review.
  • Default to not persisting prompts — keep only billing metadata, minimising the personal-data footprint.
  • B2B: sign SCCs with customers. B2C: explicit consent plus a downloadable TIA summary.

See the GDPR notice for rights and legal bases.

6. PIPL side

Applies if tokencoup has a Chinese entity or if international traffic passes through mainland China. Three export paths are available (complete as of 2026-01):

PathWhenNote
CAC security assessmentCIIO / important data / >1M people cumulative or >10k sensitive recordsMandatory; valid 2–3 years
Standard contract (SCC)Non-CIIO, 100k–1M non-sensitive or <10k sensitiveProvincial CAC filing + PIPIA
CertificationSame thresholdsEffective 2026-01-01; suited to continuous intra-group flows
Exemption (<100k non-sensitive)Below thresholdsStill requires separate consent, PIPIA, and disclosure of the overseas recipient
Optimal structure: place the international business in an offshore entity (e.g. Singapore / Hong Kong, China) and the domestic business in a separate Chinese entity. International traffic then falls outside PIPL export jurisdiction entirely, leaving only GDPR / local law.

7. The unverified factual dependency

Public materials (2023–2025) indicate intl.cloud.baidu.com is a separate international entity with overseas nodes including Hong Kong (China), Singapore, Frankfurt and Silicon Valley; Baidu reportedly has no self-operated US data centre. This has not been verified for the Qianfan API endpoint tokencoup will actually call.

Before enabling Mode B, log into the Qianfan International console and confirm the API's real residency region and endpoint. If it defaults to mainland China, select an overseas region or obtain written confirmation. This is the single fact S1 depends on.

8. Five decisions blocking S1 launch

  • Entity jurisdiction — recommended: offshore entity for intl, separate Chinese entity for cn (dual-entity isolation).
  • B2B vs B2C — B2B favours SCC + contract constraints; B2C needs explicit consent and a TIA summary page.
  • Whether to log prompts — default no (recommended); quality-tuning use would need notice + separate consent.
  • Qianfan International residency region — verify the live endpoint after account activation.
  • Gateway deployment region — overseas edge (Cloudflare / Vercel) or AWS Singapore / Frankfurt.

Until these are decided, S2 (domestic Mode A) and the framework guards may proceed, but S1 resale must not go live.

9. Technical measures already implemented

MeasureWhereEffect
Key-edition validation (F2)gateway/common.pyBlocks S3 with 403 key_edition_mismatch
Edition-scoped modes (F6)gateway/config.pycn allows only Mode A
International-only CF Gatewaygateway/cf_gateway.pyDomestic requests stay direct — no US edge hop
log_prompt=false (intl)gateway/config.pyNo prompt persistence on the international path
collect_logs=falseCloudflare AI Gateway tokencoupNo request/response bodies stored at the edge
X-Data-Region: overseasUpstream headers (F3)Explicit residency mark on international calls
Contradiction to resolve: COMPLIANCE_C2.md proposes log_prompt=false for the domestic edition, but gateway/config.py currently sets cn.log_prompt=true. The code is the shipped truth; the plan and the Privacy Policy both flag this as an open item.

11. Contact

To be designated with the final operating entity. This draft is based on 2026-11 public regulations and Baidu public materials, is not legal advice, and must be replaced by a lawyer-reviewed notice before launch.