RailbedDocs

Build with AI agents

Everything in these docs is available to AI assistants and coding agents: llms.txt, a Markdown copy of every page, a structured index, and WebMCP tools on railbed.io and in the dashboard.

Give your assistant the docs

Point your coding assistant at one of these, depending on how much context it can take:

ResourceWhat it is
/docs/llms.txtA summary of the API and its rules, with a link to every page. Start here
/docs/llms-full.txtEvery docs page in one Markdown file
/docs/<page>.mdAny page as Markdown: add .md to its path, as in /docs/quickstart.md. The overview is /docs/index.md
/agents/docs.jsonA structured index: every page, section and endpoint, with links

Each page also has Copy page for AI in its sidebar, which copies the page's Markdown for pasting into a chat.

A prompt that works well
Read https://railbed.io/docs/llms.txt and the pages it links to that you need.
Then add Railbed card checkout to this app: create a checkout session on the server
when the user clicks Buy, redirect to its url, and fulfil the order from a verified
payment.paid webhook. Use my test key from RAILBED_SECRET_KEY and my webhook secret
from RAILBED_WEBHOOK_SECRET. Deduplicate on the event id.

Rules worth giving an agent

These are the mistakes that matter most in a payments integration. They're in llms.txt too.

  • Call the API only from a server, with the key in an environment variable. There is no publishable key.
  • Fulfil only when a payment is paid, confirmed by a verified webhook or GET /v1/payments/:id. Never from the buyer's return to success_url.
  • Verify webhook signatures against the raw body, and deduplicate on the event id.
  • Send an Idempotency-Key with every create.
  • Treat held as not paid, and expired as possibly paid later.
  • Start in Test mode (rb_test_… keys) and simulate outcomes; no money moves.

WebMCP tools

WebMCP lets a web page offer tools to an AI agent working in the visitor's browser, so the agent can act through the page's own logic instead of reading the screen. Railbed's pages offer tools in browsers that support it; elsewhere nothing changes.

On railbed.io and these docs

Every page on railbed.io, including these docs, offers tools for learning about Railbed and building with it. All are read-only except the two that open signup or login.

ToolWhat it does
railbed_docs_searchSearch the developer docs; returns the best matching sections with links
railbed_docs_readA docs page, or one section of it, as Markdown
railbed_api_referenceEvery API endpoint with its method, path and reference link, plus the base URL and the rules for authentication, idempotency, money and errors
railbed_webhook_referenceThe webhook event types, when each is sent, the signature scheme and the retry schedule
railbed_code_samplesThe docs' code examples, filtered by topic and language
railbed_overview, railbed_faq, railbed_search, railbed_read_page, railbed_contactWhat Railbed is, the FAQ, and the company and legal pages
railbed_start_signup, railbed_open_loginTake the visitor to signup (email optionally filled in) or login. Nothing is submitted for them

In the dashboard

When a merchant is signed in, the Developers and Integrations pages offer tools that work on their account, in the mode the dashboard is in (Test or Live). They run with the merchant's own session, in their browser, so an agent can do only what the merchant could.

ToolPageWhat it does
railbed_developer_statusDevelopersThe mode, the setup steps done so far, and a summary of keys and endpoints
railbed_list_api_keysDevelopersThe keys, masked (rb_test_••••••••3f9a), with when each was created and last used
railbed_list_webhook_endpointsDevelopersEndpoints with their addresses, labels, events and latest delivery. Signing secrets are never included
railbed_list_webhook_deliveriesDevelopersAn endpoint's recent deliveries: status, attempts, your server's answer and, if asked, the body sent
railbed_send_test_webhookDevelopersSend a signed test event to an endpoint and report how it answered. Test endpoints take any event type; Live endpoints take ping only
railbed_prepare_api_keyDevelopersOpen Create key with a name filled in. The merchant creates it; the secret is shown only to them
railbed_prepare_webhook_endpointDevelopersOpen Add endpoint with the address, description and events filled in, for the merchant to review and save
railbed_open_webhook_deliveriesDevelopersOpen an endpoint's delivery log, optionally filtered to failed or retrying deliveries, so the merchant can resend
railbed_list_integrationsIntegrationsThe ways to take payments (links, checkouts, the API, store plugins), their status and where to set each up
railbed_list_card_providersIntegrationsThe card providers Railbed routes to, with their status and minimum amounts (in Test mode, the fixed test list)

Some things are deliberately left to the merchant. Tools never return a secret key or a signing secret, and they never create or revoke keys, roll secrets, remove endpoints or resend real events: those open the dashboard's own dialog for the merchant to confirm, or aren't offered at all.

Updated · This page as Markdown