Reference

OpenAPI spec

Machine-readable OpenAPI 3.1 spec — feed it to your generator of choice to scaffold a typed client in any language.

The complete public API surface is published as an OpenAPI 3.1 spec at /api/openapi.json. It lives next to the API itself — every subdomain serves the same spec.

Raw JSON
/api/openapi.json
Pin to a deploy — the URL is stable.
Production base
https://api.key2pays.com
Live keys + real money.
Sandbox base
https://sandbox.key2pays.com
Test keys, no real money.

Interactive viewer

Below is the live spec rendered by Scalar — searchable, with try-it-now playground per endpoint. The spec is loaded from /api/openapi.json on the current host, so the environment dropdown matches the subdomain you're reading from.

Want it full-screen? Open /api-reference in a new tab.

Auto-generate a client

Until we ship official SDKs, you can scaffold a typed client in your language of choice straight from the spec:

bash
# TypeScript / Node — oazapfts (clean fetch wrapper, types from spec)
npx oazapfts https://api.key2pays.com/api/openapi.json src/lib/key2pay-client.ts

# PHP — openapi-generator
openapi-generator generate \
  -i https://api.key2pays.com/api/openapi.json \
  -g php \
  -o ./key2pay-php

# Python — openapi-python-client
openapi-python-client generate --url https://api.key2pays.com/api/openapi.json

# Postman / Insomnia — both import the spec via "Import → OpenAPI" UI.
The spec is hand-written (not zod-generated) so descriptions and examples are integrator-friendly. We bump info.version in lockstep with the Key2Pay-Version header — pin your generator to a version when you ship to production.