Reference

Generated at build time from openapi.yaml. Production base URL: https://api.weirgate.com.

74 operations · contract 2026-07-18

GET/healthz

Operations · getHealth

Read process health and runtime mode

Responses

  • 200 Healthy
POST/v1/chat/completions

Data plane · createChatCompletion

Create a server-routed chat completion

OpenAI-compatible request/response envelope. Client-supplied model and token ceilings are ignored; X-Feature-Id owns routing and output limits. When stream is true the response is SSE and follows x-weirgate-sse.

Parameters

  • parameter · · optional
  • parameter · · optional
  • parameter · · optional

Request body

See the OpenAPI schema for the accepted JSON body and required content type.

Responses

  • 200 Completion or completion stream
  • 400
  • 401
  • 402
  • 403
  • 404
  • 422
  • 429
  • 500
  • 502
POST/v1/embeddings

Data plane · createEmbedding

Create server-routed embeddings

Parameters

  • parameter · · optional
  • parameter · · optional
  • parameter · · optional

Request body

See the OpenAPI schema for the accepted JSON body and required content type.

Responses

  • 200 Embeddings
  • 400
  • 401
  • 402
  • 403
  • 404
  • 422
  • 429
  • 500
  • 502
GET/v1/features

Data plane · listFeatures

Read the authenticated app's enabled feature catalog

Parameters

  • parameter · · optional
  • If-None-Match · header · optional

Responses

  • 200 Private app catalog
  • 304 Catalog is unchanged
  • 400
  • 401
  • 404
GET/v1/balance

Data plane · getBalance

Read balance, lazily provisioning the app/user row

The monthly allowance grant remains lazy until the first metered call.

Parameters

  • parameter · · optional

Responses

  • 200 Current balance
  • 400
  • 401
  • 404
POST/v1/telemetry/client

Data plane · ingestClientTelemetry

Accept optional user-bound client timing

Created, duplicate, and cap-dropped events intentionally share the same 202 response.

Parameters

  • parameter · · optional

Request body

See the OpenAPI schema for the accepted JSON body and required content type.

Responses

  • 202 Accepted without disclosing deduplication or cap state
  • 400
  • 401
  • 404
POST/v1/stripe/webhook

Billing · receiveStripeWebhook

Receive a signature-verified idempotent Stripe billing event

The exact raw body is verified before parsing. Durable event-id deduplication precedes audited tenant subscription state changes. This path never invokes app-user grant or reversal primitives.

Parameters

  • Stripe-Signature · header · required

Request body

See the OpenAPI schema for the accepted JSON body and required content type.

Responses

  • 200 Event received or already processed
  • 400
  • 500
  • 502
GET/v1/admin/whoami

Keys · getManagementIdentity

Inspect the authenticated management grant

Responses

  • 200
  • 401
POST/v1/admin/session

Keys · provisionDeveloperSession

Idempotently provision and read the Clerk organization tenant

Developer identity is distinct from every app's end-user auth configuration.

Responses

  • 200
  • 201
  • 401
  • 403
GET/v1/admin/billing

Billing · getTenantBilling

Read tenant tier, provisional usage, invoices, and append-only statements

Parameters

  • parameter · · optional

Responses

  • 200 Tenant billing summary
  • 401
  • 403
  • 404
POST/v1/admin/billing/checkout

Billing · createBillingCheckout

Create a Stripe-hosted subscription checkout session

Requires a tenant owner with a recent second factor. Tier state changes only from verified Stripe webhooks.

Parameters

  • parameter · · optional

Request body

See the OpenAPI schema for the accepted JSON body and required content type.

Responses

  • 201 Stripe Checkout redirect
  • 400
  • 401
  • 403
  • 502
POST/v1/admin/billing/portal

Billing · createBillingPortal

Create a Stripe-hosted customer portal session

Requires a tenant owner with a recent second factor.

Responses

  • 201 Stripe Portal redirect
  • 401
  • 403
  • 502
POST/v1/admin/billing/catalog/setup

Billing · setupStripeTestCatalog

Idempotently create the approved Stripe test-mode catalog

Responses

  • 201 Test-mode products, prices, coupons, and portal configuration
  • 401
  • 403
  • 500
  • 502
POST/v1/admin/billing/design-partner

Billing · enrollBillingDesignPartner

