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

# Build with an AI agent

> Give your coding agent clear instructions and check the code it writes.

Give your coding agent one task, such as reading a profile or posting an image as a story. Include the matching V3 guide and API reference. Keep secrets in your app's settings or secret store, outside prompts and examples.

For setup, see [Agent skills](https://docs.ofauth.com/v3/agents/skills.md), [Add project context](https://docs.ofauth.com/v3/agents/project-context.md), and [OFAuth MCP server](https://docs.ofauth.com/v3/agents/mcp.md).

## Skills, context, and tools

A **skill** gives the agent instructions for a task. **Project context** is a set of notes about your app and its files. An **MCP server** lets an AI client call account tools after you approve access.

![Skills give task instructions. Project notes explain your app. MCP connects an AI client to account tools after you approve access. Reading docs alone does not give access to accounts.](https://mintcdn.com/ofauth/VVqOdSxbrh7mDF0M/images/v3/agent-toolkit.svg?fit=max\&auto=format\&n=VVqOdSxbrh7mDF0M\&q=85\&s=c61cc8110bd2a295a35baf628a8194fb)

## Separate documentation from account access

An agent can read guides and API fields to write code without accessing your accounts. A documentation MCP server gives it reference material. It does not give the agent an access token or permission to act on accounts.

To run the code, put the app's client ID and secret in its server settings. Use the values for the mode you want, such as Sandbox. Then complete the account approval flow. Start with Sandbox and check the result before using real accounts.

If the agent can run commands, keep secrets in the server settings. The code still needs the correct token, permissions, and linked account ID for each request.

Use an [official V3 SDK](https://docs.ofauth.com/v3.md#official-sdks) for account approval, API requests, pagination, and errors.

## Choose the right references

| Your agent needs to… | Start here |
| - | - |
| Link an account and get tokens | [quickstart](https://docs.ofauth.com/v3/setup/quickstart.md), then [Authorize](https://docs.ofauth.com/v3/api-reference/link/authorize.md) and [Tokens](https://docs.ofauth.com/v3/api-reference/link/tokens.md) |
| Find request methods, URLs, fields, and permissions | [API overview](https://docs.ofauth.com/v3/api-reference.md) and the selected operation's input and response fields |
| Read every item in a list | The operation's response fields and [Pagination](https://docs.ofauth.com/v3/reference/pagination.md) |
| Upload and publish media | [Upload media](https://docs.ofauth.com/v3/guides/how-to/upload-media.md), [Media references](https://docs.ofauth.com/v3/guides/media-items.md), and the content operation |
| Receive events | [Set up webhooks](https://docs.ofauth.com/v3/guides/webhook-setup.md) and [Verify and handle webhooks](https://docs.ofauth.com/v3/guides/webhook-handler.md) |

## Make the task explicit

For example:

```text theme={null}
Implement posting one existing Vault image as a story with OFAuth V3.
Use the official TypeScript SDK 4.x and the V3 Post a story guide.
Call client.access.stories.create with the documented mediaItems input.
Read ACCESS_TOKEN and LINKED_ACCOUNT_ID from backend configuration.
Use an image ID belonging to that linked account.
Handle OFAuthAPIError and preserve the returned story ID.
Do not repeat a write automatically if its outcome is unknown.
Show the request, expected response fields, required scopes, and failure cases.
Do not include real secrets in code, tests, logs, or prompts.
```

Use only fields and operations listed in the V3 reference. If one is missing, follow a documented alternative or ask support how to complete the task.

## Check the generated integration

* Use the SDK method shown in the guide. Check its inputs and response against the API reference.
* To get, refresh, or revoke tokens, send the client ID and secret with HTTP Basic and use form fields. For Access and Vault+, send the access token and linked account ID.
* Ask for the permissions the operation needs. The token and account ID must come from the same account approval and mode, such as Sandbox.
* Read the operation's response fields. Profiles are returned directly. Access lists and linked-account lists use different fields for pages.
* Use the right kind of ID. A linked account ID selects the creator. An OnlyFans user ID selects the fan who receives a message.
* Check webhook signatures against the original request body before using event data. Return the exact text requested by a signed verification challenge.
* If you do not know whether a change succeeded, check before sending it again. Send only one refresh request at a time for each saved refresh token.

Run the code in Sandbox and check how it handles failures. Then use Test with an account you control. Follow [Go live](https://docs.ofauth.com/v3/setup/integration-checklist.md) before using customer accounts.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.