Skip to main content
LLM agents act through tools — JSON-schema-described functions the model can call. CreatorAudit ships a complete OpenAPI document, so you can generate those tool definitions instead of writing them by hand, then execute the calls the model picks.

The pattern

1

Fetch the contract

Download the OpenAPI spec from https://api.creatoraudit.com/v2/openapi.json (also linked from the API reference). It describes every endpoint, parameter, and response shape.
2

Generate tool schemas

Convert the operations you want to expose into your provider’s tool format. Each operation becomes one tool: the path and method are the call target; the parameters and request body become the input JSON schema. This works for Anthropic tool use, OpenAI function calling, and any generic function-calling runtime — they all consume JSON Schema.Start small. Expose a handful of read endpoints (/search, /overview, /accounts, /creators/top) before adding write endpoints (POST /accounts, POST /videos).
3

Execute calls with the bearer key

When the model calls a tool, issue the matching HTTP request with Authorization: Bearer YOUR_API_KEY, then return the JSON response to the model. Keep the key on your server — never expose it to the model’s context or to client-side code.

A minimal tool layer

The example below defines two read tools — search (calls GET /v2/search) and overview (calls GET /v2/overview) — and an executor that runs whichever tool the model picks. Responses are passed through verbatim, so you never hardcode fields that might drift.
These calls go to the CreatorAudit API, not the docs MCP. Mintlify’s /mcp searches the documentation; to call the API as MCP tools instead, see Connect via MCP.

What to get right in the loop

Keep YOUR_API_KEY on the server. The model’s context, tool arguments, and any client-side code should never see it.
  • Paginate in a loop. Collection responses carry pagination.next_cursor and pagination.has_next. Pass cursor back with limit (1–200) and keep going until has_next is false. Don’t make the model manage cursors — handle it in your executor and return aggregated results.
  • Parse RFC 9457 errors. On any 4xx/5xx, the body is application/problem+json with status, title, detail, and a machine-readable code. Branch on status for control flow and on code for specific handling, then hand the model a structured error it can reason about.
  • Log X-Request-ID. Capture the header on every call — success or failure — so any request can be traced. Quote it when you contact support.
  • Use Idempotency-Key on writes. POST /accounts, POST /videos, and POST /creators accept an optional Idempotency-Key header. Set a stable key per logical action so retries from an agent loop don’t create duplicates.

Next