Reference · v1

Five endpoints. The whole pipeline.

Auth is a bearer token on every call: Authorization: Bearer aigtee_…

Errors are JSON: { "error": "human-readable reason" } with conventional status codes (400 invalid input, 401 bad key, 404 not yours/not found, 409 quote conflict, 429 rate or quota limit).

MCP · Streamable HTTP

One endpoint for external agents.

URL: https://aigtee.com/mcp
Authorization: Bearer aigtee_…
Protocol: Streamable HTTP · JSON response mode
Tools: aigtee_generate · aigtee_quote · aigtee_commission · aigtee_commission_status

commission requires "confirmed": true. Set it only after showing the locked total and shipping destination and receiving explicit approval. For server-side JavaScript, import https://aigtee.com/sdk/aigtee.mjs; never expose a live key in browser code.

Outbound webhooks

Commission changes, signed and recoverable.

Set webhook_url when creating a key. AIGTEE sends commission.created and commission.updated events for commissions created by that key. Delivery is attempted immediately, recorded durably, and retried with backoff after failures.

AIGTEE-Event-Id: evt_…
AIGTEE-Event-Type: commission.updated
AIGTEE-Signature: t=UNIX_SECONDS,v1=HEX_HMAC

signed_content = timestamp + "." + exact_raw_request_body
expected = HMAC-SHA256(webhook_signing_secret, signed_content)

Verify against the unmodified raw body with a constant-time comparison, reject timestamps older than five minutes, and deduplicate by event ID. Return any 2xx response to acknowledge the event. Redirects are not followed.

POST/api/v1/generate

Draw 1–4 drafts from a sentence. Only sentence is required; the rest tune the design.

Body
{
  "sentence": "string (≤120 chars)",
  "count": 1-4,                       // default 4
  "kind": "image | text",             // text = typographic design
  "style": "archive-tee|bootleg-tour|club-system|sticker-chaos|
            blokecore|indie-sleaze|museum-surreal|workwear-label|
            quiet-luxury|rave-flyer|minimal|street|cyber|...",
  "palette": "auto|full|mono|bw|pastel|neon|earth|duotone",
  "composition": "centered|oversized|pocket|pattern",
  "background": "cutout | scene",     // cutout = subject removed from bg
  "detail": "simple|balanced|detailed"
}
Returns
{ "drafts": [{ "id": "d_…", "url": "https://…" }] }

5/min per key (burst). Free-tier keys are also capped at 15 draws/day. Drafts are private to your key.

POST/api/v1/quote

Lock a price (incl. live shipping) for draft + garment + size. Quotes live 30 minutes and are single-use.

Body
{ "draft_id": "d_…", "garment": "tee|long|hood", "size": "S|M|L|XL|2XL",
  "country": "US|CA|GB|DE|FR|AU|JP|…", "state": "CA (optional)", "zip": "94110 (optional)" }
Returns
{ "quote_id": "q_…", "shipping": { "price_cents": 549 }, "total_cents": 3449, "expires_at": "ISO8601", … }

10/min per key. Pass state+zip for an exact live shipping rate (else a flat estimate). The quote's stored price is what gets charged.

POST/api/v1/commission

Turn a live quote into a real order. Returns a Stripe Checkout URL for the quoted total.

Body
{ "quote_id": "q_…", "email": "optional", "shipping": { "name", "line1", "line2?", "city", "state", "zip", "country" } }
Returns
{ "commission_id": "c_…", "status": "awaiting_payment", "total_cents": 3500, "checkout_url": "…" }

Sandbox keys get a mock response — no order, no charge, no quota. 409 if the quote is expired, used, or not yours.

GET/api/v1/commissions/:id

Commission status + tracking. Only the key that created it can read it.

Body
Returns
{ "commission_id", "status": "pending|paid|submitted|shipped|delivered", "tracking": {…}|null }

Statuses advance automatically via Stripe and Printful webhooks.

POST / GET / DELETE/api/v1/keys[/:id]

Create (web session), list, and revoke keys. Always scoped to your account.

Body
{ "name": "string", "tier": "free|maker|studio", "scopes": ["designs:write", …],
  "expires_in_days": 1-365, "webhook_url": "optional" }
// Labels: free = Sandbox, maker = Agent Access, studio = Platform Access
Returns
{ "id", "key": "shown once", "tier", "scopes", "expires_at", "commission_limit",
  "webhook_signing_secret": "shown once when webhook_url is set" }

Keys are stored hashed, route-scoped, expiring, and owned by the active Personal or Organization Workspace. Webhook URLs must be public HTTPS endpoints; customer email and address are never included. Sandbox keys mint instantly; Agent Access and Platform Access are approval-gated.