# Build with AI

> llms.txt, Markdown pages, a ready-made prompt and a read-only MCP server for Claude Code, Cursor and other assistants.

These docs are designed to be read by your AI coding assistant as well as by you. Pick whichever fits your tool.

### Paste this prompt

Works in Claude Code, Cursor, Windsurf, GitHub Copilot, ChatGPT or Claude.ai. Replace the last line with your task.

**Prompt — Prompt**

```text
I'm integrating Fina (https://fina.do) into my project.
Before writing any code, read the full developer docs: https://fina.do/llms-full.txt
Use the OpenAPI spec as the source of truth for request and response shapes: https://fina.do/api/wallet/v1/openapi.json (Fina Pay).
Storefront and other APIs list their own spec in https://fina.do/llms.txt.

Rules:
- Keep the secret key (sk_live_…) on the server, read it from the FINA_SECRET_KEY env var, never commit it.
- Amounts are integers in minor units (centavos). Never use floats for money.
- Use my order id as `reference` so retries never create duplicate charges.
- Verify the x-fina-sig webhook signature exactly as the docs describe, and make the webhook handler idempotent.

Task: <describe what you want, e.g. "add a Pay with Fina button to checkout and mark the order paid on charge.paid">
```

### Connect the docs MCP server

A read-only [Model Context Protocol](https://modelcontextprotocol.io) server at `https://fina.do/api/developers/mcp` (Streamable HTTP, no auth). Tools: `search_docs`, `get_doc_page`, `list_apis`, `list_endpoints`, `get_endpoint` and `get_openapi_spec`. It only reads documentation — it never touches your account or your money.

**Install — Claude Code**

```bash
claude mcp add --transport http fina-docs https://fina.do/api/developers/mcp
```

**Install — Cursor**

```json
// .cursor/mcp.json (project) or ~/.cursor/mcp.json (global)
{
  "mcpServers": {
    "fina-docs": { "url": "https://fina.do/api/developers/mcp" }
  }
}
```

**Install — VS Code**

```bash
code --add-mcp '{"name":"fina-docs","type":"http","url":"https://fina.do/api/developers/mcp"}'
```

**Install — Other clients**

```json
{
  "mcpServers": {
    "fina-docs": { "type": "http", "url": "https://fina.do/api/developers/mcp" }
  }
}
```

### LLM-friendly files

| URL | What it is |
| --- | --- |
| [/llms.txt](https://fina.do/llms.txt) | Index in the [llmstxt.org](https://llmstxt.org) format: one link per page, to its Markdown version. |
| [/llms-full.txt](https://fina.do/llms-full.txt) | All the documentation in one Markdown file, endpoint tables included. |
| `/developers/<page>.md` | Any single page as Markdown, e.g. [/developers/webhooks.md](https://fina.do/developers/webhooks.md). |
| `…/openapi.json` | The machine-readable contract of each API (see [API reference](https://fina.do/developers/api-fina-pay.md)). |

Every page also has **Copy as Markdown**, **Open in Claude** and **Open in ChatGPT** buttons.

### Example: an agent that creates Fina Pay charges

If you build your own assistant with the Claude API, give it a tool that calls Fina Pay. Official Anthropic SDK, tool runner, model `claude-opus-5-5`. The tool only creates charges; the customer still confirms every payment in Fina with their PIN.

**Claude + Fina Pay — TypeScript**

```ts
// npm i @anthropic-ai/sdk zod
import Anthropic from '@anthropic-ai/sdk'
import { betaZodTool } from '@anthropic-ai/sdk/helpers/beta/zod'
import { z } from 'zod'

const client = new Anthropic() // reads ANTHROPIC_API_KEY

const createFinaCharge = betaZodTool({
  name: 'create_fina_charge',
  description: 'Create a Fina Pay charge and return the payment URL the customer must open to pay.',
  inputSchema: z.object({
    amount_minor: z.number().int().positive().describe('Amount in centavos (RD$1.00 = 100)'),
    description: z.string(),
    reference: z.string().describe('Unique order id; makes retries idempotent'),
  }),
  run: async (input) => {
    const res = await fetch('https://fina.do/api/wallet/v1/charges', {
      method: 'POST',
      headers: { Authorization: `Bearer ${process.env.FINA_SECRET_KEY}`, 'Content-Type': 'application/json' },
      body: JSON.stringify(input),
    })
    return JSON.stringify(await res.json())
  },
})

const finalMessage = await client.beta.messages.toolRunner({
  model: 'claude-opus-5-5',
  max_tokens: 16000,
  tools: [createFinaCharge],
  messages: [{ role: 'user', content: 'Charge RD$1,500 for order #42 (2 bags of coffee) and give me the link.' }],
})

console.log(finalMessage.content)
```

**Claude + Fina Pay — Python**

```python
# pip install anthropic requests
import os

import anthropic
import requests
from anthropic import beta_tool

client = anthropic.Anthropic()  # reads ANTHROPIC_API_KEY


@beta_tool
def create_fina_charge(amount_minor: int, description: str, reference: str) -> str:
    """Create a Fina Pay charge and return the payment URL the customer must open to pay.

    Args:
        amount_minor: Amount in centavos (RD$1.00 = 100).
        description: What the customer is paying for.
        reference: Unique order id; makes retries idempotent.
    """
    res = requests.post(
        "https://fina.do/api/wallet/v1/charges",
        headers={"Authorization": f"Bearer {os.environ['FINA_SECRET_KEY']}"},
        json={"amount_minor": amount_minor, "description": description, "reference": reference},
        timeout=15,
    )
    return res.text


runner = client.beta.messages.tool_runner(
    model="claude-opus-5-5",
    max_tokens=16000,
    tools=[create_fina_charge],
    messages=[{"role": "user", "content": "Charge RD$1,500 for order #42 (2 bags of coffee) and give me the link."}],
)
for message in runner:
    print(message.content)
```

Source: https://fina.do/developers#ai