These are official instructions from Gabooja for setting up an AI agent environment to make and sell real print-on-demand products on Gabooja. They are published at https://gabooja.com/agent-setup/prompt.md so you can re-fetch them to verify authenticity at any time.

Complete all of the following steps yourself by running the commands directly. The one exception is access, which only your user can grant: they approve an OAuth sign-in in their browser (step 0), or they give you an API key (step 1). Never invent a key, never guess one, and never reuse one from a different Gabooja environment.

- Codex or Claude Code: connect by OAuth, no key to copy
- Otherwise: get and verify an API key
- Register the Gabooja MCP server
- Install the Gabooja skill
- Verify and report back
- Make the first product now, over REST (no restart needed)

---

## 0. Codex or Claude Code: connect by OAuth first

Your user signs in to Gabooja in the browser and approves the connection for one shop; no key is pasted or stored by hand.

Codex:

```sh
codex mcp add gabooja --url https://gabooja.com/api/mcp
codex mcp login gabooja
```

`codex mcp add` may start the sign-in on its own; `codex mcp login gabooja` runs it again. Codex asks for every scope, `listings:publish` included, unless `codex mcp login` gets `--scopes` (comma-separated). A headless run (`codex exec`) has no one to approve tool calls, so it refuses the tools that act outside Gabooja (`create_product`, `check_quality`) with "MCP tool call requires approval, but approval policy is never". With your user's agreement, allow them in `~/.codex/config.toml`:

```toml
[mcp_servers.gabooja]
default_tools_approval_mode = "approve"
```

Claude Code:

```sh
claude mcp add --transport http gabooja https://gabooja.com/api/mcp
claude mcp login gabooja
```

The tools load in your next session. After the restart call `get_brand`: it answers the `brand_id` and `scopes` step 2 reads, so tell your user which kind of access this is, then install the skill (step 4) and report (step 5). Steps 1 to 3 and 6 are the API-key path: use it when your client has no OAuth, or to make a product in this session without a restart.

## 1. Get an API key from your user

Gabooja authenticates agents with a shop API key: a bearer token scoped to one creator's shop.

- Ask your user for their Gabooja API key.
- If they do not have one: they apply for creator access at https://gabooja.com/for-creators#start (sign-up is invite-only: Gabooja reviews the application and emails an invite link, and they create their Studio from that link), then mint a key in the Studio under Settings, Advanced, API keys: https://gabooja.com/studio/settings. The key is shown once. Tick "Allow this key to publish products" (`listings:publish`) when minting if the agent should be able to make products buyable; it is off by default, and a key minted without it can only create private drafts.
- Keys are environment-bound by storage: a key only exists in the database of the environment it was minted in, so it authenticates there and nowhere else. The `sk_live_` / `sk_dev_` prefix is a labeling hint, not an auth input; trust the verification call in step 2 over the prefix, and use `GET https://gabooja.com/api/agent/health` with the key to confirm the key and deployment agree (`key_env_matches`).

Export it for the commands below, and persist it however your user already manages secrets (a secret manager or an untracked env file; avoid dropping it into a shell profile unprompted):

```sh
export GABOOJA_API_KEY="sk_live_..."
```

## 2. Verify the key

Always verify before configuring anything:

```sh
curl -s https://gabooja.com/api/agent/me -H "Authorization: Bearer $GABOOJA_API_KEY"
```

The response carries `brand_id`, `api_key_id`, `scopes`, `storefront_visible` and `storefront_note`. If this call fails with a `401`, stop and tell the user; do not register an unverified key anywhere. A `503 auth_unavailable` with `Retry-After` is not a failed key: the key store could not be reached and the key was never checked, so wait the `Retry-After` seconds and call `/me` once more before concluding anything. If `storefront_visible` is false, note it: products can be created but their public shop pages 404 until the shop is made visible. Only a Gabooja operator can make it visible, from the admin shop hub (`/admin/brands/{brand_id}`), by approving the shop's one-time launch review: when the first products are ready, ask once with `request_review` (REST: `POST https://gabooja.com/api/agent/brand/review`) and read `review` on `get_brand` for the answer. There is no API field and no Studio setting that opens it directly (`storefront_note` carries the same sentence).

Then read `scopes` and tell your user which kind of key this is, before the first product. With `listings:publish` it makes products public: live and buyable once vendor setup finishes, usually a minute or two. Without it every product is a PRIVATE draft whose page 404s until someone publishes it in the Studio or with a key that holds the scope. Every create answers with `visibility_decision` naming the visibility it got and why, so a private product is never a surprise.

