# Set up with an agent

> An AI agent can create the account, install Okidoki, check it and read the reports.

If you work with an AI agent, it can set up and read Okidoki for you. Everything a person can do in Okidoki, an agent can do: create the account, add the site, install, check that it works, set goals, make campaign links and read every report. You only tap once at the end, to make your passkey.

## The easiest way

Say this to ChatGPT, Claude, Lovable, Cursor or any agent that can browse and call APIs:

```text title="Say this to your agent"
Set up Okidoki analytics for my site. The instructions are at okidoki.sh/llms.txt
```

The agent reads [llms.txt](https://okidoki.sh/llms.txt), which tells it every step below.

## What the agent does

1. **Creates your account, your site and its own API key in one call.**

```bash
curl -X POST https://okidoki.sh/api/v1/start -H "Content-Type: application/json" \
  -d '{"email":"you@example.com","site":"mysite.com","timezone":"Europe/Stockholm"}'
```

2. **Installs Okidoki.** It gives your site builder the install sentence from `data.site.install.agent_prompt`, or puts the script tag in `<head>` itself if it edits your code.

3. **Checks that it works** with `GET /api/v1/sites/mysite.com/verify`, and fixes what the answer says until it says *Okidoki is working*.

4. **Gives you the claim link** from `data.claim_url`.

## The claim link

The claim link is how the account becomes yours. Open it, tap **See my answers**, and make a passkey with your face, fingerprint or PIN. You are signed in, and from then on you sign in at [okidoki.sh/login](https://okidoki.sh/login).

- The link works once, and for 30 days.
- Until you claim the account, Okidoki sends nothing to the email address the agent typed in.
- If nobody claims an account, a site it holds is not locked away: after two days, the real owner can add the site to their own account.

## If you already have an account

`POST /start` only creates new accounts. If you already have one, sign in, go to **Settings → Connections** and make a key under **Your AI agent** for the agent. See [API keys](https://docs.okidoki.sh/api/keys).

## Connect over MCP

In Claude and ChatGPT you add Okidoki as a connector with one address, `https://okidoki.sh/mcp`, and sign in to Okidoki. No key to copy. Agents that take a key, like Cursor, can send it as a header to the same address. See [MCP server](https://docs.okidoki.sh/mcp).

## Things to ask your agent

- *Add mysite.com to Okidoki and check that it works.*
- *How did last week go?*
- *Which pages do people leave from the most?*
- *Make a campaign link for our Instagram bio for the spring sale.*
- *Track signups as a goal.*
- *Make a share link for my co-founder.*

## Every answer has a sentence

Every API answer has a `message`: one plain sentence, like *Okidoki is working on mysite.com. The last visit was recorded just now.* Agents are told to repeat it as it is, so what they tell you comes from Okidoki and not from their imagination. Errors work the same way, and say what to do next.

## The privacy sentence

Installing only adds the tag. Once Okidoki is live, the agent may offer a separate, optional step: *Do you want me to add a line about Okidoki to your privacy policy?* If you say yes, it adds the ready sentence where your policy talks about analytics. If you say no, it leaves it. See [A sentence for your privacy policy](https://docs.okidoki.sh/privacy-policy).

## Safe by design

- A key can never do more than its owner. A read-only key cannot change anything.
- Keys are shown once and stored scrambled. Turn one off and it stops working at once.
- Agents never get data about single visitors, because Okidoki does not have any.

