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

# Agent Skill

> Use AirGraphic from Claude, ChatGPT, Codex, OpenClaw, Hermes, or any AI agent.

AirGraphic is built to be driven by an agent. Hand your assistant one of
the prompts below and it will set itself up, call the API, and return a
finished infographic.

## Install

Pick whichever path fits the agent you're using.

### Paste a prompt

The fastest path. Copy one of these into Claude, Claude Code, ChatGPT,
Codex, OpenClaw, Hermes, or any other agent that can read URLs and call
HTTP APIs.

**One-shot generation:**

```text docs-example: agent-prompt-now theme={null}
Use AirGraphic to turn this link into a LinkedIn carousel:

[paste your link]

Docs: https://docs.airgraphic.io
Get an API key: https://airgraphic.io/app/api-keys
```

**Permanent setup:**

```text docs-example: agent-prompt-setup theme={null}
I want to use AirGraphic to make infographics from links I share with you.

Read https://docs.airgraphic.io/llms.txt to learn how the API works.

I'll give you an API key from https://airgraphic.io/app/api-keys.

From then on, when I share a link or describe an idea, generate an on-brand
infographic for me.
```

The setup prompt points the agent at our `llms.txt`, which is the
LLM-friendly index of every doc page in markdown form. Most modern agents
will fetch it, derive the request shape from the OpenAPI spec, and be
ready to call AirGraphic on the next user message.

### Drop in the skill file

For agent hosts that load YAML-frontmatter skills (Claude projects,
Cursor rules, custom agent SDKs), grab the canonical skill file:

[docs.airgraphic.io/agent-skill.md](https://docs.airgraphic.io/agent-skill.md)

It contains the install, authentication, request shape, and trigger
patterns in one document the agent can load.

## Authentication

Create a key at [airgraphic.io/app/api-keys](https://airgraphic.io/app/api-keys)
and expose it to your agent. Most users set an environment variable:

```bash theme={null}
# docs-example: set-api-key
export AIRGRAPHIC_API_KEY="ag_your_api_key"
```

Keys begin with `ag_`, inherit your workspace plan and rate limits, and
can be revoked from the same page at any time.

## Compatible agents

AirGraphic works with any agent that can read a URL and make an HTTP
call. The skill has been tested with:

* **Claude** and **Claude Code**
* **ChatGPT** and **OpenAI Codex**
* **OpenClaw**, **Hermes**, and other autonomous agent platforms
* **Cursor**, **Windsurf**, and other agentic IDEs
* Custom agents built on the Anthropic, OpenAI, or AI SDK clients

If your agent can fetch `https://docs.airgraphic.io/llms.txt` and send a
`Bearer` header, it can use AirGraphic.

## Request pattern

The agent should `POST /api/generate`, then poll `GET /api/jobs/{id}`
until the status is terminal.

```js theme={null}
// docs-example: agent-fetch
const response = await fetch("https://airgraphic.io/api/generate", {
  method: "POST",
  headers: {
    authorization: `Bearer ${process.env.AIRGRAPHIC_API_KEY}`,
    "content-type": "application/json"
  },
  body: JSON.stringify({
    sourceUrl: "https://example.com/post",
    aspectRatio: "4:5",
    outputFormat: "png",
    outcome: "linkedin_carousel_slide"
  })
});

const job = await response.json();
```

Poll `/api/jobs/{jobId}` with the same bearer key every 2.5 seconds
until the status is `completed`, `failed`, or `refunded`.

## What an agent can ask for

Pick one primary source per request:

* A public URL (article, YouTube, TikTok, Instagram, LinkedIn, X, Reddit)
* Pasted text
* A PDF, PPTX, or image upload

Optional brand and output hints:

* `brandUrl` — any public site; AirGraphic extracts fonts and palette
* `brandProfileId` — a saved brand from the user's workspace
* `aspectRatio` — `9:16`, `1:1`, `4:5`, `16:9`
* `outputFormat` — `png`, `jpeg`, `webp`
* `outcome` — target surface (LinkedIn carousel, Instagram post, blog header, etc.)
* `styleNotes` — short free-form styling guidance
* `referenceImage` — for style matching or as an explicit visual asset

See the full schema in the [Reference](/reference) and in the
[OpenAPI spec](https://airgraphic.io/openapi.json).

## Example agent conversations

Once the skill is loaded, these all work:

* "Make me a LinkedIn carousel from this Substack post: \[URL]"
* "Turn this PDF into a 1:1 Instagram post in Acme's brand"
* "Generate a story-format infographic on Q3 trends using these stats: …"
* "Re-run that same generation but in Stripe's brand colors"

The agent picks the right source field, fills in sensible defaults
(`outcome` from the user's intent, `aspectRatio` from the target
surface), calls the API, polls until the image is ready, and returns the
`imageUrl`.

## Links

* [Quickstart](/quickstart) — humans calling the API directly
* [Reference](/reference) — full API schema and rate limits
* [Pricing](/pricing) — plans, credits, and per-key rate limits
* [Source skill file](https://docs.airgraphic.io/agent-skill.md) — markdown version of this page
* [llms.txt](https://docs.airgraphic.io/llms.txt) — LLM-friendly index of all docs
