360 Secure SkillHub
360 安全技能中心

Codex Agentic Gateway

当 Codex Supergraph GraphQL 端点返回 402 Payment Required 时,按其 MPP 挑战流程构造付费凭证并重试查询,实现无需 API key 的按次付费访问;仅支持 query,mutation 与 subscription 会被拒绝。所引用的一份查询模板参考文件在包内缺失。

分类:数据
nealo
nealo
热度 33.85
最近更新 2026-06-10 05:49:30

安装

发给 Agent
帮我安装这个技能:npx secure-skills-cli add nealo/codex-gateway
兼容性
通用兼容
联网要求
需要联网
数据出网
必须出网
Metadata
name
codex-gateway
description
Use when the user wants to query the Codex Supergraph and the server returns a 402 challenge. Pays per query via the MPP 402 challenge flow. Only supports queries, not mutations or subscriptions.
metadata
{"author":"codex-data","version":"1.0"}

Codex Machine Payment Protocol (MPP)

Use this skill when the Codex Supergraph returns a 402 Payment Required response. The MPP challenge flow lets you pay per query without needing an API key. For higher volume, get an API key at dashboard.codex.io/signup — see docs.codex.io for details.

HTTP endpoint https://graph.codex.io/graphql
Credential header Authorization: Payment <base64url-credential>

How it works

  1. Send a GraphQL query (no credential).
  2. Server returns 402 Payment Required with WWW-Authenticate: Payment ... challenges.
  3. Client solves one challenge and retries with Authorization: Payment <credential>.
  4. Server returns GraphQL data + Payment-Receipt header.

Constraints

  • Query only. Mutations and subscriptions return 403 in MPP mode.
  • If a valid API key or bearer token is also present, API auth takes precedence.

Rules

  • Never print raw credentials.
  • Only use MPP for query operations.
  • Before constructing any query, read references/query-templates.md below for the correct GraphQL schema. Do not guess query or field names.

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

Links