<!-- https://developers.silktide.com/guides/build-with-a-coding-agent | Get started -->

# Build with a coding agent

Coding agents such as Cursor, Claude Code and Codex write better code against the Silktide API when they read these docs instead of guessing. Every page here is also plain Markdown, and the whole API is in one OpenAPI file, so an agent can read exactly what you would.

This page is about writing code that calls the API. To work with your Silktide account from an AI client instead, connect it through MCP: see [Connect Claude, ChatGPT or Cursor](https://developers.silktide.com/guides/connect-an-ai-client.md).

## Paste this into your project

Most coding agents read a file of project instructions, usually `AGENTS.md` or, for Claude Code, `CLAUDE.md`, at the root of your repository. Add this to it, and change the host to your account's region:

```markdown
## Silktide API

This project calls the Silktide REST API. Read its docs before writing or changing code that calls it; do not guess field names.

- Docs: https://developers.silktide.com. Every page is Markdown too: add `.md` to its URL, or send `Accept: text/markdown`.
- Index of every page: https://developers.silktide.com/llms.txt. All of it in one file: https://developers.silktide.com/llms-full.txt.
- OpenAPI 3.1: https://developers.silktide.com/v1/openapi.json.
- Host: https://api.eu.silktide.com. Our account is in the EU region, and a key works only on its own region's host (US is api.us.silktide.com, Australia is api.au.silktide.com).
- Authentication: send `Authorization: silktide token=$SILKTIDE_API_KEY`. The key is in the `SILKTIDE_API_KEY` environment variable. Never write it into code, logs or anything that runs in a browser.
- Errors: read `error.type` and `error.message` (https://developers.silktide.com/v1/concepts/errors). Results queries can answer `200` with an `error` body, so check for `error` before reading `result` (https://developers.silktide.com/v1/concepts/results).
- Rate limits: on `429` or `503`, wait for the `Retry-After` header before retrying (https://developers.silktide.com/v1/concepts/rate-limits).
- Changes: https://developers.silktide.com/v1/changelog. Avoid anything marked Deprecated or Beta.
```

The host is the one line to change. If you are not sure of your region, see [Find your region](https://developers.silktide.com/guides/quickstart.md#find-your-region).

## What the agent gets from it

- **Exact shapes.** Each operation's page lists every field, with types and examples, and so does the OpenAPI file. An agent that reads them stops inventing fields.
- **Small reads.** `llms.txt` lists every page with a one-line description, so an agent can fetch only the pages it needs instead of the whole site.
- **The same rules your code needs.** Errors, rate limits and versions are written once, in [Concepts](https://developers.silktide.com/v1/concepts/errors.md), and the snippet links to them.

## Keep the key out of the agent's reach

The agent never needs the key itself, only the name of the variable that holds it. Keep the key in your environment or your secret manager, not in `AGENTS.md`, and not in a prompt. A key can do anything an account administrator can, so treat it like a password; see [Authentication](https://developers.silktide.com/guides/authentication.md).
