Pull this API's OpenAPI, operations, scores and pricing into your own code or AI agent
with a free APIs.io key —
sign in with
GitHub,
Google or
LinkedIn.
No form to fill in; signing in shares your email address with us (Privacy).
Calls without X-API-Key need no key. Calls with it need a paid plan — get a key.
Get an API key
Free tier, no form to fill in. Signing in shares your email address with us — we
store it to create your key and to recognise you if you sign in with another
provider. By signing up you are subscribing to the APIs.io and API Evangelist
newsletters — you can unsubscribe from any issue. See our
Privacy Policy and Terms.
openapi: 3.2.0
info:
title: X402 Git Internal API
version: 0.0.1
summary: Paid access to private git repos over x402/USDC, for humans and agents.
description: 'Every creator and buyer capability is an authenticated JSON endpoint before it is a web page (D9); the web app calls these same routes.
**Money.** Every amount is micro-USDC (6 decimals) encoded as a decimal integer string: `"9000000"` is $9.00. Never a JSON number, because a JSON number is a double.
**Errors.** Every error on every route is `{ code, message, docs_url, details? }` from the catalogue below.
**Payment.** x402 v2, `exact` scheme, USDC on Base. Access is granted only after the facilitator''s `settle` returns a transaction hash.'
license:
name: AGPL-3.0-only
identifier: AGPL-3.0-only
contact:
name: X402 Git
email: abuse@x402git.com
url: https://x402git.com/abuse
x-guidance: Every listing is a private git repository sold as a zip over x402 (USDC on Base). Read the free manifest at GET /api/label/{owner}/{slug} first; GET /api/r/{owner}/{slug} answers 402 with the price and the exact requirement to sign, and 200 with a signed download URL once the payment settles. Echo extra.quote_id as X-Quote-Id and extensions.bazaar in the payment payload. The full procedure is at https://x402git.com/.well-known/agent-skills/buy-a-repo/SKILL.md; the same tools are an MCP server at https://x402git.com/api/mcp. Every live resource is listed at https://x402git.com/.well-known/x402.
servers:
- url: https://x402git.com
tags:
- name: Internal
description: Webhooks and cron. Not for callers.
paths:
/api/webhooks/github:
post:
operationId: postApiWebhooksGithub
summary: GitHub webhook
tags:
- Internal
description: FR-8. `push` (version tags), `release` (published), `installation` and `installation_repositories`. The signature is verified over the raw body; deliveries older than 5 minutes are refused; `X-GitHub-Delivery` is deduplicated; the listing is resolved by installation and repo id, never by name. Every outcome after a valid signature is a 2xx, so a failure never teaches GitHub to disable the hook.
security: []
responses:
'200':
description: 'Handled: a release was cut, listings were retired, or the delivery was a duplicate.'
'202':
description: 'Accepted but not acted on: unknown listing, stale delivery, ignored event, or a refusal such as `version_exists`.'
'401':
description: '`invalid_signature` — The wallet signature is missing, malformed, expired or already used.'
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
examples:
invalid_signature:
value:
code: invalid_signature
message: The wallet signature is missing, malformed, expired or already used.
docs_url: https://x402git.com/docs/errors#invalid_signature
/api/cron/sweep:
get:
operationId: getApiCronSweep
summary: Daily sweep
tags:
- Internal
description: FR-26 / FR-28. Vercel Cron.
security: []
responses:
'200':
description: Swept
/api/cron/reconcile:
get:
operationId: getApiCronReconcile
summary: Daily reconciliation
tags:
- Internal
description: FR-28. Reconciles the receiving address's on-chain balance and every recorded tx hash against chain. Variance halts sweeps.
security: []
responses:
'200':
description: Reconciled
components:
schemas:
ErrorCode:
type: string
enum:
- insufficient_balance
- expired_authorization
- replay
- settlement_pending
- settlement_timeout
- authorization_mismatch
- price_changed
- sanctioned_counterparty
- listing_not_ready
- licence_block
- scan_failed
- version_exists
- description_missing
- retired
- not_entitled
- derivative_of
- public_repo
- invalid_key
- insufficient_scope
- step_up_required
- terms_version_stale
- payout_address_unverified
- invite_required
- invalid_signature
- rate_limited
- repo_too_large
- too_many_unpublished
- blocked_jurisdiction
- paused
- invalid_request
- not_found
- internal
description: The PRD §9 error catalogue.
Error:
type: object
properties:
code:
$ref: '#/components/schemas/ErrorCode'
message:
type: string
docs_url:
type: string
details: {}
retry_after_seconds:
type: integer
minimum: 0
maximum: 9007199254740991
required:
- code
- message
- docs_url
additionalProperties: false
description: Every error on every route. `docs_url` anchors into /docs/errors.
examples:
- code: invite_required
message: A valid invite code is required to register through the API.
docs_url: https://x402git.com/docs/errors#invite_required
securitySchemes:
apiKey:
type: http
scheme: bearer
description: '`Authorization: Bearer <key>`. Scoped (`listings:write`, `earnings:read`); a bearer key cannot move money (FR-26) and cannot destroy data without a step-up signature (FR-5).
There are two kinds. Every route that takes this scheme accepts either:
- **Agent key**, `x4c_live_…` — long-lived, one per creator, shown once when it is issued and never again, rotatable without the old key (`POST /api/auth/rotate-key`). This is the one an agent holds; it is the only one you can be given.
- **Session key**, `x4s_live_…` — minted for a browser session when a creator signs in to the website, never shown to anyone, expires with the session and dies on sign-out. It exists because the site calls these same endpoints (D9).'
walletSignature:
type: apiKey
in: header
name: X-Wallet-Signature
description: '`<address>.<nonce>.<eip191_signature>` over the message from GET /api/auth/challenge (FR-20). Single use, 5-minute expiry. Without it, /api/r quotes the new-buyer price and /api/v returns version data only.'
externalDocs:
url: https://github.com/pcmarts/x402git
description: Source code and security policy