{
  "kind": "api-catalogue",
  "schema_version": 1,
  "base_url": "https://api.gogosling.ca/v1",
  "origin": "https://api.gogosling.ca",
  "protocol_bases": {
    "openai": "https://api.gogosling.ca/v1",
    "anthropic": "https://api.gogosling.ca",
    "gemini": "https://api.gogosling.ca",
    "ollama": "https://api.gogosling.ca"
  },
  "api_version": "v1",
  "versions": [
    "v1"
  ],
  "version_policy": "One stable major version. Additive changes stay in v1; introduce v2 only for breaking changes with an explicit migration period.",
  "description": "Canonical route discovery. This is a catalogue, not an OpenAPI schema. Prefix entries describe resource families; consult their contracts for operations. Native version paths such as Gemini v1beta belong to that protocol, not additional gateway API versions.",
  "contracts": {
    "mobile": "https://api.gogosling.ca/v1/mobile/openapi.json",
    "diagnostics": "https://api.gogosling.ca/v1/error-logs/openapi.json",
    "owner": "https://api.gogosling.ca/v1"
  },
  "developer": {
    "quickstart_url": "https://api.gogosling.ca/quickstart",
    "postman_url": "https://api.gogosling.ca/postman.json",
    "client_url": "https://api.gogosling.ca/clients/gosling-client.mjs",
    "guide_url": "https://api.gogosling.ca/clients/README.md",
    "examples": [
      {
        "name": "Read career history",
        "url": "https://api.gogosling.ca/clients/examples/sync-career.mjs"
      },
      {
        "name": "Consume release diagnostics",
        "url": "https://api.gogosling.ca/clients/examples/check-release-errors.mjs"
      }
    ]
  },
  "authentication": {
    "login_directory_url": "https://api.gogosling.ca/#authentication",
    "single_sign_on": false,
    "flow": [
      "Select the application realm; use its listed same-origin login endpoint.",
      "Password or passkey proves identity; passkey verification uses the private broker and preserves RP/origin binding.",
      "The owning application issues or rotates its session and applies any additional factor.",
      "The request credential is resolved before business logic; an explicit rejected credential cannot change identity through a Cookie fallback.",
      "Check account status, role/scope, resource ownership, CSRF for Cookie writes and quotas before performing the operation.",
      "Logout, password changes and recovery revoke sessions according to the owning realm contract."
    ],
    "realms": [
      {
        "id": "qa",
        "name": "QA account",
        "login_url": "https://api.gogosling.ca/v0/login",
        "passkey": true,
        "rp_id": "gogosling.ca",
        "session_mechanism": "Opaque Bearer or HttpOnly Cookie; server-side hashed session store"
      },
      {
        "id": "ai",
        "name": "AI console",
        "login_url": "https://ai.gogosling.ca/",
        "passkey": true,
        "rp_id": "gogosling.ca",
        "session_mechanism": "Opaque dashboard Bearer session; independent of inference caller keys"
      },
      {
        "id": "personal",
        "name": "Personal website",
        "login_url": "https://kairwang.cloud/login",
        "passkey": true,
        "rp_id": "kairwang.cloud",
        "session_mechanism": "Host-only HttpOnly signed Cookie with database session_version revocation"
      },
      {
        "id": "terminal",
        "name": "Terminal",
        "login_url": "https://gogosling.ca:408/",
        "passkey": true,
        "rp_id": "gogosling.ca",
        "session_mechanism": "Independent terminal session with its existing additional-factor policy"
      }
    ],
    "schemes": {
      "public-contract": {
        "description": "Public read-only discovery or health; no account or personal-data access.",
        "credential": "none",
        "audience": "public",
        "csrf": "Not applicable"
      },
      "public-health": {
        "description": "Public read-only discovery or health; no account or personal-data access.",
        "credential": "none",
        "audience": "public",
        "csrf": "Not applicable"
      },
      "public-metadata": {
        "description": "Public read-only discovery or health; no account or personal-data access.",
        "credential": "none",
        "audience": "public",
        "csrf": "Not applicable"
      },
      "public-rate-limited": {
        "description": "Public operation with validation and abuse limits; registration may be deployment-disabled.",
        "credential": "none",
        "audience": "public",
        "csrf": "Not applicable"
      },
      "caller-api-key-with-policy": {
        "description": "Inference key is resolved to caller policy, model permissions, budget and limits before provider dispatch.",
        "credential": "Bearer or supported protocol API key header",
        "audience": "inference",
        "csrf": "Not applicable"
      },
      "owner-api-key": {
        "description": "Owner-issued API key; career read/write scope and owner access are enforced by the primary service.",
        "credential": "Authorization: Bearer <owner-key>",
        "audience": "career",
        "csrf": "Not applicable"
      },
      "owner-api-key-with-scopes": {
        "description": "Owner-issued API key; career read/write scope and owner access are enforced by the primary service.",
        "credential": "Authorization: Bearer <owner-key>",
        "audience": "career",
        "csrf": "Not applicable"
      },
      "qa-session-or-bearer": {
        "description": "Real QA session only. Explicit invalid Authorization fails; it never falls back to a Cookie or identity field.",
        "credential": "QA Bearer session or HttpOnly kair_session Cookie",
        "audience": "qa",
        "csrf": "Cookie mutations require X-Requested-With; Bearer does not use ambient cookies."
      },
      "qa-session-or-bearer-strict": {
        "description": "Real QA session only. Explicit invalid Authorization fails; it never falls back to a Cookie or identity field.",
        "credential": "QA Bearer session or HttpOnly kair_session Cookie",
        "audience": "qa",
        "csrf": "Cookie mutations require X-Requested-With; Bearer does not use ambient cookies."
      },
      "qa-session-or-bearer-billing-enabled": {
        "description": "Real QA session plus deployment billing flag and order ownership.",
        "credential": "QA Bearer session or HttpOnly kair_session Cookie",
        "audience": "qa",
        "csrf": "Cookie mutations require X-Requested-With."
      },
      "qa-session-or-legacy-client": {
        "description": "Compatibility only: some content routes accept legacy Basic/user-id identities when REQUIRE_BEARER is disabled. Strict account/admin routes never do.",
        "credential": "Per-route QA session or legacy identity",
        "audience": "qa-legacy",
        "csrf": "Cookie mutations require X-Requested-With."
      },
      "qa-passkey-ceremony": {
        "description": "Login proves a challenge and exact browser origin; enrollment/removal require QA session and reauthentication as defined by the adapter.",
        "credential": "Passkey assertion/challenge, and QA session where required",
        "audience": "qa",
        "csrf": "Exact Origin, ceremony binding and operation-specific CSRF."
      },
      "password-reset-token": {
        "description": "Single-use, expiring password-reset token issued through the existing recovery process.",
        "credential": "Reset token in request body",
        "audience": "qa",
        "csrf": "Not applicable"
      },
      "product-ingest-key-or-bound-desktop-ticket": {
        "description": "Product-scoped write-only key, or short-lived desktop ticket bound to exact body digest, size and event UUID.",
        "credential": "Ingest key or desktop ticket",
        "audience": "diagnostics-ingest",
        "csrf": "Not applicable"
      },
      "product-read-key": {
        "description": "Separate read credential; only events for allowed products are visible.",
        "credential": "Read API key",
        "audience": "diagnostics-read",
        "csrf": "Not applicable"
      },
      "anonymous-body-bound-rate-limited": {
        "description": "Anonymous ticket issuance checks report metadata and rate limits; it does not prove an official client identity.",
        "credential": "none",
        "audience": "desktop-diagnostics",
        "csrf": "Not applicable"
      },
      "provider-signature-billing-enabled": {
        "description": "Provider callback signature, order binding and billing deployment flag.",
        "credential": "Provider signature",
        "audience": "qa-billing-callback",
        "csrf": "Not applicable"
      },
      "per-route-dashboard-session-or-inference-key": {
        "description": "Website compatibility namespace: admin routes use dashboard session; explicit native inference routes use caller key. Consult exact operation.",
        "credential": "Operation-specific dashboard Bearer or inference key",
        "audience": "ai-website",
        "csrf": "Not applicable"
      },
      "caller-api-key-or-dashboard-session": {
        "description": "Legacy embedding endpoint supports distinct dashboard-session and caller-key handlers; they retain their original policy.",
        "credential": "Operation-specific dashboard Bearer or inference key",
        "audience": "ai-compatibility",
        "csrf": "Not applicable"
      },
      "per-route-session-key-or-public": {
        "description": "Website namespace; declared route guards select public, owner key, session or admin authorization.",
        "credential": "Per-route session Cookie or owner key",
        "audience": "personal",
        "csrf": "Cookie mutations require X-CSRF-Token as declared by route."
      }
    }
  },
  "resources": [
    {
      "id": "primary",
      "routes": [
        {
          "path": "/v1",
          "match": "exact",
          "authentication": "owner-api-key"
        },
        {
          "path": "/v1/career",
          "match": "prefix",
          "authentication": "owner-api-key-with-scopes"
        },
        {
          "path": "/v1/mobile/",
          "match": "prefix",
          "authentication": "public-metadata"
        },
        {
          "path": "/v1/waitlist",
          "match": "exact",
          "authentication": "public-rate-limited"
        }
      ]
    },
    {
      "id": "qa",
      "routes": [
        {
          "path": "/v1/qa/health",
          "match": "exact",
          "methods": [
            "GET"
          ],
          "authentication": "public-health",
          "summary": "Health"
        },
        {
          "path": "/v1/qa/auth/register",
          "match": "exact",
          "methods": [
            "POST"
          ],
          "authentication": "public-rate-limited",
          "summary": "Register"
        },
        {
          "path": "/v1/qa/auth/login",
          "match": "exact",
          "methods": [
            "POST"
          ],
          "authentication": "public-rate-limited",
          "summary": "Sign in"
        },
        {
          "path": "/v1/qa/auth/logout",
          "match": "exact",
          "methods": [
            "POST"
          ],
          "authentication": "qa-session-or-bearer",
          "summary": "Sign out"
        },
        {
          "path": "/v1/qa/auth/password/reset",
          "match": "exact",
          "methods": [
            "POST"
          ],
          "authentication": "password-reset-token",
          "summary": "Reset password"
        },
        {
          "path": "/v1/qa/auth/passkeys",
          "match": "exact",
          "methods": [
            "GET"
          ],
          "authentication": "qa-session-or-bearer",
          "summary": "List passkeys"
        },
        {
          "path": "/v1/qa/account",
          "match": "exact",
          "methods": [
            "GET"
          ],
          "authentication": "qa-session-or-bearer",
          "summary": "Account, quotas, credits and sessions"
        },
        {
          "path": "/v1/qa/account/password",
          "match": "exact",
          "methods": [
            "PATCH"
          ],
          "authentication": "qa-session-or-bearer",
          "summary": "Change password"
        },
        {
          "path": "/v1/qa/account/statement",
          "match": "exact",
          "methods": [
            "GET"
          ],
          "authentication": "qa-session-or-bearer",
          "summary": "Usage and credit statement"
        },
        {
          "path": "/v1/qa/account/sessions",
          "match": "exact",
          "methods": [
            "DELETE"
          ],
          "authentication": "qa-session-or-bearer",
          "summary": "Revoke all sessions"
        },
        {
          "path": "/v1/qa/context",
          "match": "exact",
          "methods": [
            "GET",
            "DELETE"
          ],
          "authentication": "qa-session-or-bearer",
          "summary": "List or delete saved context"
        },
        {
          "path": "/v1/qa/answers",
          "match": "exact",
          "methods": [
            "POST"
          ],
          "authentication": "qa-session-or-bearer-strict",
          "summary": "Answer a question"
        },
        {
          "path": "/v1/qa/screenshots",
          "match": "exact",
          "methods": [
            "POST"
          ],
          "authentication": "qa-session-or-bearer-strict",
          "summary": "Answer a screenshot (SSE)"
        },
        {
          "path": "/v1/qa/context/pages",
          "match": "exact",
          "methods": [
            "POST"
          ],
          "authentication": "qa-session-or-bearer-strict",
          "summary": "Save page context"
        },
        {
          "path": "/v1/qa/context/files",
          "match": "exact",
          "methods": [
            "POST"
          ],
          "authentication": "qa-session-or-bearer-strict",
          "summary": "Upload file context"
        },
        {
          "path": "/v1/qa/transcriptions",
          "match": "exact",
          "methods": [
            "POST"
          ],
          "authentication": "qa-session-or-bearer-strict",
          "summary": "Transcribe audio"
        },
        {
          "path": "/v1/qa/billing/catalog",
          "match": "exact",
          "methods": [
            "GET"
          ],
          "authentication": "public-metadata",
          "summary": "Pricing catalogue"
        },
        {
          "path": "/v1/qa/billing/orders",
          "match": "exact",
          "methods": [
            "GET",
            "POST"
          ],
          "authentication": "qa-session-or-bearer-billing-enabled",
          "summary": "List or create orders"
        },
        {
          "path": "/v1/qa/billing/pricing-intents",
          "match": "exact",
          "methods": [
            "POST"
          ],
          "authentication": "qa-session-or-bearer",
          "summary": "Record purchase interest"
        },
        {
          "path": "/v1/qa/auth/passkeys/register/options",
          "match": "exact",
          "methods": [
            "POST"
          ],
          "authentication": "qa-passkey-ceremony",
          "summary": "Passkey register/options"
        },
        {
          "path": "/v1/qa/auth/passkeys/register/verify",
          "match": "exact",
          "methods": [
            "POST"
          ],
          "authentication": "qa-passkey-ceremony",
          "summary": "Passkey register/verify"
        },
        {
          "path": "/v1/qa/auth/passkeys/login/options",
          "match": "exact",
          "methods": [
            "POST"
          ],
          "authentication": "qa-passkey-ceremony",
          "summary": "Passkey login/options"
        },
        {
          "path": "/v1/qa/auth/passkeys/login/verify",
          "match": "exact",
          "methods": [
            "POST"
          ],
          "authentication": "qa-passkey-ceremony",
          "summary": "Passkey login/verify"
        },
        {
          "path": "/v1/qa/auth/passkeys/remove",
          "match": "exact",
          "methods": [
            "POST"
          ],
          "authentication": "qa-passkey-ceremony",
          "summary": "Passkey remove"
        },
        {
          "path": "/v1/qa/billing/webhooks/stripe",
          "match": "exact",
          "methods": [
            "POST"
          ],
          "authentication": "provider-signature-billing-enabled",
          "summary": "Payment callback: stripe"
        },
        {
          "path": "/v1/qa/account/sessions/",
          "match": "prefix",
          "methods": [
            "DELETE"
          ],
          "authentication": "qa-session-or-bearer",
          "summary": "Revoke one of your sessions without signing out other devices",
          "path_parameter": {
            "name": "session_id",
            "pattern": "^ses_[A-Za-z0-9_-]{43}$",
            "description": "Opaque session_id returned by GET /v1/qa/account; identifies only a session owned by the authenticated user."
          }
        }
      ]
    },
    {
      "id": "inference",
      "routes": [
        {
          "path": "/v1/models",
          "match": "exact",
          "methods": [
            "GET"
          ],
          "authentication": "caller-api-key-with-policy"
        },
        {
          "path": "/v1/usage",
          "match": "exact",
          "methods": [
            "GET"
          ],
          "authentication": "caller-api-key-with-policy",
          "summary": "Read only the current caller monthly usage, limits and remaining budget; available when the inference budget is exhausted."
        },
        {
          "path": "/v1/chat/completions",
          "match": "exact",
          "methods": [
            "POST"
          ],
          "authentication": "caller-api-key-with-policy"
        },
        {
          "path": "/v1/completions",
          "match": "exact",
          "methods": [
            "POST"
          ],
          "authentication": "caller-api-key-with-policy"
        },
        {
          "path": "/v1/responses",
          "match": "exact",
          "methods": [
            "POST"
          ],
          "authentication": "caller-api-key-with-policy"
        },
        {
          "path": "/v1/messages",
          "match": "exact",
          "methods": [
            "POST"
          ],
          "authentication": "caller-api-key-with-policy"
        },
        {
          "path": "/v1/messages/count_tokens",
          "match": "exact",
          "methods": [
            "POST"
          ],
          "authentication": "caller-api-key-with-policy"
        },
        {
          "path": "/v1/embeddings",
          "match": "exact",
          "methods": [
            "POST"
          ],
          "authentication": "caller-api-key-with-policy"
        },
        {
          "path": "/v1/images/generations",
          "match": "exact",
          "methods": [
            "POST"
          ],
          "authentication": "caller-api-key-with-policy"
        },
        {
          "path": "/v1/videos/generations",
          "match": "exact",
          "methods": [
            "POST"
          ],
          "authentication": "caller-api-key-with-policy"
        },
        {
          "path": "/v1/audio/speech",
          "match": "exact",
          "methods": [
            "POST"
          ],
          "authentication": "caller-api-key-with-policy"
        },
        {
          "path": "/v1/audio/transcriptions",
          "match": "exact",
          "methods": [
            "POST"
          ],
          "authentication": "caller-api-key-with-policy"
        },
        {
          "path": "/v1beta/models",
          "match": "exact",
          "methods": [
            "GET"
          ],
          "authentication": "caller-api-key-with-policy",
          "protocol": "gemini",
          "protocol_base": "https://api.gogosling.ca"
        },
        {
          "path": "/v1beta/models/",
          "match": "prefix",
          "methods": [
            "GET",
            "POST"
          ],
          "authentication": "caller-api-key-with-policy",
          "protocol": "gemini",
          "protocol_base": "https://api.gogosling.ca"
        },
        {
          "path": "/api/tags",
          "match": "exact",
          "methods": [
            "GET"
          ],
          "authentication": "caller-api-key-with-policy",
          "protocol": "ollama",
          "protocol_base": "https://api.gogosling.ca",
          "feature_gate": "ollama_emulation"
        },
        {
          "path": "/api/version",
          "match": "exact",
          "methods": [
            "GET"
          ],
          "authentication": "caller-api-key-with-policy",
          "protocol": "ollama",
          "protocol_base": "https://api.gogosling.ca",
          "feature_gate": "ollama_emulation"
        },
        {
          "path": "/api/show",
          "match": "exact",
          "methods": [
            "POST"
          ],
          "authentication": "caller-api-key-with-policy",
          "protocol": "ollama",
          "protocol_base": "https://api.gogosling.ca",
          "feature_gate": "ollama_emulation"
        },
        {
          "path": "/api/chat",
          "match": "exact",
          "methods": [
            "POST"
          ],
          "authentication": "caller-api-key-with-policy",
          "protocol": "ollama",
          "protocol_base": "https://api.gogosling.ca",
          "feature_gate": "ollama_emulation"
        },
        {
          "path": "/api/generate",
          "match": "exact",
          "methods": [
            "POST"
          ],
          "authentication": "caller-api-key-with-policy",
          "protocol": "ollama",
          "protocol_base": "https://api.gogosling.ca",
          "feature_gate": "ollama_emulation"
        },
        {
          "path": "/api/embed",
          "match": "exact",
          "methods": [
            "POST"
          ],
          "authentication": "caller-api-key-with-policy",
          "protocol": "ollama",
          "protocol_base": "https://api.gogosling.ca",
          "feature_gate": "ollama_emulation"
        },
        {
          "path": "/api/embeddings",
          "match": "exact",
          "methods": [
            "POST"
          ],
          "authentication": "caller-api-key-with-policy",
          "protocol": "ollama",
          "protocol_base": "https://api.gogosling.ca",
          "feature_gate": "ollama_emulation"
        },
        {
          "path": "/v1/tasks",
          "match": "exact",
          "methods": [
            "GET",
            "POST"
          ],
          "authentication": "caller-api-key-with-policy",
          "summary": "Caller-scoped content and operations suggestions, review required; existing provider pool plus budgeted OpenAI fallback."
        },
        {
          "path": "/v1/decisions",
          "match": "exact",
          "methods": [
            "POST"
          ],
          "authentication": "caller-api-key-with-policy",
          "summary": "Native OpenAI Decisions; paid caller permission and atomic monthly spending reservations required."
        }
      ]
    },
    {
      "id": "error-logs",
      "routes": [
        {
          "path": "/v1/error-logs",
          "match": "exact",
          "authentication": "product-ingest-key-or-bound-desktop-ticket"
        },
        {
          "path": "/v1/error-logs/events",
          "match": "exact",
          "authentication": "product-read-key"
        },
        {
          "path": "/v1/error-logs/health",
          "match": "exact",
          "authentication": "public-health"
        },
        {
          "path": "/v1/error-logs/openapi.json",
          "match": "exact",
          "authentication": "public-contract"
        },
        {
          "path": "/v1/desktop-diagnostics/tickets",
          "match": "exact",
          "authentication": "anonymous-body-bound-rate-limited"
        }
      ]
    }
  ]
}
