@reclaimprotocol/client 0.1.33 → 0.1.34

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -3,10 +3,6 @@ export declare const ROUTES: {
3
3
  readonly method: "post";
4
4
  readonly path: "/orgs/{orgId}/invite";
5
5
  };
6
- readonly ActivateFixWithAiRepair: {
7
- readonly method: "post";
8
- readonly path: "/v/{sessionId}/fix-with-ai/activate";
9
- };
10
6
  readonly AddOrgMember: {
11
7
  readonly method: "post";
12
8
  readonly path: "/orgs/{orgId}/members";
@@ -131,6 +127,10 @@ export declare const ROUTES: {
131
127
  readonly method: "post";
132
128
  readonly path: "/orgs/{orgId}/agent-browser-sessions";
133
129
  };
130
+ readonly CreateAiVerificationSession: {
131
+ readonly method: "post";
132
+ readonly path: "/verifications/ai-sessions";
133
+ };
134
134
  readonly CreateBillingCheckoutSession: {
135
135
  readonly method: "post";
136
136
  readonly path: "/orgs/{orgId}/billing/checkout";
@@ -143,6 +143,10 @@ export declare const ROUTES: {
143
143
  readonly method: "post";
144
144
  readonly path: "/verifications/callback-subscriptions";
145
145
  };
146
+ readonly CreateCardSetupSession: {
147
+ readonly method: "post";
148
+ readonly path: "/orgs/{orgId}/billing/card";
149
+ };
146
150
  readonly CreateCreditCheckoutSession: {
147
151
  readonly method: "post";
148
152
  readonly path: "/orgs/{orgId}/billing/credits/checkout";
@@ -283,6 +287,10 @@ export declare const ROUTES: {
283
287
  readonly method: "get";
284
288
  readonly path: "/v/{sessionId}/fix-with-ai";
285
289
  };
290
+ readonly GetAiVerificationSession: {
291
+ readonly method: "get";
292
+ readonly path: "/verifications/ai-sessions/{sessionId}";
293
+ };
286
294
  readonly GetImage: {
287
295
  readonly method: "get";
288
296
  readonly path: "/images/{imageId}";
package/lib/routes.gen.js CHANGED
@@ -1,11 +1,10 @@
1
1
  // AUTO-GENERATED by packages/app/scripts/mcp-tools-gen.ts
2
- // from packages/app/openapi.yaml (spec v0.1.0, source sha256:3e28ff308da3).
2
+ // from packages/app/openapi.yaml (spec v0.1.0, source sha256:e2db795ab15c).
3
3
  // The hash catches drift the version misses (a spec can change without a
4
4
  // version bump) — do not remove it as "redundant" with the version.
5
5
  // Run `npm run openapi:gen --workspace=packages/app` to regenerate. Do not edit by hand.
6
6
  export const ROUTES = {
7
7
  "AcceptOrgInvite": { "method": "post", "path": "/orgs/{orgId}/invite" },
8
- "ActivateFixWithAiRepair": { "method": "post", "path": "/v/{sessionId}/fix-with-ai/activate" },
9
8
  "AddOrgMember": { "method": "post", "path": "/orgs/{orgId}/members" },
10
9
  "AddProviderContributionComment": { "method": "post", "path": "/providers/{providerId}/contributions/{campaignId}/comments" },
11
10
  "AddStaffMember": { "method": "post", "path": "/admin/staff" },
@@ -37,9 +36,11 @@ export const ROUTES = {
37
36
  "ChangeOrgPlan": { "method": "post", "path": "/orgs/{orgId}/billing/change-plan" },
38
37
  "ConsentPage": { "method": "get", "path": "/oauth/consent" },
39
38
  "CreateAgentBrowserSession": { "method": "post", "path": "/orgs/{orgId}/agent-browser-sessions" },
39
+ "CreateAiVerificationSession": { "method": "post", "path": "/verifications/ai-sessions" },
40
40
  "CreateBillingCheckoutSession": { "method": "post", "path": "/orgs/{orgId}/billing/checkout" },
41
41
  "CreateBillingPortalSession": { "method": "post", "path": "/orgs/{orgId}/billing/portal" },
42
42
  "CreateCallbackSubscription": { "method": "post", "path": "/verifications/callback-subscriptions" },
43
+ "CreateCardSetupSession": { "method": "post", "path": "/orgs/{orgId}/billing/card" },
43
44
  "CreateCreditCheckoutSession": { "method": "post", "path": "/orgs/{orgId}/billing/credits/checkout" },
44
45
  "CreateFeatureFlag": { "method": "post", "path": "/admin/feature-flags" },
45
46
  "CreateFetchAuthorization": { "method": "post", "path": "/fetch/authorizations" },
@@ -75,6 +76,7 @@ export const ROUTES = {
75
76
  "Docs": { "method": "get", "path": "/docs" },
76
77
  "ExplorePreviewImage": { "method": "get", "path": "/og/explore.png" },
77
78
  "FixWithAiRecovery": { "method": "get", "path": "/v/{sessionId}/fix-with-ai" },
79
+ "GetAiVerificationSession": { "method": "get", "path": "/verifications/ai-sessions/{sessionId}" },
78
80
  "GetImage": { "method": "get", "path": "/images/{imageId}" },
79
81
  "GetMe": { "method": "get", "path": "/me" },
80
82
  "GetOrg": { "method": "get", "path": "/orgs/{orgId}" },
@@ -11,8 +11,8 @@ export interface paths {
11
11
  cookie?: never;
12
12
  };
13
13
  /**
14
- * Home — sign-in or Discover
15
- * @description Signed in, renders Discover (see `GET /discover`). Signed out, renders the sign-in page; a signed-out link carrying Discover's `q` / `tag` redirects to `/discover` with them.
14
+ * Home — sign-in or the Dashboard
15
+ * @description Signed in, redirects to the Dashboard (`GET /orgs/{orgId}`) of the console's selected org, else the viewer's default org. Signed out, renders the sign-in page; a signed-out link carrying Discover's `q` / `tag` redirects to `/discover` with them.
16
16
  */
17
17
  get: operations["Index"];
18
18
  put?: never;
@@ -1110,6 +1110,8 @@ export interface paths {
1110
1110
  * - `zkfetch` — a static informational page. zkFetch has no claimant
1111
1111
  * step; nothing ever redirects a browser here by design.
1112
1112
  *
1113
+ * A session from `POST /verifications/ai-sessions` never redirects for now. While its lookup runs, the page shows a loading state and reloads itself. Then it shows the candidate pages, and asks the user to pick one when there are several (nothing happens after the pick yet). When the lookup failed, the page shows an error and closes itself after 5 seconds. A session that is no longer pending shows that it ended.
1114
+ * `redirectUrl`, `redirectUrlOptions`, `cancelRedirectUrl`, and `cancelRedirectUrlOptions` in the query are added to the session's `launchOptions`, where every Verification Client can read them, unless the session already has that option: options set at creation, or by an earlier visit, win. They're validated as at creation (`https:` only); an invalid one is a 400. The `portals` redirect carries the session's launch options, and any other query parameters, on to the portal.
1113
1115
  * Sets `Referrer-Policy: no-referrer`, so a `sessionId` never rides along in a `Referer` header to wherever a client eventually redirects.
1114
1116
  */
1115
1117
  get: operations["SharePage"];
@@ -1235,8 +1237,8 @@ export interface paths {
1235
1237
  get: operations["FixWithAiRecovery"];
1236
1238
  put?: never;
1237
1239
  /**
1238
- * Create or reopen a billed AI repair session
1239
- * @description Creates one idempotent repair attempt for the selected failed provider. The source organization is charged only when a new child is created. Repeated requests reopen a pending or successful child. After a child ends in error, rejection, or expiry, a later request creates a new, separately billed attempt. The server derives the exact failed version and repair prompt.
1240
+ * Create a billed AI repair session
1241
+ * @description Creates a verification session that pins the selected failed provider's exact version with `preferAiAgent`, charged to the source organization. Its verification page runs the AI authoring agent instead of the stored recipe. A proven recipe is published for the provider's own organization, or submitted for admin review otherwise. Every request creates a new, separately billed session.
1240
1242
  */
1241
1243
  post: operations["CreateFixWithAiSession"];
1242
1244
  delete?: never;
@@ -1245,26 +1247,6 @@ export interface paths {
1245
1247
  patch?: never;
1246
1248
  trace?: never;
1247
1249
  };
1248
- "/v/{sessionId}/fix-with-ai/activate": {
1249
- parameters: {
1250
- query?: never;
1251
- header?: never;
1252
- path?: never;
1253
- cookie?: never;
1254
- };
1255
- get?: never;
1256
- put?: never;
1257
- /**
1258
- * Start a pending AI repair after the verification page loads
1259
- * @description Idempotently queues a pending repair session. The server derives the claimant country from the request and publishes no browser credentials.
1260
- */
1261
- post: operations["ActivateFixWithAiRepair"];
1262
- delete?: never;
1263
- options?: never;
1264
- head?: never;
1265
- patch?: never;
1266
- trace?: never;
1267
- };
1268
1250
  "/.well-known/jwks.json": {
1269
1251
  parameters: {
1270
1252
  query?: never;
@@ -1776,7 +1758,7 @@ export interface paths {
1776
1758
  get: operations["GetOrgKeypair"];
1777
1759
  /**
1778
1760
  * Set (or rotate) the organization's encryption keypair
1779
- * @description Upserts the organization's single Ethereum (secp256k1) encryption keypair. The body carries the org's **eth public key** — as an uncompressed hex string (`0x04`+128 hex) or a secp256k1 public JWK (`{kty:'EC', crv:'secp256k1', x, y}`) — and `canEncryptResult`. The matching private key never leaves the consumer. Setting overwrites the single row (and creates it for a keyless org). When `canEncryptResult` is true, terminal results are delivered as an ECIES ciphertext encrypted to this key; otherwise plaintext. Authenticated by the org's `OrgToken` or a human `BearerAuth` session for an active member of the org.
1761
+ * @description Sets the organization's single Ethereum (secp256k1) encryption keypair. The body carries the org's **eth public key** — as an uncompressed hex string (`0x04`+128 hex) or a secp256k1 public JWK (`{kty:'EC', crv:'secp256k1', x, y}`) — and `canEncryptResult`. The matching private key never leaves the consumer. The call creates the key for a keyless org and is idempotent for the same key. If the org has a different key, it returns `409` unless `replace` is true. When `canEncryptResult` is true, terminal results are delivered as an ECIES ciphertext encrypted to this key; otherwise plaintext. Authenticated by the org's `OrgToken` or a human `BearerAuth` session for an active member of the org.
1780
1762
  */
1781
1763
  put: operations["SetOrgKeypair"];
1782
1764
  post?: never;
@@ -2038,6 +2020,26 @@ export interface paths {
2038
2020
  patch?: never;
2039
2021
  trace?: never;
2040
2022
  };
2023
+ "/orgs/{orgId}/billing/card": {
2024
+ parameters: {
2025
+ query?: never;
2026
+ header?: never;
2027
+ path?: never;
2028
+ cookie?: never;
2029
+ };
2030
+ get?: never;
2031
+ put?: never;
2032
+ /**
2033
+ * Save a card for the organization
2034
+ * @description Owner only. Returns a Stripe Checkout URL that only saves a card (no charge), creating the organization's Stripe customer on first use. The saved card becomes the default that plans and overage bill. Stripe returns the owner to the Billing tab with `?billing=card`.
2035
+ */
2036
+ post: operations["CreateCardSetupSession"];
2037
+ delete?: never;
2038
+ options?: never;
2039
+ head?: never;
2040
+ patch?: never;
2041
+ trace?: never;
2042
+ };
2041
2043
  "/orgs/{orgId}/billing/subscription": {
2042
2044
  parameters: {
2043
2045
  query?: never;
@@ -2334,7 +2336,7 @@ export interface paths {
2334
2336
  };
2335
2337
  /**
2336
2338
  * Get a specific provider version
2337
- * @description Fetches one exact canonical version. Trunk is public when the provider is public. Non-trunk versions are visible to admins and members of the provider's organization. A member of the organization that paid for a successful AI repair may also read only the exact `fixed` version created by that repair.
2339
+ * @description Fetches one exact canonical version. Trunk is public when the provider is public. Non-trunk versions are visible to admins and members of the provider's organization.
2338
2340
  */
2339
2341
  get: operations["GetProviderVersion"];
2340
2342
  put?: never;
@@ -2679,7 +2681,7 @@ export interface paths {
2679
2681
  };
2680
2682
  /**
2681
2683
  * Verification outcomes by day, device, and country
2682
- * @description Organization-scoped creation cohorts in UTC. Outcomes are current at query time. Unknown device and country values have their own buckets.
2684
+ * @description Organization-scoped creation cohorts in UTC. Outcomes are current at query time. Unknown device and country values have their own buckets. A signed-in browser asking for HTML is redirected to the org's Dashboard (`GET /orgs/{orgId}`), which shows these analytics, with the same query.
2683
2685
  */
2684
2686
  get: operations["GetOrgVerificationAnalytics"];
2685
2687
  put?: never;
@@ -2742,6 +2744,118 @@ export interface paths {
2742
2744
  patch?: never;
2743
2745
  trace?: never;
2744
2746
  };
2747
+ "/verifications/ai-sessions": {
2748
+ parameters: {
2749
+ query?: never;
2750
+ header?: never;
2751
+ path?: never;
2752
+ cookie?: never;
2753
+ };
2754
+ get?: never;
2755
+ put?: never;
2756
+ /**
2757
+ * Start an AI verification session from a prompt
2758
+ * @description Starts a verification from a plain-language prompt, such as "verify
2759
+ * I'm a student at Manipal University", instead of a list of providers.
2760
+ * Builder creates the session at once and returns it, as
2761
+ * `POST /verifications/sessions` does. Send the user to its
2762
+ * `verificationUrl`. In the background, Builder looks up the
2763
+ * `candidates` (pages the user opens and signs in to) and the
2764
+ * `dataPoints` to verify there, usually within a few seconds. Poll
2765
+ * `GET /verifications/ai-sessions/{sessionId}` until its `status` is
2766
+ * `ready` or `failed`. The share page at `verificationUrl` shows a
2767
+ * loading state meanwhile.
2768
+ *
2769
+ * Builder searches the provider catalog (public providers and your
2770
+ * organization's own providers) and the web. The web search finds a
2771
+ * portal the catalog lacks, or one that replaced a stale catalog page.
2772
+ * Builder caches a web result for a week, or for a day when it finds
2773
+ * nothing. A URL or domain in the prompt is a hint: pages on it rank
2774
+ * first.
2775
+ *
2776
+ * Deterministic checks run before any AI model. Builder rejects a
2777
+ * prompt that contains a password, card number, or Aadhaar number, that
2778
+ * contains instructions for the AI, or that makes a sensitive claim,
2779
+ * without calling a model. Builder withholds personal values the prompt
2780
+ * states, such as a name, email address, phone number, or student ID,
2781
+ * from the model and from the cache.
2782
+ *
2783
+ * Once the lookup is ready, the session's `context` holds the values
2784
+ * the prompt states, such as the user's name, merged with the `context`
2785
+ * you send. Your values take precedence.
2786
+ *
2787
+ * On `201`, the session has no providers: the AI agent works out how to
2788
+ * verify. The organization needs a callback subscription. The session
2789
+ * uses one verification from the quota pool of the
2790
+ * `verificationClientUrl` client. A prompt the checks above reject
2791
+ * creates no session and is free. If the lookup then fails (the prompt
2792
+ * isn't a request to verify something about the user, no login page
2793
+ * is found, or the model or web search stays unavailable), Builder
2794
+ * refunds the verification, ends the session with status `error`, and
2795
+ * sends the failure to your `verification_error` callbacks. Builder
2796
+ * caches lookups, so a repeated prompt resolves faster, even when it
2797
+ * names a different person.
2798
+ *
2799
+ * curl -X POST $BASE/verifications/ai-sessions \
2800
+ * -H "Authorization: Bearer $ORG_TOKEN" \
2801
+ * -H 'Content-Type: application/json' \
2802
+ * -d '{"prompt":"verify I am a student at Manipal University"}'
2803
+ *
2804
+ * Errors:
2805
+ *
2806
+ * - `400`: Builder rejects the prompt (for example, it targets an
2807
+ * internal host), `context` contains `attestationNonce` or
2808
+ * `attestationNonceData`, or `verificationClientUrl` isn't a
2809
+ * registered client.
2810
+ * - `409`: The organization has no callback subscription.
2811
+ * - `429` or `402`: The quota or credits are spent. The body has
2812
+ * `event: billing_required` and a terminal `sessionId`.
2813
+ *
2814
+ * A failed lookup isn't an error of this request: it shows in the
2815
+ * `error` of `GET /verifications/ai-sessions/{sessionId}`.
2816
+ */
2817
+ post: operations["CreateAiVerificationSession"];
2818
+ delete?: never;
2819
+ options?: never;
2820
+ head?: never;
2821
+ patch?: never;
2822
+ trace?: never;
2823
+ };
2824
+ "/verifications/ai-sessions/{sessionId}": {
2825
+ parameters: {
2826
+ query?: never;
2827
+ header?: never;
2828
+ path?: never;
2829
+ cookie?: never;
2830
+ };
2831
+ /**
2832
+ * Get what an AI verification session's prompt resolved to
2833
+ * @description Returns the lookup that `POST /verifications/ai-sessions` started for
2834
+ * the session. `status` is `resolving` until it finishes, then `ready`
2835
+ * with the pages and data points it found, or `failed` with an
2836
+ * `error`. Poll every second or two while it's `resolving`.
2837
+ *
2838
+ * `candidates` lists the pages to open, best first, each with a
2839
+ * `source` of `catalog` or `web`. It usually has one page. It has
2840
+ * several (up to 3) only when their `confidence` values are within 0.1
2841
+ * of the best page's value. In that case, the user picks one on the
2842
+ * session's `verificationUrl`.
2843
+ *
2844
+ * The `OrgToken` must resolve to the session's organization. To track
2845
+ * the session's status, call `GET /verifications/sessions/{sessionId}`.
2846
+ *
2847
+ * curl $BASE/verifications/ai-sessions/$SESSION_ID \
2848
+ * -H "Authorization: Bearer $ORG_TOKEN"
2849
+ */
2850
+ get: operations["GetAiVerificationSession"];
2851
+ put?: never;
2852
+ post?: never;
2853
+ delete?: never;
2854
+ options?: never;
2855
+ head?: never;
2856
+ patch?: never;
2857
+ trace?: never;
2858
+ };
2745
2859
  "/verifications/sessions/{sessionId}": {
2746
2860
  parameters: {
2747
2861
  query?: never;
@@ -3240,6 +3354,64 @@ export interface components {
3240
3354
  ProviderID: string;
3241
3355
  /** Format: uuid */
3242
3356
  OrgID: string;
3357
+ /** @description Body for `POST /verifications/ai-sessions`. */
3358
+ CreateAiVerificationSessionRequest: {
3359
+ /** @description What to verify, in plain language, such as "verify I'm a student at Manipal University". Builder rejects a prompt that contains credentials, card numbers, instructions for the AI, or a sensitive claim. */
3360
+ prompt: string;
3361
+ /** @description Values you already know, such as `{"fullName": "Asha Rao"}`. Builder merges them over the values the prompt states and returns the result in `context`. Must not contain `attestationNonce` or `attestationNonceData`; bind those after you create the session. Omit if you have none. */
3362
+ context?: {
3363
+ [key: string]: unknown;
3364
+ };
3365
+ /** @description Base URL of the registered verification client the user verifies with, as for `POST /verifications/sessions`. Builder charges this client's quota pool. If you omit it, Builder uses the default (`portals`) client. */
3366
+ verificationClientUrl?: string;
3367
+ /** @description ISO 3166-1 alpha-2 country code, such as `IN`. Builder searches the web from this country (Google's `gl` parameter), so portals for that country rank first. If you omit it, the search has no country preference. */
3368
+ geoLocation?: string;
3369
+ };
3370
+ /** @description The lookup `POST /verifications/ai-sessions` started for a session: its status, and once `ready`, the pages to open and the data points to verify there. */
3371
+ AiVerificationSession: {
3372
+ /**
3373
+ * Format: uuid
3374
+ * @description ID of the verification session. To track the session, call `GET /verifications/sessions/{sessionId}`.
3375
+ */
3376
+ sessionId: string;
3377
+ /**
3378
+ * @description `resolving` while Builder looks up the pages and data points. `ready` when `candidates` and `dataPoints` are set. `failed` when the lookup failed: `error` says why, the session ended with status `error`, and its verification was refunded.
3379
+ * @enum {string}
3380
+ */
3381
+ status: "resolving" | "ready" | "failed";
3382
+ /** @description Why the lookup failed. Only when `status` is `failed`. Its `status` is 422 when the prompt isn't a request to verify something about the user, 404 when no login page was found, and 503 when the AI model or web search stayed unavailable. */
3383
+ error?: components["schemas"]["Problem"];
3384
+ /** @description Only when `status` is `ready`. The fewest data points that prove the prompt's claim, required data points first. A data point for a value the prompt states is always required. */
3385
+ dataPoints?: {
3386
+ /** @description Short camelCase name, such as `username`. */
3387
+ name: string;
3388
+ /** @description What the value is and why it proves the claim. */
3389
+ description: string;
3390
+ /** @description If `true`, the claim can be proven without this value, as with `isOptional` on a provider's `ResponseMatch`. If absent, the data point is required. */
3391
+ isOptional?: boolean;
3392
+ }[];
3393
+ /** @description Values the signed-in account must show, such as `{"fullName": "Asha Rao"}`. Each key is the `dataPoints` name that the value pins. It combines the values the prompt states with the request's `context`. It's empty if neither has any. It's the session's `context`. If the prompt names a specific page, such as a post, `pageUrl` holds it: the page to open after the user logs in on the candidate's site. */
3394
+ context: {
3395
+ [key: string]: unknown;
3396
+ };
3397
+ /** @description Only when `status` is `ready`. Pages to open, best first. Each is the page that shows the data after the user signs in (it sends the user to sign in first), or else the sign-in page. Usually one page. Several pages appear only when the choice is ambiguous, such as a college with two or three student portals whose `confidence` values are within 0.1 of the best. In that case, the user picks one on the session's `verificationUrl`. At most one page per host. */
3398
+ candidates?: components["schemas"]["ResolvedLoginPage"][];
3399
+ };
3400
+ /** @description A page for the user to open and sign in to. */
3401
+ ResolvedLoginPage: {
3402
+ /**
3403
+ * Format: uri
3404
+ * @description URL of the page to open. For a `web` page, Builder removes the query and fragment.
3405
+ */
3406
+ loginUrl: string;
3407
+ /** @description Estimated likelihood, from 0 to 1, that signing in here shows the claim. Candidates below 0.5 are never returned. */
3408
+ confidence: number;
3409
+ /**
3410
+ * @description Where the page came from. `catalog` is the page of a provider in the catalog (public, or your organization's own). `web` is a page that a web search found; it has no provider yet.
3411
+ * @enum {string}
3412
+ */
3413
+ source: "catalog" | "web";
3414
+ };
3243
3415
  /** @description A verification client id used as a filter. Hyphens are ignored. */
3244
3416
  VerificationClientIDFilter: string;
3245
3417
  /** @description An organization id used as a filter. Hyphens are ignored, so it matches with or without them; an id that matches no organization returns nothing. */
@@ -3744,6 +3916,11 @@ export interface components {
3744
3916
  /** @default false */
3745
3917
  canEncryptResult: boolean;
3746
3918
  label?: string;
3919
+ /**
3920
+ * @description Set to true to replace an existing, different public key. Without it, the call returns 409 when the organization already has another key. Results encrypted to the old key can no longer be decrypted.
3921
+ * @default false
3922
+ */
3923
+ replace: boolean;
3747
3924
  };
3748
3925
  /** @description Body for `PUT /orgs/{orgId}/keypair`. Carries the org's eth public key as a secp256k1 public JWK. */
3749
3926
  OrgKeypairJwkRequest: {
@@ -3751,6 +3928,11 @@ export interface components {
3751
3928
  /** @default false */
3752
3929
  canEncryptResult: boolean;
3753
3930
  label?: string;
3931
+ /**
3932
+ * @description Set to true to replace an existing, different public key. Without it, the call returns 409 when the organization already has another key. Results encrypted to the old key can no longer be decrypted.
3933
+ * @default false
3934
+ */
3935
+ replace: boolean;
3754
3936
  };
3755
3937
  /** @description Response of `POST /orgs/{orgId}/token`. The plaintext `orgSecret` is shown **only once** here; the server stores only its HMAC. Use it as `Authorization: Bearer <orgSecret>` (the `OrgToken` scheme). An org may hold several keys; issuing a new one does not affect the others. */
3756
3938
  OrgToken: {
@@ -5710,7 +5892,7 @@ export interface components {
5710
5892
  resolvedVersion: string;
5711
5893
  /** Format: uri */
5712
5894
  initialUrl: string;
5713
- /** @description Legacy-only preference. Builder clients always run the structured recipe and never enable AI or manual verification from this value. */
5895
+ /** @description Effective AI-agent preference: the session's choice, else whether the version is an `llm` provider. When true, the Builder verification page runs the AI authoring agent instead of the structured recipe. */
5714
5896
  preferAiAgent: boolean;
5715
5897
  geoLocation?: string;
5716
5898
  jsUserScripts?: string;
@@ -5760,7 +5942,7 @@ export interface components {
5760
5942
  preferredLocale?: string;
5761
5943
  /** @description When the organization-bound legacy TEE nonce context was first stored. The nonce data itself is present in `context` as `attestationNonce` and `attestationNonceData`. */
5762
5944
  teeNonceBoundAt?: components["schemas"]["Timestamp"];
5763
- /** @description Legacy-only preference echoed for compatibility. Builder-mode clients run the structured recipe and do not enable AI or manual verification. */
5945
+ /** @description The creator's AI-agent preference. When true, the Builder verification page runs the AI authoring agent instead of the structured recipe. */
5764
5946
  preferAiAgent?: boolean;
5765
5947
  /** @description Whether this session was created with diagnostic mode enabled (see CreateVerificationSessionRequest.diagnostics). Set once at creation and never changes afterward. Gates whether Builder records claimant IP addresses and how much detail diagnostic events carry; the `diag` parameter on `verificationUrl` mirrors this value and is not itself authoritative. */
5766
5948
  diagnostics: boolean;
@@ -5828,7 +6010,7 @@ export interface components {
5828
6010
  themeId?: components["schemas"]["ThemeID"];
5829
6011
  /** @description Optional locale override for this verification session. It takes precedence over the organization theme's preferred locale. */
5830
6012
  preferredLocale?: string;
5831
- /** @description Legacy-only preference. Builder mode runs the structured recipe and does not enable AI or manual verification. Omit this field for Builder-mode sessions; dual-mode clients may continue to interpret it only on their legacy path. */
6013
+ /** @description When true, the Builder verification page runs the AI authoring agent instead of the providers' structured recipes. A proven recipe is published only for the provider's own organization; for any other provider it is submitted for admin review. Omit it to run the stored recipes. */
5832
6014
  preferAiAgent?: boolean;
5833
6015
  /** @description Optional; omit or send false for a normal session. Opts this session into diagnostic mode. A diagnostic session records more event detail, including personal data such as the claimant's IP addresses (see ClaimantDetails.network). Builder appends `diag=1` to the returned `verificationUrl` for a diagnostic session and strips any `diag` value the Consumer's own `verificationClientUrl` carries, so this field — not the URL — is the only way to turn diagnostics on. Treat a diagnostic verification URL as sensitive, and don't hand it to a claimant by default. */
5834
6016
  diagnostics?: boolean;
@@ -6299,6 +6481,13 @@ export interface operations {
6299
6481
  requestBody?: never;
6300
6482
  responses: {
6301
6483
  200: components["responses"]["HTMLResponse"];
6484
+ /** @description Signed in; redirects to the Dashboard. */
6485
+ 302: {
6486
+ headers: {
6487
+ [name: string]: unknown;
6488
+ };
6489
+ content?: never;
6490
+ };
6302
6491
  default: components["responses"]["ProblemResponse"];
6303
6492
  };
6304
6493
  };
@@ -8013,6 +8202,14 @@ export interface operations {
8013
8202
  api?: "2";
8014
8203
  /** @description Backend-derived echo of the session's `diagnostics` field, carried through to the launched destination unchanged. See the same parameter on `VerificationPage`. */
8015
8204
  diag?: "1";
8205
+ /** @description Added to the session's `launchOptions` if it has none. */
8206
+ redirectUrl?: string;
8207
+ /** @description JSON `VerificationLaunchRedirectOptions`. Added to the session's `launchOptions` if it has none. */
8208
+ redirectUrlOptions?: string;
8209
+ /** @description Added to the session's `launchOptions` if it has none. */
8210
+ cancelRedirectUrl?: string;
8211
+ /** @description JSON `VerificationLaunchRedirectOptions`. Added to the session's `launchOptions` if it has none. */
8212
+ cancelRedirectUrlOptions?: string;
8016
8213
  };
8017
8214
  header?: never;
8018
8215
  path: {
@@ -8179,7 +8376,7 @@ export interface operations {
8179
8376
  "text/html": components["schemas"]["HtmlContent"];
8180
8377
  };
8181
8378
  };
8182
- /** @description The new or existing repair session. */
8379
+ /** @description The new repair session. */
8183
8380
  201: {
8184
8381
  headers: {
8185
8382
  [name: string]: unknown;
@@ -8191,28 +8388,6 @@ export interface operations {
8191
8388
  default: components["responses"]["ProblemResponse"];
8192
8389
  };
8193
8390
  };
8194
- ActivateFixWithAiRepair: {
8195
- parameters: {
8196
- query?: never;
8197
- header?: never;
8198
- path: {
8199
- sessionId: components["schemas"]["SessionID"];
8200
- };
8201
- cookie?: never;
8202
- };
8203
- requestBody?: never;
8204
- responses: {
8205
- /** @description The repair was queued or was already active. */
8206
- 204: {
8207
- headers: {
8208
- [name: string]: unknown;
8209
- };
8210
- content?: never;
8211
- };
8212
- 409: components["responses"]["ProblemResponse"];
8213
- default: components["responses"]["ProblemResponse"];
8214
- };
8215
- };
8216
8391
  JwksJson: {
8217
8392
  parameters: {
8218
8393
  query?: never;
@@ -8687,6 +8862,8 @@ export interface operations {
8687
8862
  track?: "agent" | "sdk" | "http";
8688
8863
  /** @description Integrate tab, agent track only. Which coding agent's install command to show. */
8689
8864
  agent?: "claude" | "copilot" | "cursor" | "omp" | "opencode" | "codex" | "antigravity" | "others";
8865
+ /** @description Integrate tab, agent track only. What users prove, as typed into the prompt's goal field; kept when another agent is picked. */
8866
+ goal?: string;
8690
8867
  /** @description Integrate tab: the providers to show in the examples in place of placeholder ids, for example when arriving from a provider page or a build page. Repeat to pass several. Dashboard tab: scopes the report to sessions that ran this provider (the first one); options come from `GET /orgs/{orgId}/providers/used`. */
8691
8868
  providerId?: components["schemas"]["ProviderID"][];
8692
8869
  /** @description Integrate tab, HTTP track only. Which Verification Client the create-session example targets. `auto` (the default) leaves `verificationClientUrl` out. */
@@ -8704,7 +8881,7 @@ export interface operations {
8704
8881
  /** @description Providers tab only. Renders the New provider dialog already open, so a link from another page can land on it. */
8705
8882
  newProvider?: boolean;
8706
8883
  /** @description Post-checkout status signal set by Stripe redirect (`success_url` / `cancel_url`), the card-save flow, and the credit top-up. Drives a one-shot notice and deep-links to the Billing tab; nothing else about the page depends on it. */
8707
- billing?: "success" | "cancelled" | "changed" | "credits";
8884
+ billing?: "success" | "cancelled" | "changed" | "credits" | "card";
8708
8885
  };
8709
8886
  header?: never;
8710
8887
  path: {
@@ -9164,6 +9341,7 @@ export interface operations {
9164
9341
  };
9165
9342
  400: components["responses"]["ProblemResponse"];
9166
9343
  403: components["responses"]["ForbiddenResponse"];
9344
+ 409: components["responses"]["ProblemResponse"];
9167
9345
  default: components["responses"]["ProblemResponse"];
9168
9346
  };
9169
9347
  };
@@ -9572,6 +9750,33 @@ export interface operations {
9572
9750
  default: components["responses"]["ProblemResponse"];
9573
9751
  };
9574
9752
  };
9753
+ CreateCardSetupSession: {
9754
+ parameters: {
9755
+ query?: never;
9756
+ header?: never;
9757
+ path: {
9758
+ orgId: components["schemas"]["OrgID"];
9759
+ };
9760
+ cookie?: never;
9761
+ };
9762
+ requestBody?: never;
9763
+ responses: {
9764
+ /** @description Checkout session created */
9765
+ 200: {
9766
+ headers: {
9767
+ [name: string]: unknown;
9768
+ };
9769
+ content: {
9770
+ "application/json": {
9771
+ /** Format: uri */
9772
+ url: string;
9773
+ };
9774
+ };
9775
+ };
9776
+ 403: components["responses"]["ForbiddenResponse"];
9777
+ default: components["responses"]["ProblemResponse"];
9778
+ };
9779
+ };
9575
9780
  CancelBillingSubscription: {
9576
9781
  parameters: {
9577
9782
  query?: never;
@@ -10768,10 +10973,16 @@ export interface operations {
10768
10973
  [name: string]: unknown;
10769
10974
  };
10770
10975
  content: {
10771
- "text/html": components["schemas"]["HtmlContent"];
10772
10976
  "application/json": components["schemas"]["VerificationAnalytics"];
10773
10977
  };
10774
10978
  };
10979
+ /** @description A browser; redirects to the org's Dashboard. */
10980
+ 302: {
10981
+ headers: {
10982
+ [name: string]: unknown;
10983
+ };
10984
+ content?: never;
10985
+ };
10775
10986
  403: components["responses"]["ForbiddenResponse"];
10776
10987
  default: components["responses"]["ProblemResponse"];
10777
10988
  };
@@ -10837,6 +11048,90 @@ export interface operations {
10837
11048
  default: components["responses"]["ProblemResponse"];
10838
11049
  };
10839
11050
  };
11051
+ CreateAiVerificationSession: {
11052
+ parameters: {
11053
+ query?: never;
11054
+ header?: never;
11055
+ path?: never;
11056
+ cookie?: never;
11057
+ };
11058
+ requestBody: {
11059
+ content: {
11060
+ "application/json": components["schemas"]["CreateAiVerificationSessionRequest"];
11061
+ };
11062
+ };
11063
+ responses: {
11064
+ /** @description Session created */
11065
+ 201: {
11066
+ headers: {
11067
+ [name: string]: unknown;
11068
+ };
11069
+ content: {
11070
+ "application/json": components["schemas"]["VerificationSession"];
11071
+ };
11072
+ };
11073
+ /** @description Overage is paused: the organization is past its plan allowance, and its prepaid credits and credit-exhaustion allowance are spent (`event: billing_required`). */
11074
+ 402: {
11075
+ headers: {
11076
+ [name: string]: unknown;
11077
+ };
11078
+ content: {
11079
+ "application/problem+json": components["schemas"]["Problem"];
11080
+ };
11081
+ };
11082
+ /** @description The organization has no callback subscription. */
11083
+ 409: {
11084
+ headers: {
11085
+ [name: string]: unknown;
11086
+ };
11087
+ content: {
11088
+ "application/problem+json": components["schemas"]["Problem"];
11089
+ };
11090
+ };
11091
+ /** @description The verification quota is exceeded (`event: billing_required` with a terminal `sessionId`). */
11092
+ 429: {
11093
+ headers: {
11094
+ [name: string]: unknown;
11095
+ };
11096
+ content: {
11097
+ "application/problem+json": components["schemas"]["Problem"];
11098
+ };
11099
+ };
11100
+ default: components["responses"]["ProblemResponse"];
11101
+ };
11102
+ };
11103
+ GetAiVerificationSession: {
11104
+ parameters: {
11105
+ query?: never;
11106
+ header?: never;
11107
+ path: {
11108
+ sessionId: components["schemas"]["SessionID"];
11109
+ };
11110
+ cookie?: never;
11111
+ };
11112
+ requestBody?: never;
11113
+ responses: {
11114
+ /** @description Ok */
11115
+ 200: {
11116
+ headers: {
11117
+ [name: string]: unknown;
11118
+ };
11119
+ content: {
11120
+ "application/json": components["schemas"]["AiVerificationSession"];
11121
+ };
11122
+ };
11123
+ /** @description No session with this ID, or the session wasn't created by `POST /verifications/ai-sessions`. */
11124
+ 404: {
11125
+ headers: {
11126
+ [name: string]: unknown;
11127
+ };
11128
+ content: {
11129
+ "application/problem+json": components["schemas"]["Problem"];
11130
+ };
11131
+ };
11132
+ default: components["responses"]["ProblemResponse"];
11133
+ };
11134
+ };
10840
11135
  GetVerificationSession: {
10841
11136
  parameters: {
10842
11137
  query?: never;
@@ -1,5 +1,5 @@
1
1
  // AUTO-GENERATED by packages/app/scripts/openapi-typegen.ts
2
- // from packages/app/openapi.yaml (spec v0.1.0, source sha256:3e28ff308da3).
2
+ // from packages/app/openapi.yaml (spec v0.1.0, source sha256:e2db795ab15c).
3
3
  // The hash catches drift the version misses (a spec can change without a
4
4
  // version bump) — do not remove it as "redundant" with the version.
5
5
  // Run `npm run openapi:gen --workspace=packages/app` to regenerate. Do not edit by hand.
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@reclaimprotocol/client",
3
3
  "title": "Reclaim Client",
4
- "version": "0.1.33",
4
+ "version": "0.1.34",
5
5
  "description": "Typed SDK/HTTP client SDK for the Reclaim Protocol — the programmatic way to use Reclaim Protocol to verify **data points** about your users (a follower count, an account balance, an order). Can be directly integrated by apps to request verification for their users using Reclaim Protocol and verify the results.",
6
6
  "type": "module",
7
7
  "sideEffects": false,
package/src/routes.gen.ts CHANGED
@@ -1,12 +1,11 @@
1
1
  // AUTO-GENERATED by packages/app/scripts/mcp-tools-gen.ts
2
- // from packages/app/openapi.yaml (spec v0.1.0, source sha256:3e28ff308da3).
2
+ // from packages/app/openapi.yaml (spec v0.1.0, source sha256:e2db795ab15c).
3
3
  // The hash catches drift the version misses (a spec can change without a
4
4
  // version bump) — do not remove it as "redundant" with the version.
5
5
  // Run `npm run openapi:gen --workspace=packages/app` to regenerate. Do not edit by hand.
6
6
 
7
7
  export const ROUTES = {
8
8
  "AcceptOrgInvite": {"method":"post","path":"/orgs/{orgId}/invite"},
9
- "ActivateFixWithAiRepair": {"method":"post","path":"/v/{sessionId}/fix-with-ai/activate"},
10
9
  "AddOrgMember": {"method":"post","path":"/orgs/{orgId}/members"},
11
10
  "AddProviderContributionComment": {"method":"post","path":"/providers/{providerId}/contributions/{campaignId}/comments"},
12
11
  "AddStaffMember": {"method":"post","path":"/admin/staff"},
@@ -38,9 +37,11 @@ export const ROUTES = {
38
37
  "ChangeOrgPlan": {"method":"post","path":"/orgs/{orgId}/billing/change-plan"},
39
38
  "ConsentPage": {"method":"get","path":"/oauth/consent"},
40
39
  "CreateAgentBrowserSession": {"method":"post","path":"/orgs/{orgId}/agent-browser-sessions"},
40
+ "CreateAiVerificationSession": {"method":"post","path":"/verifications/ai-sessions"},
41
41
  "CreateBillingCheckoutSession": {"method":"post","path":"/orgs/{orgId}/billing/checkout"},
42
42
  "CreateBillingPortalSession": {"method":"post","path":"/orgs/{orgId}/billing/portal"},
43
43
  "CreateCallbackSubscription": {"method":"post","path":"/verifications/callback-subscriptions"},
44
+ "CreateCardSetupSession": {"method":"post","path":"/orgs/{orgId}/billing/card"},
44
45
  "CreateCreditCheckoutSession": {"method":"post","path":"/orgs/{orgId}/billing/credits/checkout"},
45
46
  "CreateFeatureFlag": {"method":"post","path":"/admin/feature-flags"},
46
47
  "CreateFetchAuthorization": {"method":"post","path":"/fetch/authorizations"},
@@ -76,6 +77,7 @@ export const ROUTES = {
76
77
  "Docs": {"method":"get","path":"/docs"},
77
78
  "ExplorePreviewImage": {"method":"get","path":"/og/explore.png"},
78
79
  "FixWithAiRecovery": {"method":"get","path":"/v/{sessionId}/fix-with-ai"},
80
+ "GetAiVerificationSession": {"method":"get","path":"/verifications/ai-sessions/{sessionId}"},
79
81
  "GetImage": {"method":"get","path":"/images/{imageId}"},
80
82
  "GetMe": {"method":"get","path":"/me"},
81
83
  "GetOrg": {"method":"get","path":"/orgs/{orgId}"},
@@ -1,5 +1,5 @@
1
1
  // AUTO-GENERATED by packages/app/scripts/openapi-typegen.ts
2
- // from packages/app/openapi.yaml (spec v0.1.0, source sha256:3e28ff308da3).
2
+ // from packages/app/openapi.yaml (spec v0.1.0, source sha256:e2db795ab15c).
3
3
  // The hash catches drift the version misses (a spec can change without a
4
4
  // version bump) — do not remove it as "redundant" with the version.
5
5
  // Run `npm run openapi:gen --workspace=packages/app` to regenerate. Do not edit by hand.
@@ -17,8 +17,8 @@ export interface paths {
17
17
  cookie?: never;
18
18
  };
19
19
  /**
20
- * Home — sign-in or Discover
21
- * @description Signed in, renders Discover (see `GET /discover`). Signed out, renders the sign-in page; a signed-out link carrying Discover's `q` / `tag` redirects to `/discover` with them.
20
+ * Home — sign-in or the Dashboard
21
+ * @description Signed in, redirects to the Dashboard (`GET /orgs/{orgId}`) of the console's selected org, else the viewer's default org. Signed out, renders the sign-in page; a signed-out link carrying Discover's `q` / `tag` redirects to `/discover` with them.
22
22
  */
23
23
  get: operations["Index"];
24
24
  put?: never;
@@ -1116,6 +1116,8 @@ export interface paths {
1116
1116
  * - `zkfetch` — a static informational page. zkFetch has no claimant
1117
1117
  * step; nothing ever redirects a browser here by design.
1118
1118
  *
1119
+ * A session from `POST /verifications/ai-sessions` never redirects for now. While its lookup runs, the page shows a loading state and reloads itself. Then it shows the candidate pages, and asks the user to pick one when there are several (nothing happens after the pick yet). When the lookup failed, the page shows an error and closes itself after 5 seconds. A session that is no longer pending shows that it ended.
1120
+ * `redirectUrl`, `redirectUrlOptions`, `cancelRedirectUrl`, and `cancelRedirectUrlOptions` in the query are added to the session's `launchOptions`, where every Verification Client can read them, unless the session already has that option: options set at creation, or by an earlier visit, win. They're validated as at creation (`https:` only); an invalid one is a 400. The `portals` redirect carries the session's launch options, and any other query parameters, on to the portal.
1119
1121
  * Sets `Referrer-Policy: no-referrer`, so a `sessionId` never rides along in a `Referer` header to wherever a client eventually redirects.
1120
1122
  */
1121
1123
  get: operations["SharePage"];
@@ -1241,8 +1243,8 @@ export interface paths {
1241
1243
  get: operations["FixWithAiRecovery"];
1242
1244
  put?: never;
1243
1245
  /**
1244
- * Create or reopen a billed AI repair session
1245
- * @description Creates one idempotent repair attempt for the selected failed provider. The source organization is charged only when a new child is created. Repeated requests reopen a pending or successful child. After a child ends in error, rejection, or expiry, a later request creates a new, separately billed attempt. The server derives the exact failed version and repair prompt.
1246
+ * Create a billed AI repair session
1247
+ * @description Creates a verification session that pins the selected failed provider's exact version with `preferAiAgent`, charged to the source organization. Its verification page runs the AI authoring agent instead of the stored recipe. A proven recipe is published for the provider's own organization, or submitted for admin review otherwise. Every request creates a new, separately billed session.
1246
1248
  */
1247
1249
  post: operations["CreateFixWithAiSession"];
1248
1250
  delete?: never;
@@ -1251,26 +1253,6 @@ export interface paths {
1251
1253
  patch?: never;
1252
1254
  trace?: never;
1253
1255
  };
1254
- "/v/{sessionId}/fix-with-ai/activate": {
1255
- parameters: {
1256
- query?: never;
1257
- header?: never;
1258
- path?: never;
1259
- cookie?: never;
1260
- };
1261
- get?: never;
1262
- put?: never;
1263
- /**
1264
- * Start a pending AI repair after the verification page loads
1265
- * @description Idempotently queues a pending repair session. The server derives the claimant country from the request and publishes no browser credentials.
1266
- */
1267
- post: operations["ActivateFixWithAiRepair"];
1268
- delete?: never;
1269
- options?: never;
1270
- head?: never;
1271
- patch?: never;
1272
- trace?: never;
1273
- };
1274
1256
  "/.well-known/jwks.json": {
1275
1257
  parameters: {
1276
1258
  query?: never;
@@ -1782,7 +1764,7 @@ export interface paths {
1782
1764
  get: operations["GetOrgKeypair"];
1783
1765
  /**
1784
1766
  * Set (or rotate) the organization's encryption keypair
1785
- * @description Upserts the organization's single Ethereum (secp256k1) encryption keypair. The body carries the org's **eth public key** — as an uncompressed hex string (`0x04`+128 hex) or a secp256k1 public JWK (`{kty:'EC', crv:'secp256k1', x, y}`) — and `canEncryptResult`. The matching private key never leaves the consumer. Setting overwrites the single row (and creates it for a keyless org). When `canEncryptResult` is true, terminal results are delivered as an ECIES ciphertext encrypted to this key; otherwise plaintext. Authenticated by the org's `OrgToken` or a human `BearerAuth` session for an active member of the org.
1767
+ * @description Sets the organization's single Ethereum (secp256k1) encryption keypair. The body carries the org's **eth public key** — as an uncompressed hex string (`0x04`+128 hex) or a secp256k1 public JWK (`{kty:'EC', crv:'secp256k1', x, y}`) — and `canEncryptResult`. The matching private key never leaves the consumer. The call creates the key for a keyless org and is idempotent for the same key. If the org has a different key, it returns `409` unless `replace` is true. When `canEncryptResult` is true, terminal results are delivered as an ECIES ciphertext encrypted to this key; otherwise plaintext. Authenticated by the org's `OrgToken` or a human `BearerAuth` session for an active member of the org.
1786
1768
  */
1787
1769
  put: operations["SetOrgKeypair"];
1788
1770
  post?: never;
@@ -2044,6 +2026,26 @@ export interface paths {
2044
2026
  patch?: never;
2045
2027
  trace?: never;
2046
2028
  };
2029
+ "/orgs/{orgId}/billing/card": {
2030
+ parameters: {
2031
+ query?: never;
2032
+ header?: never;
2033
+ path?: never;
2034
+ cookie?: never;
2035
+ };
2036
+ get?: never;
2037
+ put?: never;
2038
+ /**
2039
+ * Save a card for the organization
2040
+ * @description Owner only. Returns a Stripe Checkout URL that only saves a card (no charge), creating the organization's Stripe customer on first use. The saved card becomes the default that plans and overage bill. Stripe returns the owner to the Billing tab with `?billing=card`.
2041
+ */
2042
+ post: operations["CreateCardSetupSession"];
2043
+ delete?: never;
2044
+ options?: never;
2045
+ head?: never;
2046
+ patch?: never;
2047
+ trace?: never;
2048
+ };
2047
2049
  "/orgs/{orgId}/billing/subscription": {
2048
2050
  parameters: {
2049
2051
  query?: never;
@@ -2340,7 +2342,7 @@ export interface paths {
2340
2342
  };
2341
2343
  /**
2342
2344
  * Get a specific provider version
2343
- * @description Fetches one exact canonical version. Trunk is public when the provider is public. Non-trunk versions are visible to admins and members of the provider's organization. A member of the organization that paid for a successful AI repair may also read only the exact `fixed` version created by that repair.
2345
+ * @description Fetches one exact canonical version. Trunk is public when the provider is public. Non-trunk versions are visible to admins and members of the provider's organization.
2344
2346
  */
2345
2347
  get: operations["GetProviderVersion"];
2346
2348
  put?: never;
@@ -2685,7 +2687,7 @@ export interface paths {
2685
2687
  };
2686
2688
  /**
2687
2689
  * Verification outcomes by day, device, and country
2688
- * @description Organization-scoped creation cohorts in UTC. Outcomes are current at query time. Unknown device and country values have their own buckets.
2690
+ * @description Organization-scoped creation cohorts in UTC. Outcomes are current at query time. Unknown device and country values have their own buckets. A signed-in browser asking for HTML is redirected to the org's Dashboard (`GET /orgs/{orgId}`), which shows these analytics, with the same query.
2689
2691
  */
2690
2692
  get: operations["GetOrgVerificationAnalytics"];
2691
2693
  put?: never;
@@ -2748,6 +2750,118 @@ export interface paths {
2748
2750
  patch?: never;
2749
2751
  trace?: never;
2750
2752
  };
2753
+ "/verifications/ai-sessions": {
2754
+ parameters: {
2755
+ query?: never;
2756
+ header?: never;
2757
+ path?: never;
2758
+ cookie?: never;
2759
+ };
2760
+ get?: never;
2761
+ put?: never;
2762
+ /**
2763
+ * Start an AI verification session from a prompt
2764
+ * @description Starts a verification from a plain-language prompt, such as "verify
2765
+ * I'm a student at Manipal University", instead of a list of providers.
2766
+ * Builder creates the session at once and returns it, as
2767
+ * `POST /verifications/sessions` does. Send the user to its
2768
+ * `verificationUrl`. In the background, Builder looks up the
2769
+ * `candidates` (pages the user opens and signs in to) and the
2770
+ * `dataPoints` to verify there, usually within a few seconds. Poll
2771
+ * `GET /verifications/ai-sessions/{sessionId}` until its `status` is
2772
+ * `ready` or `failed`. The share page at `verificationUrl` shows a
2773
+ * loading state meanwhile.
2774
+ *
2775
+ * Builder searches the provider catalog (public providers and your
2776
+ * organization's own providers) and the web. The web search finds a
2777
+ * portal the catalog lacks, or one that replaced a stale catalog page.
2778
+ * Builder caches a web result for a week, or for a day when it finds
2779
+ * nothing. A URL or domain in the prompt is a hint: pages on it rank
2780
+ * first.
2781
+ *
2782
+ * Deterministic checks run before any AI model. Builder rejects a
2783
+ * prompt that contains a password, card number, or Aadhaar number, that
2784
+ * contains instructions for the AI, or that makes a sensitive claim,
2785
+ * without calling a model. Builder withholds personal values the prompt
2786
+ * states, such as a name, email address, phone number, or student ID,
2787
+ * from the model and from the cache.
2788
+ *
2789
+ * Once the lookup is ready, the session's `context` holds the values
2790
+ * the prompt states, such as the user's name, merged with the `context`
2791
+ * you send. Your values take precedence.
2792
+ *
2793
+ * On `201`, the session has no providers: the AI agent works out how to
2794
+ * verify. The organization needs a callback subscription. The session
2795
+ * uses one verification from the quota pool of the
2796
+ * `verificationClientUrl` client. A prompt the checks above reject
2797
+ * creates no session and is free. If the lookup then fails (the prompt
2798
+ * isn't a request to verify something about the user, no login page
2799
+ * is found, or the model or web search stays unavailable), Builder
2800
+ * refunds the verification, ends the session with status `error`, and
2801
+ * sends the failure to your `verification_error` callbacks. Builder
2802
+ * caches lookups, so a repeated prompt resolves faster, even when it
2803
+ * names a different person.
2804
+ *
2805
+ * curl -X POST $BASE/verifications/ai-sessions \
2806
+ * -H "Authorization: Bearer $ORG_TOKEN" \
2807
+ * -H 'Content-Type: application/json' \
2808
+ * -d '{"prompt":"verify I am a student at Manipal University"}'
2809
+ *
2810
+ * Errors:
2811
+ *
2812
+ * - `400`: Builder rejects the prompt (for example, it targets an
2813
+ * internal host), `context` contains `attestationNonce` or
2814
+ * `attestationNonceData`, or `verificationClientUrl` isn't a
2815
+ * registered client.
2816
+ * - `409`: The organization has no callback subscription.
2817
+ * - `429` or `402`: The quota or credits are spent. The body has
2818
+ * `event: billing_required` and a terminal `sessionId`.
2819
+ *
2820
+ * A failed lookup isn't an error of this request: it shows in the
2821
+ * `error` of `GET /verifications/ai-sessions/{sessionId}`.
2822
+ */
2823
+ post: operations["CreateAiVerificationSession"];
2824
+ delete?: never;
2825
+ options?: never;
2826
+ head?: never;
2827
+ patch?: never;
2828
+ trace?: never;
2829
+ };
2830
+ "/verifications/ai-sessions/{sessionId}": {
2831
+ parameters: {
2832
+ query?: never;
2833
+ header?: never;
2834
+ path?: never;
2835
+ cookie?: never;
2836
+ };
2837
+ /**
2838
+ * Get what an AI verification session's prompt resolved to
2839
+ * @description Returns the lookup that `POST /verifications/ai-sessions` started for
2840
+ * the session. `status` is `resolving` until it finishes, then `ready`
2841
+ * with the pages and data points it found, or `failed` with an
2842
+ * `error`. Poll every second or two while it's `resolving`.
2843
+ *
2844
+ * `candidates` lists the pages to open, best first, each with a
2845
+ * `source` of `catalog` or `web`. It usually has one page. It has
2846
+ * several (up to 3) only when their `confidence` values are within 0.1
2847
+ * of the best page's value. In that case, the user picks one on the
2848
+ * session's `verificationUrl`.
2849
+ *
2850
+ * The `OrgToken` must resolve to the session's organization. To track
2851
+ * the session's status, call `GET /verifications/sessions/{sessionId}`.
2852
+ *
2853
+ * curl $BASE/verifications/ai-sessions/$SESSION_ID \
2854
+ * -H "Authorization: Bearer $ORG_TOKEN"
2855
+ */
2856
+ get: operations["GetAiVerificationSession"];
2857
+ put?: never;
2858
+ post?: never;
2859
+ delete?: never;
2860
+ options?: never;
2861
+ head?: never;
2862
+ patch?: never;
2863
+ trace?: never;
2864
+ };
2751
2865
  "/verifications/sessions/{sessionId}": {
2752
2866
  parameters: {
2753
2867
  query?: never;
@@ -3246,6 +3360,64 @@ export interface components {
3246
3360
  ProviderID: string;
3247
3361
  /** Format: uuid */
3248
3362
  OrgID: string;
3363
+ /** @description Body for `POST /verifications/ai-sessions`. */
3364
+ CreateAiVerificationSessionRequest: {
3365
+ /** @description What to verify, in plain language, such as "verify I'm a student at Manipal University". Builder rejects a prompt that contains credentials, card numbers, instructions for the AI, or a sensitive claim. */
3366
+ prompt: string;
3367
+ /** @description Values you already know, such as `{"fullName": "Asha Rao"}`. Builder merges them over the values the prompt states and returns the result in `context`. Must not contain `attestationNonce` or `attestationNonceData`; bind those after you create the session. Omit if you have none. */
3368
+ context?: {
3369
+ [key: string]: unknown;
3370
+ };
3371
+ /** @description Base URL of the registered verification client the user verifies with, as for `POST /verifications/sessions`. Builder charges this client's quota pool. If you omit it, Builder uses the default (`portals`) client. */
3372
+ verificationClientUrl?: string;
3373
+ /** @description ISO 3166-1 alpha-2 country code, such as `IN`. Builder searches the web from this country (Google's `gl` parameter), so portals for that country rank first. If you omit it, the search has no country preference. */
3374
+ geoLocation?: string;
3375
+ };
3376
+ /** @description The lookup `POST /verifications/ai-sessions` started for a session: its status, and once `ready`, the pages to open and the data points to verify there. */
3377
+ AiVerificationSession: {
3378
+ /**
3379
+ * Format: uuid
3380
+ * @description ID of the verification session. To track the session, call `GET /verifications/sessions/{sessionId}`.
3381
+ */
3382
+ sessionId: string;
3383
+ /**
3384
+ * @description `resolving` while Builder looks up the pages and data points. `ready` when `candidates` and `dataPoints` are set. `failed` when the lookup failed: `error` says why, the session ended with status `error`, and its verification was refunded.
3385
+ * @enum {string}
3386
+ */
3387
+ status: "resolving" | "ready" | "failed";
3388
+ /** @description Why the lookup failed. Only when `status` is `failed`. Its `status` is 422 when the prompt isn't a request to verify something about the user, 404 when no login page was found, and 503 when the AI model or web search stayed unavailable. */
3389
+ error?: components["schemas"]["Problem"];
3390
+ /** @description Only when `status` is `ready`. The fewest data points that prove the prompt's claim, required data points first. A data point for a value the prompt states is always required. */
3391
+ dataPoints?: {
3392
+ /** @description Short camelCase name, such as `username`. */
3393
+ name: string;
3394
+ /** @description What the value is and why it proves the claim. */
3395
+ description: string;
3396
+ /** @description If `true`, the claim can be proven without this value, as with `isOptional` on a provider's `ResponseMatch`. If absent, the data point is required. */
3397
+ isOptional?: boolean;
3398
+ }[];
3399
+ /** @description Values the signed-in account must show, such as `{"fullName": "Asha Rao"}`. Each key is the `dataPoints` name that the value pins. It combines the values the prompt states with the request's `context`. It's empty if neither has any. It's the session's `context`. If the prompt names a specific page, such as a post, `pageUrl` holds it: the page to open after the user logs in on the candidate's site. */
3400
+ context: {
3401
+ [key: string]: unknown;
3402
+ };
3403
+ /** @description Only when `status` is `ready`. Pages to open, best first. Each is the page that shows the data after the user signs in (it sends the user to sign in first), or else the sign-in page. Usually one page. Several pages appear only when the choice is ambiguous, such as a college with two or three student portals whose `confidence` values are within 0.1 of the best. In that case, the user picks one on the session's `verificationUrl`. At most one page per host. */
3404
+ candidates?: components["schemas"]["ResolvedLoginPage"][];
3405
+ };
3406
+ /** @description A page for the user to open and sign in to. */
3407
+ ResolvedLoginPage: {
3408
+ /**
3409
+ * Format: uri
3410
+ * @description URL of the page to open. For a `web` page, Builder removes the query and fragment.
3411
+ */
3412
+ loginUrl: string;
3413
+ /** @description Estimated likelihood, from 0 to 1, that signing in here shows the claim. Candidates below 0.5 are never returned. */
3414
+ confidence: number;
3415
+ /**
3416
+ * @description Where the page came from. `catalog` is the page of a provider in the catalog (public, or your organization's own). `web` is a page that a web search found; it has no provider yet.
3417
+ * @enum {string}
3418
+ */
3419
+ source: "catalog" | "web";
3420
+ };
3249
3421
  /** @description A verification client id used as a filter. Hyphens are ignored. */
3250
3422
  VerificationClientIDFilter: string;
3251
3423
  /** @description An organization id used as a filter. Hyphens are ignored, so it matches with or without them; an id that matches no organization returns nothing. */
@@ -3750,6 +3922,11 @@ export interface components {
3750
3922
  /** @default false */
3751
3923
  canEncryptResult: boolean;
3752
3924
  label?: string;
3925
+ /**
3926
+ * @description Set to true to replace an existing, different public key. Without it, the call returns 409 when the organization already has another key. Results encrypted to the old key can no longer be decrypted.
3927
+ * @default false
3928
+ */
3929
+ replace: boolean;
3753
3930
  };
3754
3931
  /** @description Body for `PUT /orgs/{orgId}/keypair`. Carries the org's eth public key as a secp256k1 public JWK. */
3755
3932
  OrgKeypairJwkRequest: {
@@ -3757,6 +3934,11 @@ export interface components {
3757
3934
  /** @default false */
3758
3935
  canEncryptResult: boolean;
3759
3936
  label?: string;
3937
+ /**
3938
+ * @description Set to true to replace an existing, different public key. Without it, the call returns 409 when the organization already has another key. Results encrypted to the old key can no longer be decrypted.
3939
+ * @default false
3940
+ */
3941
+ replace: boolean;
3760
3942
  };
3761
3943
  /** @description Response of `POST /orgs/{orgId}/token`. The plaintext `orgSecret` is shown **only once** here; the server stores only its HMAC. Use it as `Authorization: Bearer <orgSecret>` (the `OrgToken` scheme). An org may hold several keys; issuing a new one does not affect the others. */
3762
3944
  OrgToken: {
@@ -5716,7 +5898,7 @@ export interface components {
5716
5898
  resolvedVersion: string;
5717
5899
  /** Format: uri */
5718
5900
  initialUrl: string;
5719
- /** @description Legacy-only preference. Builder clients always run the structured recipe and never enable AI or manual verification from this value. */
5901
+ /** @description Effective AI-agent preference: the session's choice, else whether the version is an `llm` provider. When true, the Builder verification page runs the AI authoring agent instead of the structured recipe. */
5720
5902
  preferAiAgent: boolean;
5721
5903
  geoLocation?: string;
5722
5904
  jsUserScripts?: string;
@@ -5766,7 +5948,7 @@ export interface components {
5766
5948
  preferredLocale?: string;
5767
5949
  /** @description When the organization-bound legacy TEE nonce context was first stored. The nonce data itself is present in `context` as `attestationNonce` and `attestationNonceData`. */
5768
5950
  teeNonceBoundAt?: components["schemas"]["Timestamp"];
5769
- /** @description Legacy-only preference echoed for compatibility. Builder-mode clients run the structured recipe and do not enable AI or manual verification. */
5951
+ /** @description The creator's AI-agent preference. When true, the Builder verification page runs the AI authoring agent instead of the structured recipe. */
5770
5952
  preferAiAgent?: boolean;
5771
5953
  /** @description Whether this session was created with diagnostic mode enabled (see CreateVerificationSessionRequest.diagnostics). Set once at creation and never changes afterward. Gates whether Builder records claimant IP addresses and how much detail diagnostic events carry; the `diag` parameter on `verificationUrl` mirrors this value and is not itself authoritative. */
5772
5954
  diagnostics: boolean;
@@ -5834,7 +6016,7 @@ export interface components {
5834
6016
  themeId?: components["schemas"]["ThemeID"];
5835
6017
  /** @description Optional locale override for this verification session. It takes precedence over the organization theme's preferred locale. */
5836
6018
  preferredLocale?: string;
5837
- /** @description Legacy-only preference. Builder mode runs the structured recipe and does not enable AI or manual verification. Omit this field for Builder-mode sessions; dual-mode clients may continue to interpret it only on their legacy path. */
6019
+ /** @description When true, the Builder verification page runs the AI authoring agent instead of the providers' structured recipes. A proven recipe is published only for the provider's own organization; for any other provider it is submitted for admin review. Omit it to run the stored recipes. */
5838
6020
  preferAiAgent?: boolean;
5839
6021
  /** @description Optional; omit or send false for a normal session. Opts this session into diagnostic mode. A diagnostic session records more event detail, including personal data such as the claimant's IP addresses (see ClaimantDetails.network). Builder appends `diag=1` to the returned `verificationUrl` for a diagnostic session and strips any `diag` value the Consumer's own `verificationClientUrl` carries, so this field — not the URL — is the only way to turn diagnostics on. Treat a diagnostic verification URL as sensitive, and don't hand it to a claimant by default. */
5840
6022
  diagnostics?: boolean;
@@ -6305,6 +6487,13 @@ export interface operations {
6305
6487
  requestBody?: never;
6306
6488
  responses: {
6307
6489
  200: components["responses"]["HTMLResponse"];
6490
+ /** @description Signed in; redirects to the Dashboard. */
6491
+ 302: {
6492
+ headers: {
6493
+ [name: string]: unknown;
6494
+ };
6495
+ content?: never;
6496
+ };
6308
6497
  default: components["responses"]["ProblemResponse"];
6309
6498
  };
6310
6499
  };
@@ -8019,6 +8208,14 @@ export interface operations {
8019
8208
  api?: "2";
8020
8209
  /** @description Backend-derived echo of the session's `diagnostics` field, carried through to the launched destination unchanged. See the same parameter on `VerificationPage`. */
8021
8210
  diag?: "1";
8211
+ /** @description Added to the session's `launchOptions` if it has none. */
8212
+ redirectUrl?: string;
8213
+ /** @description JSON `VerificationLaunchRedirectOptions`. Added to the session's `launchOptions` if it has none. */
8214
+ redirectUrlOptions?: string;
8215
+ /** @description Added to the session's `launchOptions` if it has none. */
8216
+ cancelRedirectUrl?: string;
8217
+ /** @description JSON `VerificationLaunchRedirectOptions`. Added to the session's `launchOptions` if it has none. */
8218
+ cancelRedirectUrlOptions?: string;
8022
8219
  };
8023
8220
  header?: never;
8024
8221
  path: {
@@ -8185,7 +8382,7 @@ export interface operations {
8185
8382
  "text/html": components["schemas"]["HtmlContent"];
8186
8383
  };
8187
8384
  };
8188
- /** @description The new or existing repair session. */
8385
+ /** @description The new repair session. */
8189
8386
  201: {
8190
8387
  headers: {
8191
8388
  [name: string]: unknown;
@@ -8197,28 +8394,6 @@ export interface operations {
8197
8394
  default: components["responses"]["ProblemResponse"];
8198
8395
  };
8199
8396
  };
8200
- ActivateFixWithAiRepair: {
8201
- parameters: {
8202
- query?: never;
8203
- header?: never;
8204
- path: {
8205
- sessionId: components["schemas"]["SessionID"];
8206
- };
8207
- cookie?: never;
8208
- };
8209
- requestBody?: never;
8210
- responses: {
8211
- /** @description The repair was queued or was already active. */
8212
- 204: {
8213
- headers: {
8214
- [name: string]: unknown;
8215
- };
8216
- content?: never;
8217
- };
8218
- 409: components["responses"]["ProblemResponse"];
8219
- default: components["responses"]["ProblemResponse"];
8220
- };
8221
- };
8222
8397
  JwksJson: {
8223
8398
  parameters: {
8224
8399
  query?: never;
@@ -8693,6 +8868,8 @@ export interface operations {
8693
8868
  track?: "agent" | "sdk" | "http";
8694
8869
  /** @description Integrate tab, agent track only. Which coding agent's install command to show. */
8695
8870
  agent?: "claude" | "copilot" | "cursor" | "omp" | "opencode" | "codex" | "antigravity" | "others";
8871
+ /** @description Integrate tab, agent track only. What users prove, as typed into the prompt's goal field; kept when another agent is picked. */
8872
+ goal?: string;
8696
8873
  /** @description Integrate tab: the providers to show in the examples in place of placeholder ids, for example when arriving from a provider page or a build page. Repeat to pass several. Dashboard tab: scopes the report to sessions that ran this provider (the first one); options come from `GET /orgs/{orgId}/providers/used`. */
8697
8874
  providerId?: components["schemas"]["ProviderID"][];
8698
8875
  /** @description Integrate tab, HTTP track only. Which Verification Client the create-session example targets. `auto` (the default) leaves `verificationClientUrl` out. */
@@ -8710,7 +8887,7 @@ export interface operations {
8710
8887
  /** @description Providers tab only. Renders the New provider dialog already open, so a link from another page can land on it. */
8711
8888
  newProvider?: boolean;
8712
8889
  /** @description Post-checkout status signal set by Stripe redirect (`success_url` / `cancel_url`), the card-save flow, and the credit top-up. Drives a one-shot notice and deep-links to the Billing tab; nothing else about the page depends on it. */
8713
- billing?: "success" | "cancelled" | "changed" | "credits";
8890
+ billing?: "success" | "cancelled" | "changed" | "credits" | "card";
8714
8891
  };
8715
8892
  header?: never;
8716
8893
  path: {
@@ -9170,6 +9347,7 @@ export interface operations {
9170
9347
  };
9171
9348
  400: components["responses"]["ProblemResponse"];
9172
9349
  403: components["responses"]["ForbiddenResponse"];
9350
+ 409: components["responses"]["ProblemResponse"];
9173
9351
  default: components["responses"]["ProblemResponse"];
9174
9352
  };
9175
9353
  };
@@ -9578,6 +9756,33 @@ export interface operations {
9578
9756
  default: components["responses"]["ProblemResponse"];
9579
9757
  };
9580
9758
  };
9759
+ CreateCardSetupSession: {
9760
+ parameters: {
9761
+ query?: never;
9762
+ header?: never;
9763
+ path: {
9764
+ orgId: components["schemas"]["OrgID"];
9765
+ };
9766
+ cookie?: never;
9767
+ };
9768
+ requestBody?: never;
9769
+ responses: {
9770
+ /** @description Checkout session created */
9771
+ 200: {
9772
+ headers: {
9773
+ [name: string]: unknown;
9774
+ };
9775
+ content: {
9776
+ "application/json": {
9777
+ /** Format: uri */
9778
+ url: string;
9779
+ };
9780
+ };
9781
+ };
9782
+ 403: components["responses"]["ForbiddenResponse"];
9783
+ default: components["responses"]["ProblemResponse"];
9784
+ };
9785
+ };
9581
9786
  CancelBillingSubscription: {
9582
9787
  parameters: {
9583
9788
  query?: never;
@@ -10774,10 +10979,16 @@ export interface operations {
10774
10979
  [name: string]: unknown;
10775
10980
  };
10776
10981
  content: {
10777
- "text/html": components["schemas"]["HtmlContent"];
10778
10982
  "application/json": components["schemas"]["VerificationAnalytics"];
10779
10983
  };
10780
10984
  };
10985
+ /** @description A browser; redirects to the org's Dashboard. */
10986
+ 302: {
10987
+ headers: {
10988
+ [name: string]: unknown;
10989
+ };
10990
+ content?: never;
10991
+ };
10781
10992
  403: components["responses"]["ForbiddenResponse"];
10782
10993
  default: components["responses"]["ProblemResponse"];
10783
10994
  };
@@ -10843,6 +11054,90 @@ export interface operations {
10843
11054
  default: components["responses"]["ProblemResponse"];
10844
11055
  };
10845
11056
  };
11057
+ CreateAiVerificationSession: {
11058
+ parameters: {
11059
+ query?: never;
11060
+ header?: never;
11061
+ path?: never;
11062
+ cookie?: never;
11063
+ };
11064
+ requestBody: {
11065
+ content: {
11066
+ "application/json": components["schemas"]["CreateAiVerificationSessionRequest"];
11067
+ };
11068
+ };
11069
+ responses: {
11070
+ /** @description Session created */
11071
+ 201: {
11072
+ headers: {
11073
+ [name: string]: unknown;
11074
+ };
11075
+ content: {
11076
+ "application/json": components["schemas"]["VerificationSession"];
11077
+ };
11078
+ };
11079
+ /** @description Overage is paused: the organization is past its plan allowance, and its prepaid credits and credit-exhaustion allowance are spent (`event: billing_required`). */
11080
+ 402: {
11081
+ headers: {
11082
+ [name: string]: unknown;
11083
+ };
11084
+ content: {
11085
+ "application/problem+json": components["schemas"]["Problem"];
11086
+ };
11087
+ };
11088
+ /** @description The organization has no callback subscription. */
11089
+ 409: {
11090
+ headers: {
11091
+ [name: string]: unknown;
11092
+ };
11093
+ content: {
11094
+ "application/problem+json": components["schemas"]["Problem"];
11095
+ };
11096
+ };
11097
+ /** @description The verification quota is exceeded (`event: billing_required` with a terminal `sessionId`). */
11098
+ 429: {
11099
+ headers: {
11100
+ [name: string]: unknown;
11101
+ };
11102
+ content: {
11103
+ "application/problem+json": components["schemas"]["Problem"];
11104
+ };
11105
+ };
11106
+ default: components["responses"]["ProblemResponse"];
11107
+ };
11108
+ };
11109
+ GetAiVerificationSession: {
11110
+ parameters: {
11111
+ query?: never;
11112
+ header?: never;
11113
+ path: {
11114
+ sessionId: components["schemas"]["SessionID"];
11115
+ };
11116
+ cookie?: never;
11117
+ };
11118
+ requestBody?: never;
11119
+ responses: {
11120
+ /** @description Ok */
11121
+ 200: {
11122
+ headers: {
11123
+ [name: string]: unknown;
11124
+ };
11125
+ content: {
11126
+ "application/json": components["schemas"]["AiVerificationSession"];
11127
+ };
11128
+ };
11129
+ /** @description No session with this ID, or the session wasn't created by `POST /verifications/ai-sessions`. */
11130
+ 404: {
11131
+ headers: {
11132
+ [name: string]: unknown;
11133
+ };
11134
+ content: {
11135
+ "application/problem+json": components["schemas"]["Problem"];
11136
+ };
11137
+ };
11138
+ default: components["responses"]["ProblemResponse"];
11139
+ };
11140
+ };
10846
11141
  GetVerificationSession: {
10847
11142
  parameters: {
10848
11143
  query?: never;