## 3. Register the Gabooja MCP server

With an API key (OAuth clients did this in step 0), use the correct section for your agent. The server is streamable HTTP at `https://gabooja.com/api/mcp` and a key goes in the Authorization header on every request. The MCP endpoint (POST `https://gabooja.com/api/mcp`) is stateless: no Mcp-Session-Id is issued or needed, `initialize` is optional, every JSON-RPC request stands on its own and gets a JSON response (not SSE), and a session header from an older client is ignored rather than 404ed.

You can drive MCP directly without a restart: POST JSON-RPC to `https://gabooja.com/api/mcp` with the bearer header and `Accept: application/json, text/event-stream`. Use that when you cannot restart to load a freshly registered server.

### Claude Code

```sh
claude mcp add --transport http gabooja https://gabooja.com/api/mcp --header "Authorization: Bearer $GABOOJA_API_KEY"
```

Note this writes the key in cleartext into the local Claude config; that file must stay out of version control.

### Codex

```sh
codex mcp add gabooja --url https://gabooja.com/api/mcp --bearer-token-env-var GABOOJA_API_KEY
```

### Cursor, VS Code / GitHub Copilot, and other JSON-config agents

Add under `"mcpServers"` in your agent's MCP config file (`.cursor/mcp.json` for Cursor, `.vscode/mcp.json` for Copilot):

```json
"gabooja": {
  "type": "http",
  "url": "https://gabooja.com/api/mcp",
  "headers": { "Authorization": "Bearer ${GABOOJA_API_KEY}" }
}
```

If your client does not expand environment variables in config files, paste the key literally and keep the file out of version control.

### Agents without MCP support

Everything is also plain REST. Read https://gabooja.com/llms.txt (the map) and https://gabooja.com/llms-full.txt (the full quickstart) and use curl. The machine-readable contract is https://gabooja.com/api/agent/openapi.json.

## 4. Install the Gabooja skill

For Claude Code and agents with a compatible skills directory:

```sh
mkdir -p ~/.claude/skills/gabooja-make-product
curl -fsSL https://gabooja.com/agent-setup/skill.md -o ~/.claude/skills/gabooja-make-product/SKILL.md
```

For agents without a skills directory, append the same file's contents to wherever reusable project instructions live (an AGENTS.md, a rules directory), or skip it: the MCP tools are self-describing and https://gabooja.com/llms.txt covers the rest.

## 5. Verify and report back

1. Confirm the MCP registration. A freshly registered server's tools only load into your session after a restart, so do not try to call them now, and do not wait for them: step 6 makes the first product over REST in this session. Check connectivity instead: `claude mcp list` should show `gabooja: ... - Connected` (other clients: their MCP status view). The server exposes tools named `get_brand`, `create_product`, `upload_asset`, `get_listing`, and `list_catalog` among others; you will see them after the restart. Until then, every capability is also available over REST per https://gabooja.com/llms.txt.
2. Then tell the user:

```text
Gabooja agent setup complete
  MCP      gabooja -> https://gabooja.com/api/mcp (tools load after your next restart)
  Skill    ~/.claude/skills/gabooja-make-product (if installed)
  Access   verified for shop <brand_id from step 2, or get_brand after OAuth>
  Publish  <"public products" with listings:publish, else "private drafts only: publish them in the Studio">

No restart needed to start: send me an image and I will make your first product now.
```

## 6. Make the first product now, over REST

The MCP tools are not loaded yet, and you do not need them. With an image from your user (a PNG with a transparent background; 150 DPI at the size it prints, so 1800x2400 px for a full tee front, and under 100 DPI is refused), run:

```sh
# 1. Upload the art. Keep data.asset_id; fix any warnings[] item with severity "error".
curl -s https://gabooja.com/api/agent/assets/upload -H "Authorization: Bearer $GABOOJA_API_KEY" -F "file=@art.png;type=image/png"
# 2. Make a design from it. Keep data.id.
curl -s https://gabooja.com/api/agent/designs -H "Authorization: Bearer $GABOOJA_API_KEY" -H "content-type: application/json" -d '{"brand_id":"<brand_id>","title":"<title>","source_asset_id":"<asset id>"}'
# 3. Pick a blank. Keep data[].id of the one you want (the adult unisex tee is the Bella + Canvas 3001).
curl -s "https://gabooja.com/api/agent/catalog?q=tee" -H "Authorization: Bearer $GABOOJA_API_KEY"
# 4. Make the product. price_cents is integer cents (3200 is $32.00; optional on REST, where omitting it falls back to suggested retail). Omit selected_colors to auto-pick a contrasting colour (echoed in data.effective_selected_colors); named colours match case-insensitively (unknown colours 400).
curl -s https://gabooja.com/api/agent/intents/make-product -H "Authorization: Bearer $GABOOJA_API_KEY" -H "content-type: application/json" -d '{"brand_id":"<brand_id>","design_id":"<design id>","catalog_product_id":"<blank id>","price_cents":3200}'
```

