> ## Documentation Index
> Fetch the complete documentation index at: https://docs.zapyd.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Build with AI

> Give coding agents llms.txt, the docs MCP server, the OpenAPI spec and a ready-made prompt.

These docs are built so coding agents can read them. Give your agent the context below, and it can write a working Zapyd integration with the correct signing, base URLs and request bodies.

## Machine-readable docs

| Resource | URL | Use it for |
| - | - | - |
| Page index | `https://docs.zapyd.com/llms.txt` | A short map of every page with its description. Good first context for an agent. |
| Full docs | `https://docs.zapyd.com/llms-full.txt` | Every page in one Markdown file. Paste it into a chat or a project knowledge base. |
| Any page as Markdown | Add `.md` to a page URL, e.g. `https://docs.zapyd.com/guides/getting-started/quickstart.md` | Exact context for one task, without HTML. |
| OpenAPI spec | `https://docs.zapyd.com/api-reference-exchange/openapi.json` | Generating typed clients and request validation. |

Every page also has a **copy** menu at the top. Use it to copy the page as Markdown, or to open it in ChatGPT, Claude, Perplexity, Cursor or VS Code.

## Docs MCP server

The MCP server lets your agent search these docs while it works, so it doesn't rely on stale training data.

<Tabs>
  <Tab title="Claude Code">
    ```bash theme={"theme":{"light":"css-variables","dark":"css-variables"}}
    claude mcp add --transport http zapyd-docs https://docs.zapyd.com/mcp
    ```
  </Tab>

  <Tab title="Cursor">
    Add this to `.cursor/mcp.json`:

    ```json theme={"theme":{"light":"css-variables","dark":"css-variables"}}
    {
      "mcpServers": {
        "zapyd-docs": { "url": "https://docs.zapyd.com/mcp" }
      }
    }
    ```
  </Tab>

  <Tab title="VS Code">
    Add this to `.vscode/mcp.json`:

    ```json theme={"theme":{"light":"css-variables","dark":"css-variables"}}
    {
      "servers": {
        "zapyd-docs": { "type": "http", "url": "https://docs.zapyd.com/mcp" }
      }
    }
    ```
  </Tab>

  <Tab title="Other clients">
    Any MCP client that supports streamable HTTP can connect to `https://docs.zapyd.com/mcp`. You can also copy the URL from the **copy** menu on any page.
  </Tab>
</Tabs>

## Integration prompt

Copy this into your agent to start an integration. For one exact flow, such as USD to INR, the [Flow Builder](/flow-builder) has an **AI agent** tab with a prompt that lists every call in order. Each endpoint page in the API reference has its own prompt with the fields, errors and rules for that call.