Enroll a tenant in the approved six-month design-partner schedule

Request body

See the OpenAPI schema for the accepted JSON body and required content type.

Responses

  • 200 Enrollment timestamp
  • 400
  • 401
  • 403
  • 404
POST/v1/admin/billing/statements/close

Billing · closeTenantBillingStatement

Close one UTC month and post paid-tier overage invoice items

Request body

See the OpenAPI schema for the accepted JSON body and required content type.

Responses

  • 201 Append-only draft/final records and any Stripe invoice record
  • 400
  • 401
  • 403
  • 404
  • 500
  • 502
POST/v1/admin/billing/statements/correct

Billing · correctFinalizedTenantBillingStatement

Append a closed-month correction and credit matching finalized Stripe lines

Request body

See the OpenAPI schema for the accepted JSON body and required content type.

Responses

  • 201 Append-only correction and any same-line Stripe credit note record
  • 400
  • 401
  • 403
  • 404
  • 500
  • 502
POST/v1/admin/session-grants

Keys · authorizeSessionGrant

Authorize a bounded MCP or CLI grant from a developer session

Defaults to propose scope; apply requires a recent Clerk second factor.

Request body

See the OpenAPI schema for the accepted JSON body and required content type.

Responses

  • 201
  • 400
  • 401
  • 403
  • 404
GET/v1/admin/members

Team · listDeveloperMembers

List Weirgate-owned tenant memberships and roles

Responses

  • 200
  • 401
  • 403
PATCH/v1/admin/members/{developerIdentityId}

Team · updateDeveloperMemberRole

Change a Weirgate-owned tenant role

Owner-only. Requires a recent second factor and preserves at least one tenant owner.

Parameters

  • developerIdentityId · path · required

Request body

See the OpenAPI schema for the accepted JSON body and required content type.

Responses

  • 200
  • 400
  • 401
  • 403
  • 404
POST/v1/session-grants/exchange

Keys · exchangeSessionGrant

Exchange a single-use consent code for a reveal-once bounded key

Request body

See the OpenAPI schema for the accepted JSON body and required content type.

Responses

  • 201 Bounded key metadata plus reveal-once value
  • 400
  • 401
GET/v1/admin/docs/search

Docs · searchAgentDocs

Search the authenticated canonical Markdown corpus

Parameters

  • query · query · required
  • section · query · optional
  • parameter · · optional

Responses

  • 200
  • 400
  • 401
  • 403
GET/v1/admin/docs/{pageId}

Docs · getAgentDoc

Read one canonical Markdown page

Parameters

  • pageId · path · required

Responses

  • 200
  • 401
  • 403
  • 404
GET/v1/admin/auth-presets

Configuration · listAuthPresets

List non-secret Firebase, Supabase, Clerk, and custom JWKS templates

Responses

  • 200
  • 401
  • 403
GET/v1/admin/provider-policy

Operations · getProviderPolicy

Read the platform-owned provider policy registry

Responses

  • 200
  • 401
  • 403
PUT/v1/admin/provider-policy

Operations · replaceProviderPolicy

Replace the platform-owned policy registry

Request body

See the OpenAPI schema for the accepted JSON body and required content type.

Responses

  • 200
  • 400
  • 401
  • 403
GET/v1/admin/provider-keys

Keys · listProviderKeys

List write-only provider-key slot metadata

Parameters

  • parameter · · optional
  • parameter · · optional

Responses

  • 200
  • 400
  • 401
  • 403
  • 404
PUT/v1/admin/provider-keys/{provider}

Keys · putProviderKey

Create or replace a write-only provider key

Clerk developer sessions require a recent second factor.

Request body

See the OpenAPI schema for the accepted JSON body and required content type.

Responses

  • 200
  • 201
  • 400
  • 401
  • 403
  • 404
DELETE/v1/admin/provider-keys/{provider}

Keys · revokeProviderKey

Soft-revoke a provider key

Clerk developer sessions require a recent second factor.

Responses

  • 200
  • 400
  • 401
  • 403
  • 404
POST/v1/admin/provider-keys/{provider}/rotate

Keys · rotateProviderKey

Rotate a write-only provider key

Clerk developer sessions require a recent second factor.

Request body

See the OpenAPI schema for the accepted JSON body and required content type.

