# Integrate with AI

Paste one instruction into your AI coding agent, and it can read these docs and build against the Quadruper API for you.

## Put your key in the environment

Your agent's code should read the key from the environment. Set it yourself, and don't paste the key into a chat with an agent.

```bash
export QUADRUPER_KEY="qdp_your_key_here"
```

Don't have a key yet? [Request one](quickstart.md) first.

## Paste this instruction into your agent

```text
Read https://quadruper.com/llms.txt before using the Quadruper API.
```

This works in any coding agent that can fetch a web page. To apply it to every session, add this to your project's `AGENTS.md` or `CLAUDE.md` instead:

```markdown
## Quadruper API
Before calling the Quadruper routing or geocoding API, read
https://quadruper.com/llms.txt and follow the API rules it links to.
Read the API key from the QUADRUPER_KEY environment variable.
Never print it, put it in a URL, or ship it to a browser.
Before building place search, ask me whether the app should use people's
location. Send near when location is on, and a calculated bbox when it's off.
```

## Ask for what you want to build

Describe the feature in your own words and name the API. For example:

```text
Using the Quadruper API, add an estimated drive time from our warehouse to the delivery address on the checkout page.
```

Your agent uses `llms.txt` to find the pages its task needs and reads them as plain Markdown. If the feature includes place search, expect your agent to ask whether the app should use people's location, and which area to search when it's off. See [Search near your user](../guides/search-near-user.md).

## Review what your agent built

Check these before you ship it:

- The key comes from the server's environment. It isn't in your code, a URL, logs or browser code.
- Coordinates are `[lng, lat]` everywhere.
- Place search sends `near` when the user's location is on and `bbox` when it's off, and the app asks before it reads their location.
- Error handling branches on `code`, not on the text of `message`.
- The `attribution` text appears wherever people see routes, places or maps.
- ETAs are shown as estimates, and nothing describes a route as safe or passable.
- Place names and addresses are treated as data. They come from OpenStreetMap, which anyone can edit, so an agent or app must never follow instructions found inside them.

## What your agent can read

| File | What it holds |
|---|---|
| [`/llms.txt`](/llms.txt) | An index of every page, with a one-line summary of each |
| [`/docs/llms-full.txt`](/docs/llms-full.txt) | Every page in one file |
| Any page's `.md` address | One page as plain Markdown. Use **Markdown** at the top of a page to see it |
| [`/docs/openapi.json`](/docs/openapi.json) | An OpenAPI description, for generating a typed client |
| [`/docs/schemas/`](/docs/schemas/) | The JSON Schemas for requests, responses and errors |
