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

# Building with AI

> Use AI coding assistants like Claude Code, Cursor, Codex, and GitHub Copilot to explore, build, and debug with the Daya API.

AI coding assistants can help you move faster with the Daya API when you give them the right docs, workflow context, and safety boundaries.

Use this page to give tools like Claude Code, Cursor, Codex, GitHub Copilot, and ChatGPT enough context to explain Daya concepts, generate integration code, write tests, and debug API or webhook issues.

<Warning>
  Do not paste production API keys, secrets, private credentials, customer data, wallet private keys, or sensitive financial information into AI assistants. Use sandbox credentials and test data while developing.
</Warning>

## Start with these resources

Share the most relevant Daya docs with your AI assistant before asking it to generate or edit code.

<CardGroup cols={2}>
  <Card title="Quick Start" icon="rocket" href="/quickstart">
    Create your first onramp or offramp and track the first deposit.
  </Card>

  <Card title="Authentication" icon="key" href="/authentication">
    Learn how to authenticate requests with API keys and idempotency keys.
  </Card>

  <Card title="Core Concepts" icon="book" href="/concepts/overview">
    Understand funding accounts, deposits, transfers, rates, and settlement.
  </Card>

  <Card title="Sandbox Testing" icon="flask" href="/limits/sandbox-testing">
    Test Daya flows safely before moving money in production.
  </Card>

  <Card title="Webhooks" icon="bell" href="/api-reference/webhooks/overview">
    Receive real-time event notifications from Daya.
  </Card>

  <Card title="Funding Accounts API" icon="code" href="/api-reference/funding-accounts/create-funding-account">
    Reference the primary endpoint for creating onramp and offramp flows.
  </Card>
</CardGroup>

<Info>
  If you are building with Daya Pro, also share the [Daya Pro overview](/pro/overview), [Daya Pro authentication guide](/pro/authentication), and the relevant Daya Pro endpoint docs.
</Info>

## Machine-readable docs

Use these files when an AI assistant needs a compact docs index, full docs context, or Daya-specific scenario guidance.

<CardGroup cols={3}>
  <Card title="llms.txt" icon="list" href="/llms.txt">
    Compact AI-readable index of Daya docs and endpoint pages.
  </Card>

  <Card title="llms-full.txt" icon="file-text" href="/llms-full.txt">
    Expanded context generated from the docs navigation.
  </Card>

  <Card title="AI Scenario FAQ" icon="circle-help" href="/llms-faq">
    Exhaustive Business API, Pro API, and combined-product scenarios for agents.
  </Card>
</CardGroup>

## Recommended workflow

<Steps>
  <Step title="Choose the Daya flow you are building">
    Be specific about whether you are creating customers, funding accounts, onramps, offramps, transfers, USD virtual accounts, webhooks, or Daya Pro trading flows.
  </Step>

  <Step title="Share the relevant docs">
    Give your assistant links to the quickstart, authentication guide, and the specific endpoint or concept pages for your flow.
  </Step>

  <Step title="Ask the assistant to inspect your project first">
    Have it identify your language, framework, existing API client patterns, environment variable conventions, and test setup before it writes code.
  </Step>

  <Step title="Build against sandbox">
    Use sandbox API keys, sandbox base URLs, test data, and simulated flows until your integration is ready for production.
  </Step>

  <Step title="Request tests and production checks">
    Ask for request validation, idempotency handling, webhook signature verification, retries, logging, and error handling.
  </Step>
</Steps>

## Use with AI coding assistants

<Tabs>
  <Tab title="Codex">
    Open your project in Codex, share the relevant Daya docs links, then ask Codex to inspect your codebase before making changes.

    A good starting prompt:

    ```text theme={null}
    I am integrating the Daya API into this project. Read the Daya quickstart, authentication guide, core concepts, and relevant endpoint docs. First inspect the codebase and explain the best integration point. Then propose the smallest implementation plan before editing files.
    ```
  </Tab>

  <Tab title="Cursor">
    Add the relevant Daya docs and endpoint pages to Cursor context, then ask Cursor to follow your existing API client and test patterns.

    A good starting prompt:

    ```text theme={null}
    Use the Daya API docs in context to implement this workflow. Follow the existing code style, keep secrets in environment variables, add tests, and use the sandbox base URL while developing.
    ```
  </Tab>

  <Tab title="Claude Code">
    Start Claude Code from your project root, provide the Daya docs links, and ask it to reason through the API flow before making file changes.

    A good starting prompt:

    ```text theme={null}
    I want to build a Daya integration in this repository. Read the Daya docs I provide, inspect the current architecture, and tell me where the API client, webhook handler, and tests should live before you implement anything.
    ```
  </Tab>

  <Tab title="GitHub Copilot">
    Use Copilot Chat with the relevant files and Daya docs open. Ask it to generate narrow changes, then review the code for secret handling and error handling.

    A good starting prompt:

    ```text theme={null}
    Using the Daya API docs, help me add this endpoint call to the selected file. Use environment variables for the API key, include an idempotency key for write requests, and return a typed error for failed responses.
    ```
  </Tab>