<Prompt description="Integrate Zapyd" actions={["copy", "cursor"]}>
  Integrate the Zapyd API (stablecoin onramp and offramp) into this codebase's backend.

  First, ask me which flow to build, then read its guide (add `.md` to any docs URL for Markdown):

  * Onramp, fiat to USDC/USDT (USD or INR): `https://docs.zapyd.com/guides/payments/payins.md`
  * Offramp, USDC/USDT to fiat in a bank account: `https://docs.zapyd.com/guides/payments/payouts.md`, or `https://docs.zapyd.com/guides/payments/prefunded-payouts.md` to pay from a prefunded balance
  * Cross-border, fiat to fiat through USDC (onramp, then offramp): `https://docs.zapyd.com/guides/payments/cross-border-payments.md`
  * Onboarding: `https://docs.zapyd.com/guides/customers/overview.md` (India and USA KYC), `https://docs.zapyd.com/guides/customers/payout-only-onboarding.md` (beneficiaries in other countries)
    Also read `https://docs.zapyd.com/guides/development-and-testing/authentication.md` and `https://docs.zapyd.com/guides/development-and-testing/webhooks.md`. Field-level types are in `https://docs.zapyd.com/api-reference-exchange/openapi.json`.

  Hosts and modules:

  * Sandbox `https://sandbox.zapyd.com`, production `https://api.zapyd.com`. Same paths, separate credentials.
  * Path prefixes: `/cms/api/v1` customers, KYC, bank accounts and wallets; `/pis/api/v1` payins; `/pos/api/v1` payouts, prefunded payouts and India remittance; `/ren/api/v1` limits and EDD; `/org/api/v1` webhooks.

  Signing (every request):

  * Headers `X-API-KEY`, `X-TIMESTAMP` (Unix seconds, within 300 s, new per request) and `X-SIGNATURE` = Base64(HMAC-SHA256(key = API secret, message = apiKey + "|" + timestamp + "|" + canonicalBody)).
  * canonicalBody: JSON with keys sorted at every level, no whitespace, non-ASCII escaped as lowercase `\uXXXX` (Python `json.dumps(body, sort_keys=True, separators=(",", ":"))`). GET requests sign `{}`. Send the exact string you signed as the body.
  * Test vector: key `3f1b2c4d-5e6f-4a7b-8c9d-0e1f2a3b4c5d`, secret `test-secret-do-not-use`, timestamp `1735689600`. Signing `{}` gives `6sCtVSRQjU9+2/af8gdwUAvY1l6Ii6ENcbRfanPkhY0=`. Write this test before any API call.
  * Widget Initialize is the only exception: lowercase hex HMAC-SHA256 over the raw body followed by the timestamp.

  Rules:

  * Order of every flow: create the customer, verify KYC (`CUSTOMER` webhook `VERIFIED`), add a bank account for payouts (`BANK` webhook `VERIFIED`), check limits, create a quotation, fund it (the user pays fiat for a payin; you send crypto to the quotation's `wallet_address` for a payout), initiate, then track the order by webhook.
  * India payouts use a standard payout to a KYC-verified customer, or the remittance payout API (`/pos/api/v1/remittance-payout/...`) with a remitter living abroad. Payouts to every other country use payout-only onboarding and a standard payout with `transfer_purpose` and `is_self_transfer`.
  * Read assets, networks, payment methods and `required_risk_parameters` from the configuration endpoints. Send exactly the quotation's `sending_amount`, asset and network to its `wallet_address` before `expiry_time`; never hardcode or reuse an address.
  * Amounts are strings. Send a unique `client_reference_id` on customers and orders, and store it with every Zapyd ID.
  * Every response is `{status, message, data, err_code, errors}`. Branch on `err_code`. Retry only 429 and 5xx, with exponential backoff.
  * Webhooks: register one HTTPS URL with `POST /org/api/v1/organizations/api-webhooks`. Verify `X-TIMESTAMP` and `X-SIGNATURE` (signed like requests, with your own key and secret), return 2xx fast, and deduplicate on `id` + `event`. Credit a payin only on `SUCCESS`.
  * Keep the API secret and every Zapyd call on the server. Read `ZAPYD_API_KEY`, `ZAPYD_API_SECRET` and `ZAPYD_BASE_URL` from the environment.

  Build in this order: a typed client with the tested signer, the webhook endpoint, the flow as a state machine that advances on webhooks, then an end-to-end sandbox test that sets every status with the mock endpoints (`https://docs.zapyd.com/guides/development-and-testing/sandbox-testing.md`).
</Prompt>

## Tips for agent-written integrations

* **Check the signature first.** Have the agent write a unit test for the [test vector](/guides/development-and-testing/authentication#test-vector) before anything else. Most failed integrations are signing bugs.
* **Keep the agent on sandbox.** Give it only sandbox credentials. Use the mock status endpoints so it can test every final status.
* **Point it at the spec for types.** The OpenAPI file lists every required field and enum. Agents that read it make fewer validation mistakes than agents that guess from examples.
* **Review money paths yourself.** Read the code that moves funds, handles webhooks and retries orders yourself. Don't rely only on agent-written tests.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.