codex-gateway
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseCodex Machine Payment Protocol (MPP)
Codex机器支付协议(MPP)
Use this skill to access the Codex Supergraph without an API key via the MPP challenge flow.
| HTTP endpoint | |
| Opt-in header | |
| Credential header | |
当您没有API密钥时,可通过MPP挑战流程使用此技能访问Codex Supergraph。
| 项目 | 详情 |
|---|---|
| HTTP端点 | |
| 选择加入请求头 | |
| 凭证请求头 | |
How it works
工作原理
- Send a GraphQL query with (no credential).
X-Codex-Payment: mpp - Server returns with
402 Payment Requiredchallenges.WWW-Authenticate: Payment ... - Client solves one challenge and retries with both and
X-Codex-Payment: mpp.Authorization: Payment <credential> - Server returns GraphQL data + header.
Payment-Receipt
- 发送带有的GraphQL查询(无需凭证)。
X-Codex-Payment: mpp - 服务器返回状态码,同时附带
402 Payment Required挑战信息。WWW-Authenticate: Payment ... - 客户端完成一项挑战后,重新发送请求,同时携带和
X-Codex-Payment: mpp请求头。Authorization: Payment <credential> - 服务器返回GraphQL数据以及请求头。
Payment-Receipt
Constraints
约束条件
- Query only. Mutations and subscriptions return in MPP mode.
403 - If a valid API key or bearer token is also present, API auth takes precedence.
- 仅支持查询。在MPP模式下,变更(mutation)和订阅(subscription)操作会返回状态码。
403 - 如果同时存在有效的API密钥或Bearer令牌,则API身份验证优先生效。
Rules
规则
- Never print raw credentials.
- Only use MPP for operations.
query - Before constructing any query, read below for the correct GraphQL schema. Do not guess query or field names.
references/query-templates.md
- 切勿打印原始凭证。
- 仅对操作使用MPP。
query - 在构建任何查询之前,请阅读下方的以获取正确的GraphQL schema。请勿猜测查询或字段名称。
references/query-templates.md
References
参考文件
| File | Purpose |
|---|---|
| ../codex-supergraph/references/query-templates.md | GraphQL query schema and examples — read before constructing queries |
| ../codex-supergraph/references/gotchas.md | Common query failure points |
| references/gotchas.md | MPP-specific failure points |
| rules/wallets.md | Wallet setup: tempo wallet/request (Tempo) |
| references/mpp-flow.md | Auth matrix, challenge details, error codes |
| 文件 | 用途 |
|---|---|
| ../codex-supergraph/references/query-templates.md | GraphQL查询schema及示例 — 构建查询前请务必阅读 |
| ../codex-supergraph/references/gotchas.md | 常见查询失败点 |
| references/gotchas.md | MPP特有的失败点 |
| rules/wallets.md | 钱包设置:Tempo钱包/请求(Tempo) |
| references/mpp-flow.md | 身份验证矩阵、挑战详情、错误代码 |