</Tabs>

## Example prompts

### Explore the API

```text theme={null}
I am building with the Daya API. Read the Daya quickstart, authentication guide, core concepts, and relevant endpoint docs. Explain the main Daya resources, the authentication model, the sandbox environment, and the recommended first integration path.
```

### Generate an integration

```text theme={null}
Using the Daya API docs, generate a [language/framework] implementation for [specific workflow]. Include authentication, idempotency for write requests, request validation, typed responses, error handling, and a simple test.
```

### Create a funding account

```text theme={null}
Help me implement a Daya funding account flow for [onramp/offramp]. Use the sandbox base URL, keep the API key in an environment variable, include an X-Idempotency-Key header, and show how to store the returned funding_account id.
```

### Implement webhooks

```text theme={null}
Help me implement Daya webhook handling in [framework]. Include signature verification, idempotent event processing, structured logging, retry-safe behavior, and tests for valid and invalid signatures.
```

### Debug an API error

```text theme={null}
I am calling the Daya API and getting this error: [paste sanitized error response]. Based on the Daya docs, explain the likely cause, the smallest fix, and what I should log or test to confirm it.
```

### Review an integration

```text theme={null}
Review this Daya integration for correctness, security issues, missing idempotency, missing webhook verification, weak error handling, sandbox/production mixups, and production readiness.
```

## What to include in your prompt

The more precise your prompt, the better your assistant's output will be.

| Include               | Example                                                   |
| --------------------- | --------------------------------------------------------- |
| Workflow              | "Create an onramp funding account and reconcile deposits" |
| Runtime               | "Node.js 20 with Express"                                 |
| Environment           | "Sandbox only"                                            |
| Daya docs             | "Quickstart, authentication, webhooks, and endpoint docs" |
| Existing code context | "Use the existing API client in `src/lib/api.ts`"         |
| Safety requirements   | "No production keys, no customer data, add tests"         |

## Common Daya tasks for AI assistants

Ask your assistant to help with focused tasks instead of broad, open-ended requests.

<AccordionGroup>
  <Accordion title="Set up a Daya API client">
    Ask the assistant to create a small client that reads `DAYA_API_KEY` and `DAYA_BASE_URL` from environment variables, sends the `X-Api-Key` header, and returns structured errors.
  </Accordion>

  <Accordion title="Add idempotency to write requests">
    Ask the assistant to add an `X-Idempotency-Key` header for create or transfer requests and explain when the same key should be reused.
  </Accordion>

  <Accordion title="Build a sandbox flow">
    Ask the assistant to use `https://api.sandbox.daya.co`, fake customer data, and sandbox-only keys while implementing and testing the first flow.
  </Accordion>

  <Accordion title="Implement webhook verification">
    Ask the assistant to implement Daya webhook signature verification before any event processing logic runs.
  </Accordion>

  <Accordion title="Write production readiness checks">
    Ask the assistant to check for missing logs, retries, idempotency, environment separation, test coverage, and secret handling.
  </Accordion>
</AccordionGroup>

## Security checklist

Before you paste context into an AI assistant or accept generated code, check that:

* Production API keys and webhook secrets are not included in prompts
* Customer personal information and sensitive financial data are removed
* API keys are loaded from environment variables or a secret manager
* Sandbox and production base URLs are clearly separated
* Write requests use idempotency keys where required
* Webhook handlers verify signatures before trusting event payloads
* Logs do not include full secrets, private credentials, or sensitive customer data

## Next steps

<CardGroup cols={2}>
  <Card title="Create your first flow" icon="rocket" href="/quickstart">
    Start with the Daya quickstart.
  </Card>

  <Card title="Review authentication" icon="key" href="/authentication">
    Learn how API keys and idempotency keys work.
  </Card>

  <Card title="Test in sandbox" icon="flask" href="/limits/sandbox-testing">
    Validate your integration before production.
  </Card>

  <Card title="Set up webhooks" icon="bell" href="/api-reference/webhooks/overview">
    Receive and verify Daya events.
  </Card>
</CardGroup>