Responses

  • 200
  • 400
  • 401
  • 403
  • 404
POST/v1/admin/provider-keys/{provider}/health

Keys · probeProviderKey

Run a non-billable provider metadata probe

Responses

  • 200
  • 400
  • 401
  • 403
  • 404
  • 500
POST/v1/admin/keys

Keys · mintManagementKey

Mint and reveal a bounded management key once

Request body

See the OpenAPI schema for the accepted JSON body and required content type.

Responses

  • 201 Key metadata plus reveal-once value
  • 400
  • 401
  • 403
  • 404
GET/v1/admin/keys

Keys · listManagementKeys

List bounded management-key metadata

Parameters

  • parameter · · optional

Responses

  • 200
  • 400
  • 401
  • 403
  • 404
DELETE/v1/admin/keys/{keyId}

Keys · revokeManagementKey

Revoke a management key immediately

Parameters

  • parameter · · optional
  • parameter · · optional

Responses

  • 200
  • 400
  • 401
  • 403
  • 404
POST/v1/admin/apps/{appId}/webhook-proposals

Webhooks · createWebhookProposal

Propose a durable webhook endpoint change without revealing a secret

Parameters

  • parameter · · optional

Request body

See the OpenAPI schema for the accepted JSON body and required content type.

Responses

  • 201
  • 400
  • 401
  • 403
  • 404
  • 409
GET/v1/admin/webhook-proposals

Webhooks · listWebhookProposals

List visible durable webhook proposals

Parameters

  • app_id · query · optional
  • status · query · optional
  • cursor · query · optional
  • parameter · · optional

Responses

  • 200
  • 400
  • 401
  • 403
GET/v1/admin/webhook-proposals/{proposalId}

Webhooks · getWebhookProposal

Preview a durable webhook proposal

Parameters

  • parameter · · optional

Responses

  • 200
  • 401
  • 403
  • 404
POST/v1/admin/webhook-proposals/{proposalId}/apply

Webhooks · applyWebhookProposal

Apply a webhook proposal by reference without returning signing material

Parameters

  • parameter · · optional
  • parameter · · optional

Request body

See the OpenAPI schema for the accepted JSON body and required content type.

Responses

  • 200
  • 400
  • 401
  • 403
  • 404
  • 409
POST/v1/admin/webhook-proposals/{proposalId}/cancel

Webhooks · cancelWebhookProposal

Cancel a pending webhook proposal

Parameters

  • parameter · · optional

Responses

  • 200
  • 400
  • 401
  • 403
  • 404
POST/v1/admin/apps/{appId}/webhooks

Webhooks · createWebhook

Register a webhook and reveal its signing secret once

Request body

See the OpenAPI schema for the accepted JSON body and required content type.

Responses

  • 201
  • 400
  • 401
  • 403
  • 404
GET/v1/admin/apps/{appId}/webhooks

Webhooks · listWebhooks

List webhook metadata without secrets

Responses

  • 200
  • 401
  • 403
  • 404
GET/v1/admin/apps/{appId}/webhooks/deliveries

Webhooks · listWebhookDeliveries

List recent webhook delivery attempts

Parameters

  • parameter · · optional
  • parameter · · optional

Responses

  • 200
  • 401
  • 403
  • 404
POST/v1/admin/apps/{appId}/webhooks/deliveries/{deliveryId}/replay

Webhooks · replayWebhookDelivery

Replay a delivery while retaining the event id

Parameters

  • parameter · · optional
  • parameter · · optional

Responses

  • 200
  • 401
  • 403
  • 404
PATCH/v1/admin/apps/{appId}/webhooks/{endpointId}

Webhooks · updateWebhook

Update webhook URL, event registry, or enabled state

Request body

See the OpenAPI schema for the accepted JSON body and required content type.

Responses

  • 200
  • 400
  • 401
  • 403
  • 404
DELETE/v1/admin/apps/{appId}/webhooks/{endpointId}

Webhooks · deleteWebhook

Delete a webhook endpoint

Responses

  • 200
  • 401
  • 403
  • 404
POST/v1/admin/apps/{appId}/webhooks/{endpointId}/rotate-secret

Webhooks · rotateWebhookSecret

Rotate and reveal a webhook signing secret once

Parameters

  • parameter · · optional
  • parameter · · optional

