@gitbook/api 0.201.0 → 0.202.0

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.
package/dist/client.d.ts CHANGED
@@ -755,6 +755,16 @@ export declare enum OrganizationFeature {
755
755
  SecuritySaml = "security-saml",
756
756
  ChangeRequestsMergeRules = "change-requests-merge-rules"
757
757
  }
758
+ /**
759
+ * UTC calendar interval for AI usage, with weeks starting on Monday.
760
+ * @default "day"
761
+ */
762
+ export declare enum AIUsageInterval {
763
+ Day = "day",
764
+ Week = "week",
765
+ Month = "month",
766
+ Year = "year"
767
+ }
758
768
  export declare enum BillingSwitchAction {
759
769
  Trial = "trial",
760
770
  Upgrade = "upgrade",
@@ -2591,6 +2601,8 @@ export interface DocumentBlockTabsItem {
2591
2601
  title?: string;
2592
2602
  /** Name of the icon */
2593
2603
  icon?: Icon;
2604
+ /** Stable identifier for this tab's selection, shared with every tab and button targeting the same slug. It is slugified before matching, so casing and spacing need not be exact. Omit it — or send an empty value, which counts as omitted — to derive one from the title, which is what makes same-named tabs across a site select together. A value that slugifies to nothing, such as emoji alone, also falls back to the title. */
2605
+ slug?: string;
2594
2606
  };
2595
2607
  meta?: {
2596
2608
  /** Unique ID to be used in an URL for the block. */
@@ -3010,6 +3022,8 @@ export interface RevisionPageLayoutOptions {
3010
3022
  tags: boolean;
3011
3023
  /** Should the page actions be visible on the page? */
3012
3024
  actions: boolean;
3025
+ /** Should the anchor links on headings and other linkable blocks be visible? */
3026
+ anchors: boolean;
3013
3027
  }
3014
3028
  export interface RevisionPageDocumentCover {
3015
3029
  /** Content reference pointing to the source image. */
@@ -3288,7 +3302,7 @@ export interface ChangeRequest {
3288
3302
  /** ID of the site finding associated with the change request, when applicable. */
3289
3303
  finding?: string;
3290
3304
  };
3291
- /** Style guide check run that opened the change request, when it came from one. */
3305
+ /** Style guide check that opened the change request, when it came from one. A check can be run again on the change request already open on a space, rather than opening a second one, so several checks can share a change request. */
3292
3306
  styleguide?: {
3293
3307
  /** ID of the site the style guide belongs to. */
3294
3308
  site: string;
@@ -3296,6 +3310,8 @@ export interface ChangeRequest {
3296
3310
  run: string;
3297
3311
  /** Number of pages the check changed, recorded when it finished. Absent while it is still running, or when it never completed. */
3298
3312
  changedPages?: number;
3313
+ /** When the most recent style guide check on the change request finished. Later edits from anyone else do not move it. Absent while the first one is still running. */
3314
+ checkedAt?: Timestamp;
3299
3315
  };
3300
3316
  /** If true, the change request is not up-to-date with latest changes in the main content. */
3301
3317
  outdated: boolean;
@@ -5996,6 +6012,54 @@ export interface BillingInvoicePreview {
5996
6012
  amount: number;
5997
6013
  }[];
5998
6014
  }
6015
+ /** The AI credits of the current billing period, grouped the ways the billing screens display them. */
6016
+ export interface Credits {
6017
+ /** Credits granted across every grant. */
6018
+ grantedCredits: number;
6019
+ /** Credits spent by the usage metered so far. */
6020
+ usedCredits: number;
6021
+ /** Credits still available across every grant. */
6022
+ remainingCredits: number;
6023
+ /** Part of the metered AI usage paid by credits rather than billed, as a positive amount. */
6024
+ coveredAmount: number;
6025
+ /** The credits the organization pays for. */
6026
+ paid: BillingCreditsTotals;
6027
+ /** The credits included at no extra cost, from the bundle, sites and rollover. */
6028
+ free: BillingCreditsTotals;
6029
+ /** The credits of the monthly bundle, both paid and bonus. */
6030
+ bundle: BillingCreditsTotals;
6031
+ }
6032
+ /** AI credits available for the current AI billing period. Empty when the organization is not billed for AI usage. */
6033
+ export type CreditGrants = {
6034
+ /** Where the credits come from. `paid` is the credits the monthly bundle pays for, `bonus` the ones included with it, `site` the allowance of the organization's published paid sites, and `rollover` what was left of the previous period. */
6035
+ type: "paid" | "bonus" | "site" | "rollover";
6036
+ /** Credits the grant was created with. */
6037
+ grantedCredits: number;
6038
+ /** Credits of the grant spent by the usage metered so far. */
6039
+ usedCredits: number;
6040
+ /** Credits of the grant still available. */
6041
+ remainingCredits: number;
6042
+ /** For a `site` grant, the published sites the credits come from. */
6043
+ sites?: {
6044
+ /** The type of the site */
6045
+ siteType: SiteType;
6046
+ /** How many sites of this type are published. */
6047
+ count: number;
6048
+ /** Credits included with one site of this type. */
6049
+ creditsPerSite: number;
6050
+ /** Credits these sites contribute to the grant. */
6051
+ grantedCredits: number;
6052
+ }[];
6053
+ }[];
6054
+ /** Credit balance after an accepted bundle change, including grants pending webhook synchronization. */
6055
+ export interface BillingCreditBalance {
6056
+ /** The AI credit bundle to top up every month */
6057
+ creditsBundle: BillingCreditsBundle;
6058
+ /** The AI credits of the current billing period, grouped the ways the billing screens display them. */
6059
+ credits: Credits;
6060
+ /** AI credits available for the current AI billing period. Empty when the organization is not billed for AI usage. */
6061
+ creditGrants: CreditGrants;
6062
+ }
5999
6063
  export type BillingUpgrade = {
6000
6064
  result: "checkout";
6001
6065
  /** Stripe payment session ID */
@@ -6005,6 +6069,8 @@ export type BillingUpgrade = {
6005
6069
  invoice: BillingInvoicePreview;
6006
6070
  } | {
6007
6071
  result: "upgraded";
6072
+ /** Credit balance after an accepted bundle change, including grants pending webhook synchronization. */
6073
+ creditBalance?: BillingCreditBalance;
6008
6074
  } | {
6009
6075
  result: "downgraded";
6010
6076
  } | {
@@ -6042,6 +6108,35 @@ export interface BillingPortal {
6042
6108
  /** URL to the billing portal for an organization */
6043
6109
  url: string;
6044
6110
  }
6111
+ export interface OrganizationAIUsage {
6112
+ /**
6113
+ * Inclusive start of the queried range.
6114
+ * @format date-time
6115
+ */
6116
+ from: string;
6117
+ /**
6118
+ * Exclusive end of the queried range, capped at the current instant.
6119
+ * @format date-time
6120
+ */
6121
+ to: string;
6122
+ /** Chronological calendar buckets. Edge buckets include only the requested dates. */
6123
+ periods: {
6124
+ /**
6125
+ * UTC date at the start of this calendar bucket.
6126
+ * @format date
6127
+ */
6128
+ date: string;
6129
+ /** Total credits used in this bucket. */
6130
+ credits: number;
6131
+ features: {
6132
+ /** AI feature category with recorded credit usage. */
6133
+ feature: string;
6134
+ credits: number;
6135
+ /** Percentage of this bucket's total credits (0 to 100). */
6136
+ creditsPercent: number;
6137
+ }[];
6138
+ }[];
6139
+ }
6045
6140
  /** Usage metrics for a billing meter */
6046
6141
  export interface BillingMeterUsage {
6047
6142
  /** Total usage for the current billing period */
@@ -6452,7 +6547,7 @@ export interface Translation {
6452
6547
  stats: {
6453
6548
  /** Total number of times the translation has been run */
6454
6549
  runs: number;
6455
- /** Total number of words translated */
6550
+ /** Total number of words counted toward translation usage over all runs */
6456
6551
  totalWords: number;
6457
6552
  /** Total number of unique pages translated */
6458
6553
  totalPages: number;
@@ -6462,7 +6557,7 @@ export interface Translation {
6462
6557
  latestRunDuration: number;
6463
6558
  /** Number of unique pages translated in the latest run */
6464
6559
  latestPages: number;
6465
- /** Number of words translated in the latest run */
6560
+ /** Number of words counted toward translation usage in the latest run */
6466
6561
  latestWords: number;
6467
6562
  };
6468
6563
  permissions: {
@@ -9106,6 +9201,7 @@ export type SiteInsightsQueryEventsValues = {
9106
9201
  values: SiteInsightsDisplayContext[];
9107
9202
  } | {
9108
9203
  column: "page";
9204
+ /** Pages to match. `null` matches events that resolved to no page, which for `page_view` events is a 404 (a broken URL). */
9109
9205
  values: (null | {
9110
9206
  page: string | null;
9111
9207
  space: string;
@@ -9899,7 +9995,15 @@ export interface GitSyncSpaceOperation {
9899
9995
  * creating a new revision.
9900
9996
  */
9901
9997
  stage: GitSyncOperationStage;
9998
+ /**
9999
+ * Always `0`. Task-level progress is no longer tracked; read `stage` instead.
10000
+ * @deprecated
10001
+ */
9902
10002
  dispatchedTasks: number;
10003
+ /**
10004
+ * Always `0`. Task-level progress is no longer tracked; read `stage` instead.
10005
+ * @deprecated
10006
+ */
9903
10007
  completedTasks: number;
9904
10008
  /** Date when the operation was started */
9905
10009
  startedAt: Timestamp;
@@ -14428,6 +14532,29 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
14428
14532
  message: string;
14429
14533
  };
14430
14534
  }>>;
14535
+ /**
14536
+ * @description Returns recorded AI usage for an organization. Calendar buckets use UTC; weeks start on Monday. Requires organization administrator permissions.
14537
+ *
14538
+ * @tags billing
14539
+ * @name GetOrganizationAiUsage
14540
+ * @summary Get AI credit usage by AI feature and time period
14541
+ * @request GET:/orgs/{organizationId}/billing/ai-usage
14542
+ * @secure
14543
+ */
14544
+ getOrganizationAiUsage: (organizationId: EntityId, query: {
14545
+ /**
14546
+ * Inclusive start timestamp. Cannot be older than two years from now.
14547
+ * @format date-time
14548
+ */
14549
+ from: string;
14550
+ /**
14551
+ * Exclusive end timestamp.
14552
+ * @format date-time
14553
+ */
14554
+ to: string;
14555
+ /** Calendar interval used to aggregate usage. */
14556
+ interval?: AIUsageInterval;
14557
+ }, params?: RequestParams) => Promise<HttpResponse<OrganizationAIUsage, any>>;
14431
14558
  /**
14432
14559
  * No description
14433
14560
  *
@@ -17548,7 +17675,7 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
17548
17675
  };
17549
17676
  }>>;
17550
17677
  /**
17551
- * @description Starts a style guide check: GitBook Agent reviews the given spaces against the site's style guide and proposes fixes. One draft change request is opened per space, each marked as belonging to the returned run. Fails if the site has no style guide.
17678
+ * @description Starts a style guide check: GitBook Agent reviews the given spaces against the site's style guide and proposes fixes. A space with no check open gets a new draft change request marked as belonging to the returned run; one whose check is still open has it taken over instead, so it stays marked with the run that opened it. Fails if the site has no style guide.
17552
17679
  *
17553
17680
  * @tags sites
17554
17681
  * @name CreateSiteStyleguideRun
@@ -17566,7 +17693,7 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
17566
17693
  }, params?: RequestParams) => Promise<HttpResponse<{
17567
17694
  /** A style guide check run: one time a user asked GitBook Agent to check a set of the site's spaces against the site's style guide, opening a change request for each. */
17568
17695
  run: SiteStyleguideRun;
17569
- /** The change requests opened by the run, one per space that could be started. */
17696
+ /** The change request each space's check runs in: opened by this run, or already open and taken over. One per space that could be started. */
17570
17697
  changeRequests: ChangeRequest[];
17571
17698
  }, {
17572
17699
  error: {
@@ -17609,7 +17736,7 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
17609
17736
  events: SiteInsightsEvent[];
17610
17737
  }, params?: RequestParams) => Promise<HttpResponse<void, any>>;
17611
17738
  /**
17612
- * @description Runs an aggregation query over a published site's Insights events, grouped and filtered over a time range. Use it to answer analytics questions about how visitors engage with a site's documentation.
17739
+ * @description Runs an aggregation query over a published site's Insights events, grouped and filtered over a time range. Use it to answer analytics questions about how visitors engage with a site's documentation: page views, visitors, searches, referrers, and broken URLs (404s). A 404 is a `page_view` or `search_open_result` event whose `page` is `null`, in the `site` display context; filter `eventPageNotFoundType` not in `conditional` to leave out 404s that adaptive content explains. Group by `datetime` for a trend over time and by `urlPath` for the top broken URLs.
17613
17740
  *
17614
17741
  * @tags site-insights
17615
17742
  * @name AggregateSiteEvents
@@ -100,6 +100,7 @@ export declare const BILLING_COUPON_MAX_LENGTH = 500;
100
100
  export declare const BILLING_COUPON_MIN_LENGTH = 1;
101
101
  export declare const BILLING_METER_ENUM: ["ai_responses", "ai_agent_responses", "translation_words"];
102
102
  export declare const BILLING_SWITCH_ACTION_ENUM: ["trial", "upgrade", "upgrade_passive", "downgrade", "switch_interval"];
103
+ export declare const AIUSAGE_INTERVAL_ENUM: ["day", "week", "month", "year"];
103
104
  export declare const ORGANIZATION_FEATURE_ENUM: ["max-members", "ai-lens", "pdf-export", "ai-writing", "reusable-content", "translations", "members-advanced-roles", "members-teams", "members-team-owners", "security-saml", "change-requests-merge-rules"];
104
105
  export declare const SAMLPROVIDER_LABEL_MAX_LENGTH = 30;
105
106
  export declare const SAMLPROVIDER_LABEL_MIN_LENGTH = 1;
package/dist/index.cjs CHANGED
@@ -191,6 +191,8 @@ __export(src_exports, {
191
191
  AIMessageStepPhase: () => AIMessageStepPhase,
192
192
  AIMessageStepStartCondition: () => AIMessageStepStartCondition,
193
193
  AIModel: () => AIModel,
194
+ AIUSAGE_INTERVAL_ENUM: () => AIUSAGE_INTERVAL_ENUM,
195
+ AIUsageInterval: () => AIUsageInterval,
194
196
  APIINTEGRATION_SCOPE_ENUM: () => APIINTEGRATION_SCOPE_ENUM,
195
197
  APIIntegrationScope: () => APIIntegrationScope,
196
198
  APITOKEN_LABEL_MAX_LENGTH: () => APITOKEN_LABEL_MAX_LENGTH,
@@ -562,7 +564,7 @@ module.exports = __toCommonJS(src_exports);
562
564
 
563
565
  // package.json
564
566
  var name = "@gitbook/api";
565
- var version = "0.201.0";
567
+ var version = "0.202.0";
566
568
 
567
569
  // src/client.ts
568
570
  var import_event_iterator = __toESM(require_node(), 1);
@@ -1384,6 +1386,13 @@ var OrganizationFeature = /* @__PURE__ */ ((OrganizationFeature2) => {
1384
1386
  OrganizationFeature2["ChangeRequestsMergeRules"] = "change-requests-merge-rules";
1385
1387
  return OrganizationFeature2;
1386
1388
  })(OrganizationFeature || {});
1389
+ var AIUsageInterval = /* @__PURE__ */ ((AIUsageInterval2) => {
1390
+ AIUsageInterval2["Day"] = "day";
1391
+ AIUsageInterval2["Week"] = "week";
1392
+ AIUsageInterval2["Month"] = "month";
1393
+ AIUsageInterval2["Year"] = "year";
1394
+ return AIUsageInterval2;
1395
+ })(AIUsageInterval || {});
1387
1396
  var BillingSwitchAction = /* @__PURE__ */ ((BillingSwitchAction2) => {
1388
1397
  BillingSwitchAction2["Trial"] = "trial";
1389
1398
  BillingSwitchAction2["Upgrade"] = "upgrade";
@@ -3427,6 +3436,14 @@ var Api = class extends HttpClient {
3427
3436
  secure: true,
3428
3437
  ...params
3429
3438
  }),
3439
+ getOrganizationAiUsage: (organizationId, query, params = {}) => this.request({
3440
+ path: `/orgs/${organizationId}/billing/ai-usage`,
3441
+ method: "GET",
3442
+ query,
3443
+ secure: true,
3444
+ format: "json",
3445
+ ...params
3446
+ }),
3430
3447
  searchOrganizationContent: (organizationId, query, params = {}) => this.request({
3431
3448
  path: `/orgs/${organizationId}/search`,
3432
3449
  method: "GET",
@@ -5116,6 +5133,7 @@ var BILLING_COUPON_MAX_LENGTH = 500;
5116
5133
  var BILLING_COUPON_MIN_LENGTH = 1;
5117
5134
  var BILLING_METER_ENUM = ["ai_responses", "ai_agent_responses", "translation_words"];
5118
5135
  var BILLING_SWITCH_ACTION_ENUM = ["trial", "upgrade", "upgrade_passive", "downgrade", "switch_interval"];
5136
+ var AIUSAGE_INTERVAL_ENUM = ["day", "week", "month", "year"];
5119
5137
  var ORGANIZATION_FEATURE_ENUM = ["max-members", "ai-lens", "pdf-export", "ai-writing", "reusable-content", "translations", "members-advanced-roles", "members-teams", "members-team-owners", "security-saml", "change-requests-merge-rules"];
5120
5138
  var SAMLPROVIDER_LABEL_MAX_LENGTH = 30;
5121
5139
  var SAMLPROVIDER_LABEL_MIN_LENGTH = 1;
@@ -5331,6 +5349,8 @@ var GitBookAPI = class extends Api {
5331
5349
  AIMessageStepPhase,
5332
5350
  AIMessageStepStartCondition,
5333
5351
  AIModel,
5352
+ AIUSAGE_INTERVAL_ENUM,
5353
+ AIUsageInterval,
5334
5354
  APIINTEGRATION_SCOPE_ENUM,
5335
5355
  APIIntegrationScope,
5336
5356
  APITOKEN_LABEL_MAX_LENGTH,
package/dist/index.js CHANGED
@@ -172,7 +172,7 @@ var require_node = __commonJS({
172
172
 
173
173
  // package.json
174
174
  var name = "@gitbook/api";
175
- var version = "0.201.0";
175
+ var version = "0.202.0";
176
176
 
177
177
  // src/client.ts
178
178
  var import_event_iterator = __toESM(require_node(), 1);
@@ -994,6 +994,13 @@ var OrganizationFeature = /* @__PURE__ */ ((OrganizationFeature2) => {
994
994
  OrganizationFeature2["ChangeRequestsMergeRules"] = "change-requests-merge-rules";
995
995
  return OrganizationFeature2;
996
996
  })(OrganizationFeature || {});
997
+ var AIUsageInterval = /* @__PURE__ */ ((AIUsageInterval2) => {
998
+ AIUsageInterval2["Day"] = "day";
999
+ AIUsageInterval2["Week"] = "week";
1000
+ AIUsageInterval2["Month"] = "month";
1001
+ AIUsageInterval2["Year"] = "year";
1002
+ return AIUsageInterval2;
1003
+ })(AIUsageInterval || {});
997
1004
  var BillingSwitchAction = /* @__PURE__ */ ((BillingSwitchAction2) => {
998
1005
  BillingSwitchAction2["Trial"] = "trial";
999
1006
  BillingSwitchAction2["Upgrade"] = "upgrade";
@@ -3037,6 +3044,14 @@ var Api = class extends HttpClient {
3037
3044
  secure: true,
3038
3045
  ...params
3039
3046
  }),
3047
+ getOrganizationAiUsage: (organizationId, query, params = {}) => this.request({
3048
+ path: `/orgs/${organizationId}/billing/ai-usage`,
3049
+ method: "GET",
3050
+ query,
3051
+ secure: true,
3052
+ format: "json",
3053
+ ...params
3054
+ }),
3040
3055
  searchOrganizationContent: (organizationId, query, params = {}) => this.request({
3041
3056
  path: `/orgs/${organizationId}/search`,
3042
3057
  method: "GET",
@@ -4726,6 +4741,7 @@ var BILLING_COUPON_MAX_LENGTH = 500;
4726
4741
  var BILLING_COUPON_MIN_LENGTH = 1;
4727
4742
  var BILLING_METER_ENUM = ["ai_responses", "ai_agent_responses", "translation_words"];
4728
4743
  var BILLING_SWITCH_ACTION_ENUM = ["trial", "upgrade", "upgrade_passive", "downgrade", "switch_interval"];
4744
+ var AIUSAGE_INTERVAL_ENUM = ["day", "week", "month", "year"];
4729
4745
  var ORGANIZATION_FEATURE_ENUM = ["max-members", "ai-lens", "pdf-export", "ai-writing", "reusable-content", "translations", "members-advanced-roles", "members-teams", "members-team-owners", "security-saml", "change-requests-merge-rules"];
4730
4746
  var SAMLPROVIDER_LABEL_MAX_LENGTH = 30;
4731
4747
  var SAMLPROVIDER_LABEL_MIN_LENGTH = 1;
@@ -4940,6 +4956,8 @@ export {
4940
4956
  AIMessageStepPhase,
4941
4957
  AIMessageStepStartCondition,
4942
4958
  AIModel,
4959
+ AIUSAGE_INTERVAL_ENUM,
4960
+ AIUsageInterval,
4943
4961
  APIINTEGRATION_SCOPE_ENUM,
4944
4962
  APIIntegrationScope,
4945
4963
  APITOKEN_LABEL_MAX_LENGTH,
package/package.json CHANGED
@@ -4,7 +4,7 @@
4
4
  "main": "./dist/index.cjs",
5
5
  "module": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",
7
- "version": "0.201.0",
7
+ "version": "0.202.0",
8
8
  "sideEffects": false,
9
9
  "files": [
10
10
  "README.md",
package/spec/openapi.json CHANGED
@@ -8850,6 +8850,7 @@
8850
8850
  "/orgs/{organizationId}/members": {
8851
8851
  "get": {
8852
8852
  "operationId": "listMembersInOrganizationById",
8853
+ "x-gitbook-mcp": true,
8853
8854
  "summary": "List all organization members",
8854
8855
  "tags": [
8855
8856
  "organization-members"
@@ -8922,6 +8923,7 @@
8922
8923
  "/orgs/{organizationId}/members/{userId}": {
8923
8924
  "get": {
8924
8925
  "operationId": "getMemberInOrganizationById",
8926
+ "x-gitbook-mcp": true,
8925
8927
  "summary": "Get an organization member by its ID",
8926
8928
  "tags": [
8927
8929
  "organization-members",
@@ -9187,6 +9189,7 @@
9187
9189
  "/orgs/{organizationId}/members/{userId}/teams": {
9188
9190
  "get": {
9189
9191
  "operationId": "listTeamsForOrganizationMember",
9192
+ "x-gitbook-mcp": true,
9190
9193
  "summary": "List all organization member teams",
9191
9194
  "tags": [
9192
9195
  "organization-members"
@@ -9270,6 +9273,7 @@
9270
9273
  "/orgs/{organizationId}/teams": {
9271
9274
  "get": {
9272
9275
  "operationId": "listTeamsInOrganizationById",
9276
+ "x-gitbook-mcp": true,
9273
9277
  "summary": "List all teams",
9274
9278
  "tags": [
9275
9279
  "teams"
@@ -9573,6 +9577,7 @@
9573
9577
  },
9574
9578
  "get": {
9575
9579
  "operationId": "listTeamMembersInOrganizationById",
9580
+ "x-gitbook-mcp": true,
9576
9581
  "summary": "List all team members",
9577
9582
  "description": "Lists members, and their roles, for the specified organization team.\n",
9578
9583
  "tags": [
@@ -10116,6 +10121,67 @@
10116
10121
  }
10117
10122
  }
10118
10123
  },
10124
+ "/orgs/{organizationId}/billing/ai-usage": {
10125
+ "get": {
10126
+ "operationId": "getOrganizationAIUsage",
10127
+ "summary": "Get AI credit usage by AI feature and time period",
10128
+ "description": "Returns recorded AI usage for an organization. Calendar buckets use UTC;\nweeks start on Monday. Requires organization administrator permissions.\n",
10129
+ "x-gitbook-mcp": true,
10130
+ "tags": [
10131
+ "billing"
10132
+ ],
10133
+ "security": [
10134
+ {
10135
+ "user": []
10136
+ }
10137
+ ],
10138
+ "parameters": [
10139
+ {
10140
+ "$ref": "#/components/parameters/organizationId"
10141
+ },
10142
+ {
10143
+ "name": "from",
10144
+ "in": "query",
10145
+ "required": true,
10146
+ "description": "Inclusive start timestamp. Cannot be older than two years from now.",
10147
+ "schema": {
10148
+ "type": "string",
10149
+ "format": "date-time"
10150
+ }
10151
+ },
10152
+ {
10153
+ "name": "to",
10154
+ "in": "query",
10155
+ "required": true,
10156
+ "description": "Exclusive end timestamp.",
10157
+ "schema": {
10158
+ "type": "string",
10159
+ "format": "date-time"
10160
+ }
10161
+ },
10162
+ {
10163
+ "name": "interval",
10164
+ "in": "query",
10165
+ "description": "Calendar interval used to aggregate usage.",
10166
+ "schema": {
10167
+ "$ref": "#/components/schemas/AIUsageInterval"
10168
+ }
10169
+ }
10170
+ ],
10171
+ "responses": {
10172
+ "200": {
10173
+ "description": "AI usage, including empty periods in the requested range.",
10174
+ "content": {
10175
+ "application/json": {
10176
+ "schema": {
10177
+ "$ref": "#/components/schemas/OrganizationAIUsage"
10178
+ }
10179
+ }
10180
+ }
10181
+ }
10182
+ }
10183
+ }
10184
+ },
10119
10185
  "/orgs/{organizationId}/search": {
10120
10186
  "get": {
10121
10187
  "operationId": "searchOrganizationContent",
@@ -20523,7 +20589,7 @@
20523
20589
  "post": {
20524
20590
  "operationId": "createSiteStyleguideRun",
20525
20591
  "summary": "Start a style guide check run for a site",
20526
- "description": "Starts a style guide check: GitBook Agent reviews the given spaces against the site's style guide and proposes fixes. One draft change request is opened per space, each marked as belonging to the returned run. Fails if the site has no style guide.",
20592
+ "description": "Starts a style guide check: GitBook Agent reviews the given spaces against the site's style guide and proposes fixes. A space with no check open gets a new draft change request marked as belonging to the returned run; one whose check is still open has it taken over instead, so it stays marked with the run that opened it. Fails if the site has no style guide.",
20527
20593
  "x-gitbook-mcp": true,
20528
20594
  "tags": [
20529
20595
  "sites"
@@ -20583,7 +20649,7 @@
20583
20649
  },
20584
20650
  "changeRequests": {
20585
20651
  "type": "array",
20586
- "description": "The change requests opened by the run, one per space that could be started.",
20652
+ "description": "The change request each space's check runs in: opened by this run, or already open and taken over. One per space that could be started.",
20587
20653
  "items": {
20588
20654
  "$ref": "#/components/schemas/ChangeRequest"
20589
20655
  }
@@ -20713,7 +20779,7 @@
20713
20779
  "post": {
20714
20780
  "operationId": "aggregateSiteEvents",
20715
20781
  "summary": "Query a site's analytics events",
20716
- "description": "Runs an aggregation query over a published site's Insights events, grouped and filtered over a time range. Use it to answer analytics questions about how visitors engage with a site's documentation.",
20782
+ "description": "Runs an aggregation query over a published site's Insights events, grouped and filtered over a time range. Use it to answer analytics questions about how visitors engage with a site's documentation: page views, visitors, searches, referrers, and broken URLs (404s). A 404 is a `page_view` or `search_open_result` event whose `page` is `null`, in the `site` display context; filter `eventPageNotFoundType` not in `conditional` to leave out 404s that adaptive content explains. Group by `datetime` for a trend over time and by `urlPath` for the top broken URLs.",
20717
20783
  "x-gitbook-mcp": true,
20718
20784
  "security": [
20719
20785
  {
@@ -29200,6 +29266,10 @@
29200
29266
  },
29201
29267
  "icon": {
29202
29268
  "$ref": "#/components/schemas/Icon"
29269
+ },
29270
+ "slug": {
29271
+ "description": "Stable identifier for this tab's selection, shared with every tab and button targeting the same slug. It is slugified before matching, so casing and spacing need not be exact. Omit it — or send an empty value, which counts as omitted — to derive one from the title, which is what makes same-named tabs across a site select together. A value that slugifies to nothing, such as emoji alone, also falls back to the title.",
29272
+ "type": "string"
29203
29273
  }
29204
29274
  }
29205
29275
  },
@@ -31116,6 +31186,10 @@
31116
31186
  "actions": {
31117
31187
  "type": "boolean",
31118
31188
  "description": "Should the page actions be visible on the page?"
31189
+ },
31190
+ "anchors": {
31191
+ "type": "boolean",
31192
+ "description": "Should the anchor links on headings and other linkable blocks be visible?"
31119
31193
  }
31120
31194
  },
31121
31195
  "required": [
@@ -31130,7 +31204,8 @@
31130
31204
  "pagination",
31131
31205
  "metadata",
31132
31206
  "tags",
31133
- "actions"
31207
+ "actions",
31208
+ "anchors"
31134
31209
  ]
31135
31210
  },
31136
31211
  "RevisionPageDocumentCoverTextColor": {
@@ -32071,7 +32146,7 @@
32071
32146
  },
32072
32147
  "styleguide": {
32073
32148
  "type": "object",
32074
- "description": "Style guide check run that opened the change request, when it came from one.",
32149
+ "description": "Style guide check that opened the change request, when it came from one. A check can be run again on the change request already open on a space, rather than opening a second one, so several checks can share a change request.\n",
32075
32150
  "properties": {
32076
32151
  "site": {
32077
32152
  "type": "string",
@@ -32084,6 +32159,10 @@
32084
32159
  "changedPages": {
32085
32160
  "type": "number",
32086
32161
  "description": "Number of pages the check changed, recorded when it finished. Absent while it is still running, or when it never completed.\n"
32162
+ },
32163
+ "checkedAt": {
32164
+ "$ref": "#/components/schemas/Timestamp",
32165
+ "description": "When the most recent style guide check on the change request finished. Later edits from anyone else do not move it. Absent while the first one is still running.\n"
32087
32166
  }
32088
32167
  },
32089
32168
  "required": [
@@ -40737,6 +40816,138 @@
40737
40816
  "summary"
40738
40817
  ]
40739
40818
  },
40819
+ "credits": {
40820
+ "type": "object",
40821
+ "description": "The AI credits of the current billing period, grouped the ways the billing screens display them.",
40822
+ "properties": {
40823
+ "grantedCredits": {
40824
+ "description": "Credits granted across every grant.",
40825
+ "type": "number"
40826
+ },
40827
+ "usedCredits": {
40828
+ "description": "Credits spent by the usage metered so far.",
40829
+ "type": "number"
40830
+ },
40831
+ "remainingCredits": {
40832
+ "description": "Credits still available across every grant.",
40833
+ "type": "number"
40834
+ },
40835
+ "coveredAmount": {
40836
+ "description": "Part of the metered AI usage paid by credits rather than billed, as a positive amount.",
40837
+ "type": "number"
40838
+ },
40839
+ "paid": {
40840
+ "description": "The credits the organization pays for.",
40841
+ "$ref": "#/components/schemas/BillingCreditsTotals"
40842
+ },
40843
+ "free": {
40844
+ "description": "The credits included at no extra cost, from the bundle, sites and rollover.",
40845
+ "$ref": "#/components/schemas/BillingCreditsTotals"
40846
+ },
40847
+ "bundle": {
40848
+ "description": "The credits of the monthly bundle, both paid and bonus.",
40849
+ "$ref": "#/components/schemas/BillingCreditsTotals"
40850
+ }
40851
+ },
40852
+ "required": [
40853
+ "grantedCredits",
40854
+ "usedCredits",
40855
+ "remainingCredits",
40856
+ "coveredAmount",
40857
+ "paid",
40858
+ "free",
40859
+ "bundle"
40860
+ ]
40861
+ },
40862
+ "creditGrants": {
40863
+ "type": "array",
40864
+ "description": "AI credits available for the current AI billing period. Empty when the organization is not billed for AI usage.",
40865
+ "items": {
40866
+ "type": "object",
40867
+ "description": "AI credits granted to the organization for the current AI billing period.",
40868
+ "properties": {
40869
+ "type": {
40870
+ "type": "string",
40871
+ "description": "Where the credits come from. `paid` is the credits the monthly bundle pays for, `bonus` the ones included with it, `site` the allowance of the organization's published paid sites, and `rollover` what was left of the previous period.",
40872
+ "enum": [
40873
+ "paid",
40874
+ "bonus",
40875
+ "site",
40876
+ "rollover"
40877
+ ]
40878
+ },
40879
+ "grantedCredits": {
40880
+ "description": "Credits the grant was created with.",
40881
+ "type": "number"
40882
+ },
40883
+ "usedCredits": {
40884
+ "description": "Credits of the grant spent by the usage metered so far.",
40885
+ "type": "number"
40886
+ },
40887
+ "remainingCredits": {
40888
+ "description": "Credits of the grant still available.",
40889
+ "type": "number"
40890
+ },
40891
+ "sites": {
40892
+ "description": "For a `site` grant, the published sites the credits come from.",
40893
+ "type": "array",
40894
+ "items": {
40895
+ "type": "object",
40896
+ "description": "The published sites of one type that the grant comes from.",
40897
+ "properties": {
40898
+ "siteType": {
40899
+ "$ref": "#/components/schemas/SiteType"
40900
+ },
40901
+ "count": {
40902
+ "description": "How many sites of this type are published.",
40903
+ "type": "number"
40904
+ },
40905
+ "creditsPerSite": {
40906
+ "description": "Credits included with one site of this type.",
40907
+ "type": "number"
40908
+ },
40909
+ "grantedCredits": {
40910
+ "description": "Credits these sites contribute to the grant.",
40911
+ "type": "number"
40912
+ }
40913
+ },
40914
+ "required": [
40915
+ "siteType",
40916
+ "count",
40917
+ "creditsPerSite",
40918
+ "grantedCredits"
40919
+ ]
40920
+ }
40921
+ }
40922
+ },
40923
+ "required": [
40924
+ "type",
40925
+ "grantedCredits",
40926
+ "usedCredits",
40927
+ "remainingCredits"
40928
+ ]
40929
+ }
40930
+ },
40931
+ "BillingCreditBalance": {
40932
+ "type": "object",
40933
+ "description": "Credit balance after an accepted bundle change, including grants pending webhook synchronization.",
40934
+ "properties": {
40935
+ "creditsBundle": {
40936
+ "$ref": "#/components/schemas/BillingCreditsBundle"
40937
+ },
40938
+ "credits": {
40939
+ "$ref": "#/components/schemas/credits"
40940
+ },
40941
+ "creditGrants": {
40942
+ "$ref": "#/components/schemas/creditGrants"
40943
+ }
40944
+ },
40945
+ "required": [
40946
+ "creditsBundle",
40947
+ "credits",
40948
+ "creditGrants"
40949
+ ]
40950
+ },
40740
40951
  "BillingUpgrade": {
40741
40952
  "oneOf": [
40742
40953
  {
@@ -40784,6 +40995,9 @@
40784
40995
  "enum": [
40785
40996
  "upgraded"
40786
40997
  ]
40998
+ },
40999
+ "creditBalance": {
41000
+ "$ref": "#/components/schemas/BillingCreditBalance"
40787
41001
  }
40788
41002
  },
40789
41003
  "required": [
@@ -40933,6 +41147,84 @@
40933
41147
  "switch_interval"
40934
41148
  ]
40935
41149
  },
41150
+ "AIUsageInterval": {
41151
+ "type": "string",
41152
+ "description": "UTC calendar interval for AI usage, with weeks starting on Monday.",
41153
+ "enum": [
41154
+ "day",
41155
+ "week",
41156
+ "month",
41157
+ "year"
41158
+ ],
41159
+ "default": "day"
41160
+ },
41161
+ "OrganizationAIUsage": {
41162
+ "type": "object",
41163
+ "required": [
41164
+ "periods",
41165
+ "from",
41166
+ "to"
41167
+ ],
41168
+ "properties": {
41169
+ "from": {
41170
+ "type": "string",
41171
+ "format": "date-time",
41172
+ "description": "Inclusive start of the queried range."
41173
+ },
41174
+ "to": {
41175
+ "type": "string",
41176
+ "format": "date-time",
41177
+ "description": "Exclusive end of the queried range, capped at the current instant."
41178
+ },
41179
+ "periods": {
41180
+ "type": "array",
41181
+ "description": "Chronological calendar buckets. Edge buckets include only the requested dates.",
41182
+ "items": {
41183
+ "type": "object",
41184
+ "required": [
41185
+ "date",
41186
+ "credits",
41187
+ "features"
41188
+ ],
41189
+ "properties": {
41190
+ "date": {
41191
+ "type": "string",
41192
+ "format": "date",
41193
+ "description": "UTC date at the start of this calendar bucket."
41194
+ },
41195
+ "credits": {
41196
+ "type": "number",
41197
+ "description": "Total credits used in this bucket."
41198
+ },
41199
+ "features": {
41200
+ "type": "array",
41201
+ "items": {
41202
+ "type": "object",
41203
+ "required": [
41204
+ "feature",
41205
+ "credits",
41206
+ "creditsPercent"
41207
+ ],
41208
+ "properties": {
41209
+ "feature": {
41210
+ "type": "string",
41211
+ "description": "AI feature category with recorded credit usage."
41212
+ },
41213
+ "credits": {
41214
+ "type": "number"
41215
+ },
41216
+ "creditsPercent": {
41217
+ "type": "number",
41218
+ "description": "Percentage of this bucket's total credits (0 to 100)."
41219
+ }
41220
+ }
41221
+ }
41222
+ }
41223
+ }
41224
+ }
41225
+ }
41226
+ }
41227
+ },
40936
41228
  "BillingMeterUsage": {
40937
41229
  "type": "object",
40938
41230
  "description": "Usage metrics for a billing meter",
@@ -42109,7 +42401,7 @@
42109
42401
  },
42110
42402
  "totalWords": {
42111
42403
  "type": "integer",
42112
- "description": "Total number of words translated"
42404
+ "description": "Total number of words counted toward translation usage over all runs"
42113
42405
  },
42114
42406
  "totalPages": {
42115
42407
  "type": "integer",
@@ -42129,7 +42421,7 @@
42129
42421
  },
42130
42422
  "latestWords": {
42131
42423
  "type": "integer",
42132
- "description": "Number of words translated in the latest run"
42424
+ "description": "Number of words counted toward translation usage in the latest run"
42133
42425
  }
42134
42426
  },
42135
42427
  "required": [
@@ -51767,6 +52059,7 @@
51767
52059
  ]
51768
52060
  },
51769
52061
  "values": {
52062
+ "description": "Pages to match. `null` matches events that resolved to no page, which for `page_view` events is a 404 (a broken URL).",
51770
52063
  "type": "array",
51771
52064
  "items": {
51772
52065
  "oneOf": [
@@ -54813,10 +55106,14 @@
54813
55106
  "$ref": "#/components/schemas/GitSyncOperationStage"
54814
55107
  },
54815
55108
  "dispatchedTasks": {
54816
- "type": "number"
55109
+ "type": "number",
55110
+ "deprecated": true,
55111
+ "description": "Always `0`. Task-level progress is no longer tracked; read `stage` instead."
54817
55112
  },
54818
55113
  "completedTasks": {
54819
- "type": "number"
55114
+ "type": "number",
55115
+ "deprecated": true,
55116
+ "description": "Always `0`. Task-level progress is no longer tracked; read `stage` instead."
54820
55117
  },
54821
55118
  "startedAt": {
54822
55119
  "description": "Date when the operation was started",
package/spec/openapi.yaml CHANGED
@@ -5093,6 +5093,7 @@ paths:
5093
5093
  /orgs/{organizationId}/members:
5094
5094
  get:
5095
5095
  operationId: listMembersInOrganizationById
5096
+ x-gitbook-mcp: true
5096
5097
  summary: List all organization members
5097
5098
  tags:
5098
5099
  - organization-members
@@ -5127,6 +5128,7 @@ paths:
5127
5128
  /orgs/{organizationId}/members/{userId}:
5128
5129
  get:
5129
5130
  operationId: getMemberInOrganizationById
5131
+ x-gitbook-mcp: true
5130
5132
  summary: Get an organization member by its ID
5131
5133
  tags:
5132
5134
  - organization-members
@@ -5266,6 +5268,7 @@ paths:
5266
5268
  /orgs/{organizationId}/members/{userId}/teams:
5267
5269
  get:
5268
5270
  operationId: listTeamsForOrganizationMember
5271
+ x-gitbook-mcp: true
5269
5272
  summary: List all organization member teams
5270
5273
  tags:
5271
5274
  - organization-members
@@ -5310,6 +5313,7 @@ paths:
5310
5313
  /orgs/{organizationId}/teams:
5311
5314
  get:
5312
5315
  operationId: listTeamsInOrganizationById
5316
+ x-gitbook-mcp: true
5313
5317
  summary: List all teams
5314
5318
  tags:
5315
5319
  - teams
@@ -5474,6 +5478,7 @@ paths:
5474
5478
  description: Members have been updated
5475
5479
  get:
5476
5480
  operationId: listTeamMembersInOrganizationById
5481
+ x-gitbook-mcp: true
5477
5482
  summary: List all team members
5478
5483
  description: |
5479
5484
  Lists members, and their roles, for the specified organization team.
@@ -5769,6 +5774,46 @@ paths:
5769
5774
  "404":
5770
5775
  description: Organization not found
5771
5776
  $ref: "#/components/responses/NotFoundError"
5777
+ /orgs/{organizationId}/billing/ai-usage:
5778
+ get:
5779
+ operationId: getOrganizationAIUsage
5780
+ summary: Get AI credit usage by AI feature and time period
5781
+ description: |
5782
+ Returns recorded AI usage for an organization. Calendar buckets use UTC;
5783
+ weeks start on Monday. Requires organization administrator permissions.
5784
+ x-gitbook-mcp: true
5785
+ tags:
5786
+ - billing
5787
+ security:
5788
+ - user: []
5789
+ parameters:
5790
+ - $ref: "#/components/parameters/organizationId"
5791
+ - name: from
5792
+ in: query
5793
+ required: true
5794
+ description: Inclusive start timestamp. Cannot be older than two years from now.
5795
+ schema:
5796
+ type: string
5797
+ format: date-time
5798
+ - name: to
5799
+ in: query
5800
+ required: true
5801
+ description: Exclusive end timestamp.
5802
+ schema:
5803
+ type: string
5804
+ format: date-time
5805
+ - name: interval
5806
+ in: query
5807
+ description: Calendar interval used to aggregate usage.
5808
+ schema:
5809
+ $ref: "#/components/schemas/AIUsageInterval"
5810
+ responses:
5811
+ "200":
5812
+ description: AI usage, including empty periods in the requested range.
5813
+ content:
5814
+ application/json:
5815
+ schema:
5816
+ $ref: "#/components/schemas/OrganizationAIUsage"
5772
5817
  /orgs/{organizationId}/search:
5773
5818
  get:
5774
5819
  operationId: searchOrganizationContent
@@ -11490,7 +11535,7 @@ paths:
11490
11535
  post:
11491
11536
  operationId: createSiteStyleguideRun
11492
11537
  summary: Start a style guide check run for a site
11493
- description: "Starts a style guide check: GitBook Agent reviews the given spaces against the site's style guide and proposes fixes. One draft change request is opened per space, each marked as belonging to the returned run. Fails if the site has no style guide."
11538
+ description: "Starts a style guide check: GitBook Agent reviews the given spaces against the site's style guide and proposes fixes. A space with no check open gets a new draft change request marked as belonging to the returned run; one whose check is still open has it taken over instead, so it stays marked with the run that opened it. Fails if the site has no style guide."
11494
11539
  x-gitbook-mcp: true
11495
11540
  tags:
11496
11541
  - sites
@@ -11529,7 +11574,7 @@ paths:
11529
11574
  $ref: "#/components/schemas/SiteStyleguideRun"
11530
11575
  changeRequests:
11531
11576
  type: array
11532
- description: The change requests opened by the run, one per space that could be started.
11577
+ description: "The change request each space's check runs in: opened by this run, or already open and taken over. One per space that could be started."
11533
11578
  items:
11534
11579
  $ref: "#/components/schemas/ChangeRequest"
11535
11580
  required:
@@ -11598,7 +11643,7 @@ paths:
11598
11643
  post:
11599
11644
  operationId: aggregateSiteEvents
11600
11645
  summary: Query a site's analytics events
11601
- description: Runs an aggregation query over a published site's Insights events, grouped and filtered over a time range. Use it to answer analytics questions about how visitors engage with a site's documentation.
11646
+ description: "Runs an aggregation query over a published site's Insights events, grouped and filtered over a time range. Use it to answer analytics questions about how visitors engage with a site's documentation: page views, visitors, searches, referrers, and broken URLs (404s). A 404 is a `page_view` or `search_open_result` event whose `page` is `null`, in the `site` display context; filter `eventPageNotFoundType` not in `conditional` to leave out 404s that adaptive content explains. Group by `datetime` for a trend over time and by `urlPath` for the top broken URLs."
11602
11647
  x-gitbook-mcp: true
11603
11648
  security:
11604
11649
  - user: []
@@ -17076,6 +17121,9 @@ components:
17076
17121
  type: string
17077
17122
  icon:
17078
17123
  $ref: "#/components/schemas/Icon"
17124
+ slug:
17125
+ description: Stable identifier for this tab's selection, shared with every tab and button targeting the same slug. It is slugified before matching, so casing and spacing need not be exact. Omit it — or send an empty value, which counts as omitted — to derive one from the title, which is what makes same-named tabs across a site select together. A value that slugifies to nothing, such as emoji alone, also falls back to the title.
17126
+ type: string
17079
17127
  meta:
17080
17128
  type: object
17081
17129
  properties:
@@ -18250,6 +18298,9 @@ components:
18250
18298
  actions:
18251
18299
  type: boolean
18252
18300
  description: Should the page actions be visible on the page?
18301
+ anchors:
18302
+ type: boolean
18303
+ description: Should the anchor links on headings and other linkable blocks be visible?
18253
18304
  required:
18254
18305
  - width
18255
18306
  - cover
@@ -18263,6 +18314,7 @@ components:
18263
18314
  - metadata
18264
18315
  - tags
18265
18316
  - actions
18317
+ - anchors
18266
18318
  RevisionPageDocumentCoverTextColor:
18267
18319
  type: string
18268
18320
  enum:
@@ -18871,7 +18923,8 @@ components:
18871
18923
  - topic
18872
18924
  styleguide:
18873
18925
  type: object
18874
- description: Style guide check run that opened the change request, when it came from one.
18926
+ description: |
18927
+ Style guide check that opened the change request, when it came from one. A check can be run again on the change request already open on a space, rather than opening a second one, so several checks can share a change request.
18875
18928
  properties:
18876
18929
  site:
18877
18930
  type: string
@@ -18883,6 +18936,10 @@ components:
18883
18936
  type: number
18884
18937
  description: |
18885
18938
  Number of pages the check changed, recorded when it finished. Absent while it is still running, or when it never completed.
18939
+ checkedAt:
18940
+ $ref: "#/components/schemas/Timestamp"
18941
+ description: |
18942
+ When the most recent style guide check on the change request finished. Later edits from anyone else do not move it. Absent while the first one is still running.
18886
18943
  required:
18887
18944
  - site
18888
18945
  - run
@@ -24728,6 +24785,105 @@ components:
24728
24785
  - remainingCustomerBalance
24729
24786
  - lines
24730
24787
  - summary
24788
+ credits:
24789
+ type: object
24790
+ description: The AI credits of the current billing period, grouped the ways the billing screens display them.
24791
+ properties:
24792
+ grantedCredits:
24793
+ description: Credits granted across every grant.
24794
+ type: number
24795
+ usedCredits:
24796
+ description: Credits spent by the usage metered so far.
24797
+ type: number
24798
+ remainingCredits:
24799
+ description: Credits still available across every grant.
24800
+ type: number
24801
+ coveredAmount:
24802
+ description: Part of the metered AI usage paid by credits rather than billed, as a positive amount.
24803
+ type: number
24804
+ paid:
24805
+ description: The credits the organization pays for.
24806
+ $ref: "#/components/schemas/BillingCreditsTotals"
24807
+ free:
24808
+ description: The credits included at no extra cost, from the bundle, sites and rollover.
24809
+ $ref: "#/components/schemas/BillingCreditsTotals"
24810
+ bundle:
24811
+ description: The credits of the monthly bundle, both paid and bonus.
24812
+ $ref: "#/components/schemas/BillingCreditsTotals"
24813
+ required:
24814
+ - grantedCredits
24815
+ - usedCredits
24816
+ - remainingCredits
24817
+ - coveredAmount
24818
+ - paid
24819
+ - free
24820
+ - bundle
24821
+ creditGrants:
24822
+ type: array
24823
+ description: AI credits available for the current AI billing period. Empty when the organization is not billed for AI usage.
24824
+ items:
24825
+ type: object
24826
+ description: AI credits granted to the organization for the current AI billing period.
24827
+ properties:
24828
+ type:
24829
+ type: string
24830
+ description: Where the credits come from. `paid` is the credits the monthly bundle pays for, `bonus` the ones included with it, `site` the allowance of the organization's published paid sites, and `rollover` what was left of the previous period.
24831
+ enum:
24832
+ - paid
24833
+ - bonus
24834
+ - site
24835
+ - rollover
24836
+ grantedCredits:
24837
+ description: Credits the grant was created with.
24838
+ type: number
24839
+ usedCredits:
24840
+ description: Credits of the grant spent by the usage metered so far.
24841
+ type: number
24842
+ remainingCredits:
24843
+ description: Credits of the grant still available.
24844
+ type: number
24845
+ sites:
24846
+ description: For a `site` grant, the published sites the credits come from.
24847
+ type: array
24848
+ items:
24849
+ type: object
24850
+ description: The published sites of one type that the grant comes from.
24851
+ properties:
24852
+ siteType:
24853
+ $ref: "#/components/schemas/SiteType"
24854
+ count:
24855
+ description: How many sites of this type are published.
24856
+ type: number
24857
+ creditsPerSite:
24858
+ description: Credits included with one site of this type.
24859
+ type: number
24860
+ grantedCredits:
24861
+ description: Credits these sites contribute to the grant.
24862
+ type: number
24863
+ required:
24864
+ - siteType
24865
+ - count
24866
+ - creditsPerSite
24867
+ - grantedCredits
24868
+ required:
24869
+ - type
24870
+ - grantedCredits
24871
+ - usedCredits
24872
+ - remainingCredits
24873
+ BillingCreditBalance:
24874
+ type: object
24875
+ description: Credit balance after an accepted bundle change, including grants pending webhook synchronization.
24876
+ properties:
24877
+ creditsBundle:
24878
+ $ref: "#/components/schemas/BillingCreditsBundle"
24879
+ credits:
24880
+ $ref: "#/components/schemas/credits"
24881
+ creditGrants:
24882
+ $ref: "#/components/schemas/creditGrants"
24883
+ required:
24884
+ - creditsBundle
24885
+ - credits
24886
+ - creditGrants
24731
24887
  BillingUpgrade:
24732
24888
  oneOf:
24733
24889
  - type: object
@@ -24759,6 +24915,8 @@ components:
24759
24915
  type: string
24760
24916
  enum:
24761
24917
  - upgraded
24918
+ creditBalance:
24919
+ $ref: "#/components/schemas/BillingCreditBalance"
24762
24920
  required:
24763
24921
  - result
24764
24922
  - type: object
@@ -24857,6 +25015,64 @@ components:
24857
25015
  - upgrade_passive
24858
25016
  - downgrade
24859
25017
  - switch_interval
25018
+ AIUsageInterval:
25019
+ type: string
25020
+ description: UTC calendar interval for AI usage, with weeks starting on Monday.
25021
+ enum:
25022
+ - day
25023
+ - week
25024
+ - month
25025
+ - year
25026
+ default: day
25027
+ OrganizationAIUsage:
25028
+ type: object
25029
+ required:
25030
+ - periods
25031
+ - from
25032
+ - to
25033
+ properties:
25034
+ from:
25035
+ type: string
25036
+ format: date-time
25037
+ description: Inclusive start of the queried range.
25038
+ to:
25039
+ type: string
25040
+ format: date-time
25041
+ description: Exclusive end of the queried range, capped at the current instant.
25042
+ periods:
25043
+ type: array
25044
+ description: Chronological calendar buckets. Edge buckets include only the requested dates.
25045
+ items:
25046
+ type: object
25047
+ required:
25048
+ - date
25049
+ - credits
25050
+ - features
25051
+ properties:
25052
+ date:
25053
+ type: string
25054
+ format: date
25055
+ description: UTC date at the start of this calendar bucket.
25056
+ credits:
25057
+ type: number
25058
+ description: Total credits used in this bucket.
25059
+ features:
25060
+ type: array
25061
+ items:
25062
+ type: object
25063
+ required:
25064
+ - feature
25065
+ - credits
25066
+ - creditsPercent
25067
+ properties:
25068
+ feature:
25069
+ type: string
25070
+ description: AI feature category with recorded credit usage.
25071
+ credits:
25072
+ type: number
25073
+ creditsPercent:
25074
+ type: number
25075
+ description: Percentage of this bucket's total credits (0 to 100).
24860
25076
  BillingMeterUsage:
24861
25077
  type: object
24862
25078
  description: Usage metrics for a billing meter
@@ -25685,7 +25901,7 @@ components:
25685
25901
  description: Total number of times the translation has been run
25686
25902
  totalWords:
25687
25903
  type: integer
25688
- description: Total number of words translated
25904
+ description: Total number of words counted toward translation usage over all runs
25689
25905
  totalPages:
25690
25906
  type: integer
25691
25907
  description: Total number of unique pages translated
@@ -25700,7 +25916,7 @@ components:
25700
25916
  description: Number of unique pages translated in the latest run
25701
25917
  latestWords:
25702
25918
  type: integer
25703
- description: Number of words translated in the latest run
25919
+ description: Number of words counted toward translation usage in the latest run
25704
25920
  required:
25705
25921
  - runs
25706
25922
  - totalWords
@@ -32293,6 +32509,7 @@ components:
32293
32509
  enum:
32294
32510
  - page
32295
32511
  values:
32512
+ description: Pages to match. `null` matches events that resolved to no page, which for `page_view` events is a 404 (a broken URL).
32296
32513
  type: array
32297
32514
  items:
32298
32515
  oneOf:
@@ -34317,8 +34534,12 @@ components:
34317
34534
  $ref: "#/components/schemas/GitSyncOperationStage"
34318
34535
  dispatchedTasks:
34319
34536
  type: number
34537
+ deprecated: true
34538
+ description: Always `0`. Task-level progress is no longer tracked; read `stage` instead.
34320
34539
  completedTasks:
34321
34540
  type: number
34541
+ deprecated: true
34542
+ description: Always `0`. Task-level progress is no longer tracked; read `stage` instead.
34322
34543
  startedAt:
34323
34544
  description: Date when the operation was started
34324
34545
  $ref: "#/components/schemas/Timestamp"