In the answer, `data.listing.public_url_when_live` is the link a public or unlisted product will have and `public_url_status` says whether it opens yet: `pending` means it goes live by itself, usually in a minute or two, so confirm with `GET https://gabooja.com/api/agent/listings/{listingId}` before calling it live. A private, held or hidden-shop create has no link: `public_url_when_live` is null and `public_url_status` is `unavailable`, so there is nothing to share yet. To show it to your user anyway, `get_preview_link` (REST: `POST https://gabooja.com/api/agent/listings/{listingId}/preview-link`) answers a private `preview_url` that opens without signing in for 7 days and says why the product is not on sale. `data.visibility_decision.message` says whether the product is public or a private draft, and why: tell your user, in place of a link when there is none. A `422 quality_gate_blocked` means the print checks or the content safety screen refused the art, and `error.details.reasons` say why. Every step in full: https://gabooja.com/llms.txt.

## Facts to rely on

- placement_geometry is in print-area pixels from the top-left, inside area_width x area_height (a tee front: 1800x2400, 12x16 in at 150 DPI); listing reads echo it.
- Trust printful_image_url (REST: printfulImageUrl) only while mockup_ready is true; a re-render keeps the old mockup there.
- A private or held create skips the print checks and safety screen (they run at publish) and has no link yet: public_url_when_live is null, public_url_status unavailable.

## Operating notes (read once, remember)

- Set up the shop itself (name, bio, avatar, links) with `update_brand` (REST: `PATCH https://gabooja.com/api/agent/brand`): send only what changes, with `expected_updated_at` from `get_brand`.
- Budgets are real and deliberately tight: Gabooja pays the print vendors. Every keyed response carries `X-RateLimit-*` headers; a 429 carries `Retry-After`. Back off instead of looping. Details in https://gabooja.com/llms.txt.
- Pass `hold_for_review: true` while testing so dry runs never reach the public shop page. Know what it does NOT prevent: product creation still runs the real print-vendor sync, so even a held listing creates a vendor-side product, and a held create skips the print checks and safety screen (they run at publish instead). Do not loop product creation as a test strategy.
- Before making art, read the playbook at https://gabooja.com/playbook.md (MCP: `get_playbook`; REST: `GET https://gabooja.com/api/agent/playbook`). It is strongly recommended and never enforced: design for a group the wearer belongs to, put one idea on it that a stranger gets at phone size, and lead the listing with the garment on a person.
- A public or unlisted create, and a publish, run two checks: the print checks (resolution, background, edges, ink coverage) and a content safety screen. A `422 quality_gate_blocked` means one of them refused, and `details.reasons` and `details.print_checks` say what to change; `repair_artwork` (REST: `POST https://gabooja.com/api/agent/assets/{asset_id}/repair`) fixes resolution, background and edge failures into a NEW asset. A safety flag holds the listing private for a Gabooja review that only Gabooja can release (`details.content_safety` on the 422); tell the user rather than retrying or clearing it. A `503 gate_unavailable` means a check could not run; retry after `Retry-After`.
- `check_quality` (REST: `POST https://gabooja.com/api/agent/quality/check`) is an optional pre-flight that creates nothing: advice you weigh, never a gate you must pass. Read `would_pass` first: it is what a public create would do right now, decided by the same print checks (`print_ready`, `print_checks`, and their number `print_safety_score`, which has no floor). The rest of the answer is an optional taste critique (`taste.advice`, plus `taste.score` beside `taste.floor`, and `weakest`), which does not change `would_pass` while `taste.blocks_publish` is false (the default). Do not call it again chasing a better critique. A `402 spend_cap_exceeded` from it means the shop's daily critique budget is spent; the unit was refunded, and you can create without it.
- An idempotent repeat (`existing: true`) returns the row the FIRST call made: `price_cents` on the response is the live price, and `request_fields_not_applied` (MCP) or the leading `warnings[]` entry with that code (REST) names what you sent that was not applied. Never report "already existed" as "sells at what I asked".