Responses

  • 200
  • 401
  • 403
  • 404
  • 500
POST/v1/admin/apps/{appId}/users/{externalId}/grants

Money · createGrant

Grant units idempotently

X-Idempotency-Key is canonical; body idempotency_key is a deprecated compatibility alias.

Parameters

  • parameter · · optional
  • parameter · · optional
  • parameter · · optional

Request body

See the OpenAPI schema for the accepted JSON body and required content type.

Responses

  • 200
  • 400
  • 401
  • 403
  • 404
POST/v1/admin/apps/{appId}/grants/{grantId}/reverse

Money · reverseGrant

Reverse a grant idempotently

Parameters

  • parameter · · optional
  • parameter · · optional
  • parameter · · optional

Responses

  • 200
  • 401
  • 403
  • 404
GET/v1/admin/apps/{appId}/usage

Money · getUsage

Query windowed usage rollups

Parameters

  • parameter · · optional
  • parameter · · optional
  • parameter · · optional
  • parameter · · optional
  • group_by · query · optional

Responses

  • 200
  • 400
  • 401
  • 403
  • 404
GET/v1/admin/apps/{appId}/pricing-insights

Money · getPricingInsights

Query closed-window per-user pricing distributions

Percentiles are null below 20 users with typed insufficient_samples evidence.

Parameters

  • parameter · · optional
  • parameter · · optional
  • parameter · · optional

Responses

  • 200
  • 400
  • 401
  • 403
  • 404
GET/v1/admin/apps/{appId}/rules

Rules · getRules

Read the current revisioned ruleset

Parameters

  • parameter · · optional

Responses

  • 200
  • 401
  • 403
  • 404
POST/v1/admin/apps/{appId}/rules:preview

Rules · previewRules

Preview rules against recent traffic and bind a content hash

Parameters

  • parameter · · optional

Request body

See the OpenAPI schema for the accepted JSON body and required content type.

Responses

  • 201
  • 400
  • 401
  • 403
  • 404
POST/v1/admin/apps/{appId}/rules/proposals

Rules · proposeRules

Create a preview-hash-bound rules proposal

Parameters

  • parameter · · optional

Request body

See the OpenAPI schema for the accepted JSON body and required content type.

Responses

  • 201
  • 400
  • 401
  • 403
  • 404
GET/v1/admin/apps/{appId}/users

Privacy · listUsers

List active users for an app

Parameters

  • parameter · · optional
  • cursor · query · optional
  • parameter · · optional

Responses

  • 200
  • 400
  • 401
  • 403
  • 404
GET/v1/admin/apps/{appId}/users/{externalId}

Privacy · getUser

Read an existing user, balance, and recent usage

Responses

  • 200
  • 401
  • 403
  • 404
DELETE/v1/admin/apps/{appId}/users/{externalId}

Privacy · anonymizeUser

Anonymize identity while retaining money history

A Clerk developer session requires a recent second factor.

Responses

  • 200
  • 401
  • 403
  • 404
GET/v1/admin/apps/{appId}/users/{externalId}/export

Privacy · exportUser

Export retained user identity, money, usage, and timing data

Parameters

  • parameter · · optional
  • parameter · · optional

Responses

  • 200
  • 401
  • 403
  • 404
GET/v1/admin/config

Configuration · getConfig

Read visible tenant configuration and current revisions

Responses

  • 200
  • 401
  • 403
  • 404
PUT/v1/admin/config

Configuration · applyConfigDirect

Apply a config document directly with apply scope

Ruleset changes are rejected and must use preview-bound proposals.

Request body

See the OpenAPI schema for the accepted JSON body and required content type.

Responses

  • 200
  • 400
  • 401
  • 403
  • 404
GET/v1/admin/config/proposals

Configuration · listConfigProposals

List visible durable proposals across config, rules, and webhooks

Parameters

  • app_id · query · optional
  • kind · query · optional
  • status · query · optional
  • cursor · query · optional
  • parameter · · optional

Responses

  • 200
  • 400
  • 401
  • 403
POST/v1/admin/config/proposals

Configuration · createConfigProposal

Propose a tenant config against its current base revision

Request body

See the OpenAPI schema for the accepted JSON body and required content type.

Responses

  • 201 Durable proposal
  • 400
  • 401
  • 403
  • 404
GET/v1/admin/config/proposals/{proposalId}

