# Quickstart

> Create a FoodPerfect API key, connect an MCP client and make your first tool calls in five minutes.

Five minutes from zero to an agent that knows your restaurant.

## 1. Create an API key

1. Sign in at [app.foodperfect.ai](https://app.foodperfect.ai/signin). A new account starts with $3 of free balance.
2. Open **[Settings](https://app.foodperfect.ai/settings) → API Keys** and click **Create API Key**.
3. Give it a label (for example "Claude Code"), pick **Live**, optionally set an expiry, and choose scopes. **All MCP Tools** (`*`) is the simplest; **Read Tools** + **List Tools** (`get_*`, `list_*`) make a read-only key.
4. Click **Create Key** and copy it. It starts with `fp_live_` and is **shown only once**.

> [!WARNING]
> Treat the key like a password. Anyone holding it can act on your FoodPerfect account and spend its balance. Keep it in an environment variable or your client's secret store, never in a shared repo.

## 2. Connect your client

Pick your client. Every tab uses the same endpoint and header; see [Connect a client](/docs/clients/) for the rest.

```bash tab="Claude Code"
claude mcp add --transport http foodperfect https://mcp.foodperfect.ai/mcp \
  --header "Authorization: Bearer $FOODPERFECT_API_KEY"
```

```json tab="Cursor"
// ~/.cursor/mcp.json
{
  "mcpServers": {
    "foodperfect": {
      "url": "https://mcp.foodperfect.ai/mcp",
      "headers": { "Authorization": "Bearer fp_live_YOUR_KEY" }
    }
  }
}
```

```json tab="VS Code"
// .vscode/mcp.json
{
  "inputs": [
    { "type": "promptString", "id": "foodperfect-key", "description": "FoodPerfect API key", "password": true }
  ],
  "servers": {
    "foodperfect": {
      "type": "http",
      "url": "https://mcp.foodperfect.ai/mcp",
      "headers": { "Authorization": "Bearer ${input:foodperfect-key}" }
    }
  }
}
```

```toml tab="Codex"
# ~/.codex/config.toml  (export FOODPERFECT_API_KEY first)
[mcp_servers.foodperfect]
url = "https://mcp.foodperfect.ai/mcp"
bearer_token_env_var = "FOODPERFECT_API_KEY"
```

```bash tab="curl"
curl -sS https://mcp.foodperfect.ai/mcp \
  -H "Authorization: Bearer $FOODPERFECT_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Accept: application/json, text/event-stream" \
  -d '{"jsonrpc":"2.0","id":1,"method":"tools/call","params":{"name":"ping","arguments":{}}}'
```

## 3. Make your first calls

Ask your agent, in plain words:

> Call FoodPerfect's `ping`, then `get_account` and `get_brand_dna`. Tell me my plan, my balance and how you'd describe my brand's voice.

Behind the scenes that's three free, read-only calls:

| Call | Returns |
|---|---|
| `ping` | Server version and health. Use it to check the connection. |
| `get_account` | Plan, subscription status and balance (`totalBalanceUsd`). |
| `get_brand_dna` | Brand voice, pillars, post types and goals from onboarding. |

## 4. Generate something

> Make a 4:5 promo for our lunch special: lemongrass chicken, $12, weekdays 12–3.

The agent calls `generate_promo`, which costs one design at your plan's rate (from $0.40). The result lands in your FoodPerfect library, like anything made in the app.

> [!TIP]
> Calling from your own code? Add an `Idempotency-Key` header to paid calls so a retry never charges twice. See [idempotency](/docs/errors/#idempotency). MCP apps like Claude Code don't need it.

## 5. Publish, with approval

> Publish tomorrow's scheduled Instagram post now.

`publish_post_now` doesn't publish on the first call. It returns a preview and an `approvalToken`. Your agent shows you the preview, and only after you say yes does it confirm. See [Approvals & safe actions](/docs/approvals/).

## Next steps

- Give your agent the [FoodPerfect system prompt](/docs/agent-prompt/) so it follows the house rules.
- Browse the [tool reference](/docs/tools/).
- See [what each call costs](/docs/billing/).
