# AI & Integrations

Use Relaycast from AI agents, coding assistants and no-code automation tools.


Relaycast is a plain REST API with JSON in and JSON out, so anything that can make an HTTP request can publish: an LLM agent with tools, a coding assistant writing an integration, or a workflow in a no-code tool. This section shows the quickest route for each.

## Choose an approach

| You want to... | Use | Guide |
| --- | --- | --- |
| Let an LLM publish posts as a tool call in your app | Function calling with JSON-schema tools | [Function Calling](/docs/ai/function-calling) |
| Teach a coding agent (Claude Code, Codex, Cursor and others) how to use the API | A skill or rules file | [Agent Skill](/docs/ai/agent-skill) |
| Give an assistant the docs as context | `llms.txt` and Markdown versions of every page | [llms.txt & Markdown Docs](/docs/ai/llms-txt) |
| Publish from a workflow without writing code | An HTTP request step in n8n, Make or Zapier | [No-code](/docs/ai/no-code) |

> [!NOTE]
> Relaycast doesn't have an MCP server or an official SDK yet. Everything in this section uses the REST API directly, which every agent framework and automation tool already supports.

## The three calls an agent needs

Almost every AI workflow uses the same three endpoints:

| Step | Endpoint | Why |
| --- | --- | --- |
| 1. Find accounts | `GET /v1/accounts` | Get the `id` of each account to post to. Only `active` accounts can be published to. |
| 2. Publish | `POST /v1/posts` | Send content, `targets` and either `publishNow: true` or `scheduledFor`. |
| 3. Check results | `GET /v1/posts/{id}` | Read each target's `status`, `externalUrl` or `errorMessage`. |

All three authenticate with the `x-access-key` header. See [Authentication](/docs/authentication).

## Guardrails for agents

Publishing is public and hard to undo, so put a few safety rails around any agent that can post:

- **Confirm before posting.** Have the agent show the final text, accounts and time, and wait for a human to approve, at least until you trust the workflow. Scheduling a post a few minutes out gives you a window to delete it from the dashboard.
- **Use idempotency keys.** Agents retry. Send an `Idempotency-Key` header derived from the task (for example the conversation or job ID) so a repeated tool call doesn't post twice. See [Idempotency & Retries](/docs/idempotency).
- **Keep the key server-side.** The access key belongs in your tool executor or workflow credentials, never in the prompt, the model's context or client code.
- **Use a dedicated key and project.** Give the agent its own access key, so you can revoke it independently and see its traffic in [Request Logs](/docs/logs). A separate project limits which accounts it can reach.
- **Feed validation errors back.** A `400 validation_error` lists problems per account and field. Returning that to the model lets it shorten text or fix options and try again.
- **Mind credits.** Every target costs a credit. An agent stuck in a loop can spend them, so cap retries. See [Credits & Usage](/docs/credits).

## What agents can't do through the API

Some things are dashboard-only, so plan for a human to do them:

- Connecting OAuth accounts (Bluesky is the exception, it can be connected with `POST /v1/accounts/bluesky`).
- Uploading files to the media library. Agents should pass public media URLs, or `media://` references a person has prepared.
- Editing, cancelling or deleting posts, and managing drafts, notifications, groups and collaborators.

## Next steps

- [Function Calling](/docs/ai/function-calling): ready-made tool definitions for OpenAI and Anthropic
- [Agent Skill](/docs/ai/agent-skill): a drop-in `SKILL.md`
- [API Reference](/docs/api): every endpoint in detail