Configuration · getConfigProposal

Preview proposal document, attribution, expiry, and status

Parameters

  • parameter · · optional

Responses

  • 200 Proposal preview
  • 401
  • 403
  • 404
POST/v1/admin/config/proposals/{proposalId}/apply

Configuration · applyConfigProposal

Apply a proposal by reference with base-revision CAS

A Clerk developer session requires a recent second factor.

Parameters

  • parameter · · optional
  • parameter · · optional

Request body

See the OpenAPI schema for the accepted JSON body and required content type.

Responses

  • 200 Applied revision or idempotent replay
  • 400
  • 401
  • 403
  • 404
  • 409
POST/v1/admin/config/proposals/{proposalId}/cancel

Configuration · cancelConfigProposal

Cancel a pending proposal as its creator or with apply scope

Parameters

  • parameter · · optional

Responses

  • 200
  • 400
  • 401
  • 403
  • 404
GET/v1/admin/audit

Operations · queryAudit

Query tenant-scoped actor-attributed management audit events

Parameters

  • parameter · · optional
  • parameter · · optional
  • action · query · optional
  • resource_type · query · optional
  • actor · query · optional
  • since · query · optional
  • until · query · optional

Responses

  • 200 Audit events, newest first
  • 400
  • 401
  • 403
  • 404
POST/v1/admin/apps/{appId}/doctor

Operations · runDoctor

Run non-billable auth, provider, or webhook probes

Parameters

  • parameter · · optional

Request body

See the OpenAPI schema for the accepted JSON body and required content type.

Responses

  • 200
  • 400
  • 401
  • 403
  • 404
GET/v1/admin/feature-templates

Configuration · listFeatureTemplates

List built-in mock-first feature templates

Responses

  • 200
  • 401
  • 403
POST/v1/admin/apps/{appId}/feature-templates/{templateId}/instantiate

Configuration · instantiateFeatureTemplate

Instantiate a template as an ordinary config revision

Parameters

  • parameter · · optional
  • parameter · · optional

Request body

See the OpenAPI schema for the accepted JSON body and required content type.

Responses

  • 201
  • 400
  • 401
  • 403
  • 404
GET/v1/admin/apps/{appId}/sandbox/fixtures

Operations · listSandboxFixtures

List deterministic success and typed-error fixtures

Parameters

  • parameter · · optional

Responses

  • 200
  • 401
  • 403
  • 404
POST/v1/admin/apps/{appId}/sandbox/sessions

Operations · createSandboxSession

Create a named deterministic sandbox session

Clerk developer sessions require a recent second factor.

Parameters

  • parameter · · optional

Request body

See the OpenAPI schema for the accepted JSON body and required content type.

Responses

  • 201
  • 400
  • 401
  • 403
  • 404
GET/v1/admin/apps/{appId}/sandbox/sessions/{sessionId}

Operations · getSandboxSession

Read a sandbox session and its durable runs

Parameters

  • parameter · · optional
  • parameter · · optional

Responses

  • 200
  • 401
  • 403
  • 404
POST/v1/admin/apps/{appId}/sandbox/sessions/{sessionId}/runs

Operations · runSandboxFixture

Run a named deterministic fixture

Clerk developer sessions require a recent second factor.

Parameters

  • parameter · · optional
  • parameter · · optional

Request body

See the OpenAPI schema for the accepted JSON body and required content type.

Responses

  • 201
  • 400
  • 401
  • 403
  • 404
GET/v1/admin/apps/{appId}/readiness

Operations · getReadiness

Read durable onboarding readiness evidence

Parameters

  • parameter · · optional

Responses

  • 200
  • 401
  • 403
  • 404
GET/v1/admin/apps/{appId}/request-traces/{requestId}

Operations · getRequestTrace

Join reservation, settlement, usage, and optional client timing by request id

Parameters

  • parameter · · optional
  • parameter · · optional

Responses

  • 200
  • 401
  • 403
  • 404
GET/v1/admin/apps/{appId}/integration-snippet

Operations · getIntegrationSnippet

Generate an HTTP/curl-only integration snippet

Parameters

  • parameter · · optional
  • mode · query · optional
  • feature_id · query · optional

Responses

  • 200
  • 400
  • 401
  • 403
  • 404

Weirgate API 2026-07-18