The PDF As You Go HTTP API — base URL, no-auth model, one endpoint per operation, and x402 payment.
The HTTP API is for non-MCP integrations: scripts, backends, and any x402-aware HTTP client. It has identical capabilities and identical pricing to the MCP server — one flat $0.05 per operation.
Base URL
Section titled “Base URL”https://api.pdfasyougo.com/v1There is one endpoint per operation, for example POST /v1/merge and
POST /v1/watermark/text. The full list is in Operations & pricing.
No authentication
Section titled “No authentication”There is no Authorization header and no API key. Authentication and payment are the same thing:
each request is paid inline over x402, and a settled payment is the
authorization. See The 402 flow for exactly how a request is paid.
Request shape
Section titled “Request shape”- Method:
POST - Content type:
application/jsonfor URL/base64 inputs, ormultipart/form-datafor direct uploads. - Body: the operation’s parameters, including its file input(s).
curl -X POST https://api.pdfasyougo.com/v1/pages/rotate \ -H "Content-Type: application/json" \ -H "X-PAYMENT: <base64-encoded-payment-payload>" \ -d '{"file":"https://example.com/scan.pdf","pages":"1-3","degrees":90}'Response shape
Section titled “Response shape”A successful operation returns 200 OK with a JSON body containing a short-lived
download URL and light metadata, plus an X-PAYMENT-RESPONSE header
confirming settlement:
{ "output": { "url": "https://files.pdfasyougo.com/o/3f9a…?token=…", "expires_at": "2026-06-29T12:00:00Z", "pages": 12, "bytes": 98304 }, "operation": "pages.rotate", "cost": "0.05 USDC"}See Conventions for the common request/response details (file inputs, page-range syntax, idempotency) and Errors for failure handling.
Use an x402 client library
Section titled “Use an x402 client library”You can implement the 402 → sign → retry loop yourself, but it’s far
easier to use an x402 client — for example
x402-fetch in JavaScript/TypeScript, or an httpx
integration in Python. The HTTP quickstart shows both.
- The 402 flow — every field and header in the payment exchange.
- Conventions — shared request/response rules.
- Errors — status codes and error bodies.
- Operations — every endpoint with parameters and examples.