Developers

Run Pixmates from your own system: queue briefs with an API key, poll the result, get notified via webhooks.

1 · Authentication

Mint a "po_…" key under Profile → API Keys (office owner only). Send it as the X-API-Key header — the key is shown exactly ONCE at creation.

2 · Queue a brief

POST /api/v1/runs returns 202; execution is async. Fields: pixmate_slug, brief (≤20,000 chars), locale (tr|en).

curl -X POST https://api.pixel-office.app/api/v1/runs \
  -H "X-API-Key: po_XXXXXXXXXXXXXXXX" \
  -H "Content-Type: application/json" \
  -d '{
    "pixmate_slug": "mira-marketing",
    "brief": "Yeni single için 6 sosyal medya postu yaz",
    "locale": "tr"
  }'
# → 202 Accepted
# { "id": "…", "status": "queued", "pixmate_slug": "mira-marketing", … }

3 · Poll the result

GET /api/v1/runs (liste) · GET /api/v1/runs/{id}

curl https://api.pixel-office.app/api/v1/runs/RUN_ID \
  -H "X-API-Key: po_XXXXXXXXXXXXXXXX"
# status: queued → running → completed | failed

4 · Rate limits

60 requests per minute per key. Exceeding returns 429 + Retry-After; every response carries X-RateLimit-Limit / X-RateLimit-Remaining headers.

5 · Webhooks

Register an HTTPS endpoint under Profile → Webhooks. When a run reaches a terminal state (completed/failed/cancelled) a signed POST arrives; 3 attempts (0/5/25s). Signature: HMAC-SHA256("{timestamp}.{body}").

{
  "event": "run.completed",          // ya da run.failed / run.cancelled
  "run": {
    "id": "…", "status": "completed",
    "pixmate_slug": "mira-marketing", "kind": "chat",
    "cost_usd": 0.0213, "tokens_consumed": 3,
    "error_message": null, "session_id": "…",
    "created_at": "…", "finished_at": "…"
  },
  "sent_at": "…"
}

Verification (Python):

import hashlib, hmac

def verify(secret: str, ts: str, raw_body: bytes, signature: str) -> bool:
    expected = hmac.new(
        secret.encode(), f"{ts}.".encode() + raw_body, hashlib.sha256
    ).hexdigest()
    return hmac.compare_digest(f"sha256={expected}", signature)

# headers: X-Webhook-Timestamp / X-Webhook-Signature

Questions: the support email is on your profile page. The API surface is a v1 contract — breaking changes ship in a new version.