# AI agents (/en/integrate/ai-agents)

Every page on this site is available as plain markdown, plus a full-site export and the OpenAPI spec. Point your coding assistant at these instead of scraping HTML.

If you build with a coding assistant, give it the markdown sources rather than the rendered pages. Every documentation page serves clean markdown at a predictable URL, and the whole site is available as a single file. No HTML parsing, no scraping.

## Get one page as markdown [#get-one-page-as-markdown]

Every page has a **Copy Markdown** button under its title. It copies the whole page as markdown, ready to paste into a chat with your assistant. The **Open** menu next to it links the raw markdown file, and can open the page as a prompt in ChatGPT or Claude.

Tools that fetch pages themselves can skip the buttons. Append `.md` or `.mdx` to any documentation URL:

```bash
curl https://docs.xpay.app/en/integrate/idempotency.md
```

This works on every page in both languages. Swap the `en` prefix for `ar` to get the Arabic version. Sending `Accept: text/markdown` to the normal URL returns the same content, and each page carries a `<link rel="alternate" type="text/markdown">` tag in its head, so an agent can discover the markdown URL on its own.

## Get the whole site [#get-the-whole-site]

Three files cover the full documentation surface.

| File                                                    | What it contains                                                                                                                            |
| ------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------- |
| [`/llms.txt`](https://docs.xpay.app/llms.txt)           | An index of every page with its title, description, and URL. Start here.                                                                    |
| [`/llms-full.txt`](https://docs.xpay.app/llms-full.txt) | The guides and SDK reference as one markdown file. The API Reference is not inlined: use `/openapi.json` or a single page's `.md` for that. |
| [`/openapi.json`](https://docs.xpay.app/openapi.json)   | The machine-readable API specification: every endpoint, object, field, and enum.                                                            |

The API Reference pages are generated from the OpenAPI specification, and their markdown carries the same parameters, request bodies, and response fields the rendered pages show. A field typed as a top-level resource (Charge, Refund, Price) appears as a link to that object's page; every other nested shape is expanded inline.

## Which source to use [#which-source-to-use]

Pick based on how much context your tool can hold.

* **Building an integration**: load `/llms-full.txt` once and let the assistant search it.
* **Answering one question**: fetch the single page with `.md`, using `/llms.txt` to find the right URL.
* **Generating a client or validating requests**: use `/openapi.json` directly. It is the same specification the API Reference renders from, so it never drifts from these pages.

## Where to next [#where-to-next]

<Cards>
  <Card href="/integrate/object-model" title="Object model" icon="<Compass />" description="How Checkout Sessions, Payment Intents, Charges, and Refunds relate." />

  <Card href="/api-reference" title="API Reference" icon="<Braces />" description="Every endpoint and object, generated from the OpenAPI specification." />

  <Card href="/integrate/webhooks/event-reference" title="Event reference" icon="<Webhook />" description="Every webhook event, when it fires, and the object it carries." />

  <Card href="/integrate/idempotency" title="Idempotency" icon="<FileText />" description="Retry write requests safely with an Idempotency-Key." />
</Cards>