@bike4mind/sdk 1.1.0 → 1.1.2

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/README.md CHANGED
@@ -123,3 +123,7 @@ pnpm turbo:openapi:generate # regenerates the spec, then the SDK types
123
123
  ```
124
124
 
125
125
  `pnpm --filter @bike4mind/sdk generate` regenerates only the SDK types from the current spec. CI fails when either is stale.
126
+
127
+ ## Publishing
128
+
129
+ Released to npm from CI through npm trusted publishing (OIDC); no npm token is stored.
package/dist/index.d.cts CHANGED
@@ -163,7 +163,7 @@ interface paths {
163
163
  put?: never;
164
164
  /**
165
165
  * Synthesize speech from text
166
- * @description Generates speech from text using OpenAI or ElevenLabs. When the requested provider has no usable key (or the provider rejects it), another configured provider stands in and the substitution is reported via `provider`/`fallbackFrom` and the `X-B4M-Tts-Provider*` headers. Input length is capped per provider (OpenAI 4096 characters, ElevenLabs 10000), and an output `format` the chosen provider cannot produce is rejected with a 422 before any provider cost is incurred. The default `encoding: "binary"` returns the raw audio bytes; `encoding: "base64"` returns JSON. Audio over the ~4MB response ceiling is returned by signed URL (a `303` for binary, the `delivery: "url"` variant for base64). Generated audio is saved to the file browser unless the call sets `preview`; the outcome is reported in the JSON save fields and the `X-B4M-Audio-*` headers - fetch the saved copy from `fileUrl` / `X-B4M-Audio-File-Url`, since `GET /api/files/{id}` fails closed until moderation completes. Authenticate with an API key (`b4m_live_`) or a JWT.
166
+ * @description Generates speech from text using OpenAI or ElevenLabs. When the requested provider has no usable key (or the provider rejects it), another configured provider stands in and the substitution is reported via `provider`/`fallbackFrom` and the `X-B4M-Tts-Provider*` headers. Input length is capped per provider (OpenAI 4096 characters, ElevenLabs 10000), and an output `format` the chosen provider cannot produce is rejected with a 422 before any provider cost is incurred. `organization_id` picks the payer: an organization you belong to, or null for your personal credits; omitted bills your personal credits, as this endpoint always has. The default `encoding: "binary"` returns the raw audio bytes; `encoding: "base64"` returns JSON. Audio over the ~4MB response ceiling is returned by signed URL (a `303` for binary, the `delivery: "url"` variant for base64). Generated audio is saved to the file browser unless the call sets `preview`; the outcome is reported in the JSON save fields and the `X-B4M-Audio-*` headers - fetch the saved copy from `fileUrl` / `X-B4M-Audio-File-Url`, since `GET /api/files/{id}` fails closed until moderation completes. Authenticate with an API key (`b4m_live_`) or a JWT.
167
167
  */
168
168
  post: operations['synthesizeSpeech'];
169
169
  delete?: never;
@@ -204,7 +204,7 @@ interface paths {
204
204
  put?: never;
205
205
  /**
206
206
  * Generate a sound effect
207
- * @description Generates a short sound effect from a text description. Omitting `durationSeconds` lets the provider pick the length (and bills at its default); `promptInfluence` trades prompt fidelity (1) against variation (0). Credits are reserved before generation and refunded if it fails. The default `encoding: "binary"` returns the raw audio bytes; `encoding: "base64"` returns JSON. Audio over the ~4MB response ceiling is returned by signed URL (a `303` for binary, the `delivery: "url"` variant for base64). Generated audio is saved to the file browser unless the call sets `preview`; the outcome is reported in the JSON save fields and the `X-B4M-Audio-*` headers - fetch the saved copy from `fileUrl` / `X-B4M-Audio-File-Url`, since `GET /api/files/{id}` fails closed until moderation completes. Authenticate with an API key (`b4m_live_`) or a JWT.
207
+ * @description Generates a short sound effect from a text description. Omitting `durationSeconds` lets the provider pick the length (and bills at its default); `promptInfluence` trades prompt fidelity (1) against variation (0). Credits are reserved before generation and refunded if it fails. `organization_id` picks the payer: an organization you belong to, or null for your personal credits; omitted bills your home organization (or personal credits if you have none). The default `encoding: "binary"` returns the raw audio bytes; `encoding: "base64"` returns JSON. Audio over the ~4MB response ceiling is returned by signed URL (a `303` for binary, the `delivery: "url"` variant for base64). Generated audio is saved to the file browser unless the call sets `preview`; the outcome is reported in the JSON save fields and the `X-B4M-Audio-*` headers - fetch the saved copy from `fileUrl` / `X-B4M-Audio-File-Url`, since `GET /api/files/{id}` fails closed until moderation completes. Authenticate with an API key (`b4m_live_`) or a JWT.
208
208
  */
209
209
  post: operations['generateSoundEffect'];
210
210
  delete?: never;
@@ -284,7 +284,7 @@ interface paths {
284
284
  put?: never;
285
285
  /**
286
286
  * Generate an image
287
- * @description Queues an image generation and returns immediately with the quest that will carry the result - no image yet, and the call never blocks on the render. Poll `GET /api/v1/quests/{id}` until `status` is `"done"` (see the `generateImage200PollResult` schema). Omit `sessionId` to create a new session. The prompt is resolved against the session history first, so a follow-up such as "make it darker" binds to the previous image; `enhancedPrompt` reports the prompt actually sent to the model. Send `prompt_resolution: "literal"` to skip that step and have the prompt sent as written (apart from truncation to the model's prompt limit). `referenceImageFabFileIds` passes up to 15 already-uploaded images as style anchors, after the input image taken from `fabFileIds`. Only gpt-image models accept them: sending any with another model is rejected with a 400 rather than ignored. Which `size` values a model accepts, and whether it honours `background`, `seed`, `quality`, `n` and reference images, is listed per model in the `image` block of `GET /api/v1/models`. Credits are checked when the render runs, so insufficient credits arrive on the polled quest rather than as a 422. `POST /api/ai/generate-image` is a legacy alias of this endpoint. Authenticate with an API key (`b4m_live_`) or a JWT.
287
+ * @description Queues an image generation and returns immediately with the quest that will carry the result - no image yet, and the call never blocks on the render. Poll `GET /api/v1/quests/{id}` until `status` is `"done"` (see the `generateImage200PollResult` schema). Omit `sessionId` to create a new session. The prompt is resolved against the session history first, so a follow-up such as "make it darker" binds to the previous image; `enhancedPrompt` reports the prompt actually sent to the model. Send `prompt_resolution: "literal"` to skip that step and have the prompt sent as written (apart from truncation to the model's prompt limit). `referenceImageFabFileIds` passes up to 15 already-uploaded images as style anchors, after the input image taken from `fabFileIds`. Only gpt-image models accept them: sending any with another model is rejected with a 400 rather than ignored. Which `size` values a model accepts, and whether it honours `background`, `seed`, `quality`, `n` and reference images, is listed per model in the `image` block of `GET /api/v1/models`. Credits are checked when the render runs, so insufficient credits arrive on the polled quest rather than as a 422. `organization_id` is accepted as an alias of `organizationId`, for callers used to the snake_case video and music bodies; `null` bills the personal account. `POST /api/ai/generate-image` is a legacy alias of this endpoint. Authenticate with an API key (`b4m_live_`) or a JWT.
288
288
  *
289
289
  * Optional `callbackUrl`: an https URL that receives a signed POST when the quest settles (success, failure, or a stop; a failed render is `type: "error"` in the body, same as the poll). The body is the `GET /api/v1/quests/{id}` response. Headers: `X-Webhook-Event-ID` (the same on every attempt for one settlement; delivery is at-least-once, so dedupe on it, and a retried quest settles again under a new one), `X-Webhook-Delivery-ID` (unique per attempt), `X-Webhook-Timestamp` (unix seconds), `X-Webhook-Signature-256` (`sha256=` + hex HMAC-SHA256 of `<timestamp>.<raw body>` keyed with the API key's callback signing secret), and `X-Event-Type: quest.settled`. Delivery makes up to 5 attempts, retrying on a 5xx, 408, 429, timeout or network error - never on any other 4xx, and redirects are not followed; your endpoint must answer 2xx within 10 seconds. Requires API-key authentication and a signing secret on that key (returned once at key creation, or via `POST /api/user-api-keys/{id}/callback-secret`). A `callbackUrl` is rejected with a 400 when the request is not API-key authenticated, the key has no signing secret, the URL resolves to a private address, or the deployment does not deliver callbacks; a URL that is not https fails request validation with a 422. Polling still works whether or not `callbackUrl` is set.
290
290
  */
@@ -306,7 +306,7 @@ interface paths {
306
306
  put?: never;
307
307
  /**
308
308
  * Edit an image
309
- * @description Queues an edit of an existing image and returns the quest that will carry the result, before the render runs. Poll `GET /api/v1/quests/{id}` until `status` is `"done"` (see the `editImage200PollResult` schema). `image` is the URL of the source image; `fabFileIds` must name at least one file, and the first is the inpainting mask. `referenceImageFabFileIds` adds up to 15 style anchors after the source image, so the mask always applies to the source; only gpt-image models accept them, and sending any with another model is rejected with a 400 rather than ignored. Both id fields take ids from `POST /api/v1/files`: upload each file, poll `GET /api/v1/files/{id}` until `moderation_status` is `clean`, then pass its `id`. An id that is not yet `clean` fails the edit on the polled quest. `image` takes a URL rather than an id, so a source uploaded the same way is passed as its `download_url`, which must still be unexpired when the render runs. The edited image is not a file id: read it from `files[].url` on the polled quest, not from `GET /api/v1/files/{id}`. `seed` makes an edit reproducible on BFL (FLUX) models only; gpt-image and Gemini models ignore it. Credits are checked when the render runs, so insufficient credits arrive on the polled quest rather than as a 422. `POST /api/ai/edit-image` is a legacy alias of this endpoint. Authenticate with an API key (`b4m_live_`) or a JWT.
309
+ * @description Queues an edit of an existing image and returns the quest that will carry the result, before the render runs. Poll `GET /api/v1/quests/{id}` until `status` is `"done"` (see the `editImage200PollResult` schema). `image` is the URL of the source image; `fabFileIds` must name at least one file, and the first is the inpainting mask. `referenceImageFabFileIds` adds up to 15 style anchors after the source image, so the mask always applies to the source; only gpt-image models accept them, and sending any with another model is rejected with a 400 rather than ignored. Both id fields take ids from `POST /api/v1/files`: upload each file, poll `GET /api/v1/files/{id}` until `moderation_status` is `clean`, then pass its `id`. An id that is not yet `clean` fails the edit on the polled quest. `image` takes a URL rather than an id, so a source uploaded the same way is passed as its `download_url`, which must still be unexpired when the render runs. The edited image is not a file id: read it from `files[].url` on the polled quest, not from `GET /api/v1/files/{id}`. `seed` makes an edit reproducible on BFL (FLUX) models only; gpt-image and Gemini models ignore it. Credits are checked when the render runs, so insufficient credits arrive on the polled quest rather than as a 422. `organization_id` is accepted as an alias of `organizationId`, for callers used to the snake_case video and music bodies; `null` bills the personal account. `POST /api/ai/edit-image` is a legacy alias of this endpoint. Authenticate with an API key (`b4m_live_`) or a JWT.
310
310
  *
311
311
  * Optional `callbackUrl`: an https URL that receives a signed POST when the quest settles (success, failure, or a stop; a failed render is `type: "error"` in the body, same as the poll). The body is the `GET /api/v1/quests/{id}` response. Headers: `X-Webhook-Event-ID` (the same on every attempt for one settlement; delivery is at-least-once, so dedupe on it, and a retried quest settles again under a new one), `X-Webhook-Delivery-ID` (unique per attempt), `X-Webhook-Timestamp` (unix seconds), `X-Webhook-Signature-256` (`sha256=` + hex HMAC-SHA256 of `<timestamp>.<raw body>` keyed with the API key's callback signing secret), and `X-Event-Type: quest.settled`. Delivery makes up to 5 attempts, retrying on a 5xx, 408, 429, timeout or network error - never on any other 4xx, and redirects are not followed; your endpoint must answer 2xx within 10 seconds. Requires API-key authentication and a signing secret on that key (returned once at key creation, or via `POST /api/user-api-keys/{id}/callback-secret`). A `callbackUrl` is rejected with a 400 when the request is not API-key authenticated, the key has no signing secret, the URL resolves to a private address, or the deployment does not deliver callbacks; a URL that is not https fails request validation with a 422. Polling still works whether or not `callbackUrl` is set.
312
312
  */
@@ -1763,7 +1763,7 @@ interface components {
1763
1763
  * @enum {string}
1764
1764
  */
1765
1765
  reasoningEffort?: 'none' | 'minimal' | 'low' | 'medium' | 'high' | 'xhigh';
1766
- /** @description Ask a model that can think to think on this turn. On Claude, `reasoningEffort` then sets how much it thinks, and `budget_tokens` (default 16000, minimum 1024) sizes thinking on older Claude models. Ignored by models that cannot think, and on the direct Anthropic API when a json_schema `response_format` is served by a forced tool, which cannot run alongside thinking. */
1766
+ /** @description Ask a model that can think to think on this turn. On Claude, `reasoningEffort` then sets how much it thinks, and `budget_tokens` (default 16000, minimum 1024, maximum 32000) sizes thinking on older Claude models. Ignored by models that cannot think, and on the direct Anthropic API when a json_schema `response_format` is served by a forced tool, which cannot run alongside thinking. */
1767
1767
  thinking?: {
1768
1768
  enabled: boolean;
1769
1769
  budget_tokens?: number;
@@ -1816,6 +1816,19 @@ interface components {
1816
1816
  delivery?: 'inline';
1817
1817
  audio: string;
1818
1818
  };
1819
+ synthesizeSpeechResponse400: {
1820
+ error: string;
1821
+ request_id?: string;
1822
+ /**
1823
+ * @deprecated
1824
+ * @description Deprecated, sunset 2026-12-01. The `name` of whatever the server threw - usually one of our own error classes (`NotFoundError`, `UnprocessableEntityError`, ...), but on an unhandled 500 it can be a library or driver class name instead. Unstable by nature: these are internal names we rename at will, and the set is open. Documented only so the wire and this spec agree for the deprecation window; it is removed on the sunset date. Branch on the HTTP status, not on this.
1825
+ */
1826
+ name?: string;
1827
+ /** @enum {string} */
1828
+ provider?: 'openai' | 'elevenlabs';
1829
+ /** @enum {string} */
1830
+ errorCode?: 'insufficient_credits' | 'provider_not_configured' | 'provider_rejected';
1831
+ };
1819
1832
  synthesizeSpeechResponse401: {
1820
1833
  error: string;
1821
1834
  request_id?: string;
@@ -1829,6 +1842,36 @@ interface components {
1829
1842
  /** @enum {string} */
1830
1843
  errorCode?: 'insufficient_credits' | 'provider_not_configured' | 'provider_rejected';
1831
1844
  };
1845
+ synthesizeSpeechResponse403: {
1846
+ error: string;
1847
+ request_id?: string;
1848
+ /**
1849
+ * @deprecated
1850
+ * @description Deprecated, sunset 2026-12-01. The `name` of whatever the server threw - usually one of our own error classes (`NotFoundError`, `UnprocessableEntityError`, ...), but on an unhandled 500 it can be a library or driver class name instead. Unstable by nature: these are internal names we rename at will, and the set is open. Documented only so the wire and this spec agree for the deprecation window; it is removed on the sunset date. Branch on the HTTP status, not on this.
1851
+ */
1852
+ name?: string;
1853
+ /** @description API key scopes this route accepts. Holding any one of them satisfies it. */
1854
+ required_scopes?: string[];
1855
+ /** @description API key scopes this route also requires. Every one must be held, on top of `required_scopes`. */
1856
+ also_required_scopes?: string[];
1857
+ /** @enum {string} */
1858
+ errorCode?: 'billing_organization_mismatch';
1859
+ /** @enum {string} */
1860
+ provider?: 'openai' | 'elevenlabs';
1861
+ };
1862
+ synthesizeSpeechResponse404: {
1863
+ error: string;
1864
+ request_id?: string;
1865
+ /**
1866
+ * @deprecated
1867
+ * @description Deprecated, sunset 2026-12-01. The `name` of whatever the server threw - usually one of our own error classes (`NotFoundError`, `UnprocessableEntityError`, ...), but on an unhandled 500 it can be a library or driver class name instead. Unstable by nature: these are internal names we rename at will, and the set is open. Documented only so the wire and this spec agree for the deprecation window; it is removed on the sunset date. Branch on the HTTP status, not on this.
1868
+ */
1869
+ name?: string;
1870
+ /** @enum {string} */
1871
+ provider?: 'openai' | 'elevenlabs';
1872
+ /** @enum {string} */
1873
+ errorCode?: 'insufficient_credits' | 'provider_not_configured' | 'provider_rejected';
1874
+ };
1832
1875
  synthesizeSpeechResponse413: {
1833
1876
  error: string;
1834
1877
  /** @enum {string} */
@@ -1896,6 +1939,8 @@ interface components {
1896
1939
  stability?: number;
1897
1940
  similarityBoost?: number;
1898
1941
  languageCode?: string;
1942
+ /** @description The organization to bill: one you belong to, or null for your personal credits. Omitted bills your personal credits, as this endpoint always has. An organization-billed API key always bills its own organization: omit this or set it to the key's organization; any other value, null included, is rejected with a 403 (`errorCode: billing_organization_mismatch`). */
1943
+ organization_id?: string | null;
1899
1944
  /** @enum {string} */
1900
1945
  encoding?: 'binary' | 'base64';
1901
1946
  preview?: boolean;
@@ -2005,6 +2050,21 @@ interface components {
2005
2050
  delivery?: 'inline';
2006
2051
  audio: string;
2007
2052
  };
2053
+ generateSoundEffectResponse403: {
2054
+ error: string;
2055
+ request_id?: string;
2056
+ /**
2057
+ * @deprecated
2058
+ * @description Deprecated, sunset 2026-12-01. The `name` of whatever the server threw - usually one of our own error classes (`NotFoundError`, `UnprocessableEntityError`, ...), but on an unhandled 500 it can be a library or driver class name instead. Unstable by nature: these are internal names we rename at will, and the set is open. Documented only so the wire and this spec agree for the deprecation window; it is removed on the sunset date. Branch on the HTTP status, not on this.
2059
+ */
2060
+ name?: string;
2061
+ /** @description API key scopes this route accepts. Holding any one of them satisfies it. */
2062
+ required_scopes?: string[];
2063
+ /** @description API key scopes this route also requires. Every one must be held, on top of `required_scopes`. */
2064
+ also_required_scopes?: string[];
2065
+ /** @enum {string} */
2066
+ errorCode?: 'billing_organization_mismatch';
2067
+ };
2008
2068
  generateSoundEffectResponse413: {
2009
2069
  error: string;
2010
2070
  };
@@ -2036,6 +2096,8 @@ interface components {
2036
2096
  durationSeconds?: number;
2037
2097
  promptInfluence?: number;
2038
2098
  format?: string;
2099
+ /** @description The organization to bill: one you belong to, or null for your personal credits. Omitted bills your home organization, or your personal credits if you have none. An organization-billed API key always bills its own organization: omit this or set it to the key's organization; any other value, null included, is rejected with a 403 (`errorCode: billing_organization_mismatch`). */
2100
+ organization_id?: string | null;
2039
2101
  /** @enum {string} */
2040
2102
  encoding?: 'binary' | 'base64';
2041
2103
  preview?: boolean;
@@ -2114,9 +2176,9 @@ interface components {
2114
2176
  * "replaced_by": null,
2115
2177
  * "image": null,
2116
2178
  * "credits_per_1m_tokens": {
2117
- * "input": 6000,
2118
- * "output": 30000,
2119
- * "cached_input": 600
2179
+ * "input": 4000,
2180
+ * "output": 20000,
2181
+ * "cached_input": 400
2120
2182
  * }
2121
2183
  * },
2122
2184
  * {
@@ -2367,6 +2429,8 @@ interface components {
2367
2429
  /** @enum {string|null} */
2368
2430
  output_format?: 'png' | 'jpeg' | 'webp' | null;
2369
2431
  sessionName?: string;
2432
+ /** @description Alias of `organizationId`, for callers used to the snake_case video and music bodies. Sending both with different values is a 422. */
2433
+ organization_id?: string | null;
2370
2434
  /**
2371
2435
  * Format: uri
2372
2436
  * @description Optional https URL that receives one signed POST when the job settles (success or failure). Requires API-key authentication and a callback signing secret on that key. The body is the GET /api/v1/quests/{id} response. Verify it with the `X-Webhook-Signature-256` header: `sha256=` + hex HMAC-SHA256 of `<X-Webhook-Timestamp>.<raw body>` keyed with the signing secret. Polling keeps working either way.
@@ -2445,6 +2509,8 @@ interface components {
2445
2509
  questId?: string;
2446
2510
  /** @description The organization to bill: one you belong to, or null for your personal credits. Omitted bills your home organization, or your personal credits if you have none. An organization-billed API key always bills its own organization: omit this or set it to the key's organization; any other value, null included, is rejected with a 403 (`errorCode: billing_organization_mismatch`). */
2447
2511
  organizationId?: string | null;
2512
+ /** @description Alias of `organizationId`, for callers used to the snake_case video and music bodies. Sending both with different values is a 422. */
2513
+ organization_id?: string | null;
2448
2514
  /** @default [] */
2449
2515
  fabFileIds?: string[];
2450
2516
  referenceImageFabFileIds?: string[];
@@ -6162,6 +6228,29 @@ interface operations {
6162
6228
  };
6163
6229
  content?: never;
6164
6230
  };
6231
+ /** @description The billing organization could not be resolved. An organization-billed API key bills an organization that no longer exists, or one its owner is no longer a member of; re-mint the key. */
6232
+ 400: {
6233
+ headers: {
6234
+ /** @description Correlation id for this request; safe to log and quote in support requests. */
6235
+ 'X-Request-ID'?: string;
6236
+ /** @description Request quota per minute. */
6237
+ 'X-RateLimit-Limit-Minute'?: number;
6238
+ /** @description Requests remaining in the current minute. */
6239
+ 'X-RateLimit-Remaining-Minute'?: number;
6240
+ /** @description Unix epoch (seconds) when the minute window resets. */
6241
+ 'X-RateLimit-Reset-Minute'?: number;
6242
+ /** @description Request quota per day. */
6243
+ 'X-RateLimit-Limit-Day'?: number;
6244
+ /** @description Requests remaining in the current day. */
6245
+ 'X-RateLimit-Remaining-Day'?: number;
6246
+ /** @description Unix epoch (seconds) when the day window resets. */
6247
+ 'X-RateLimit-Reset-Day'?: number;
6248
+ [name: string]: unknown;
6249
+ };
6250
+ content: {
6251
+ 'application/json': components['schemas']['synthesizeSpeechResponse400'];
6252
+ };
6253
+ };
6165
6254
  /** @description Missing/invalid credentials, no provider has a usable key (`provider_not_configured`), or the provider refused the key we sent and no alternate could stand in (`provider_rejected`). */
6166
6255
  401: {
6167
6256
  headers: {
@@ -6185,15 +6274,50 @@ interface operations {
6185
6274
  'application/json': components['schemas']['synthesizeSpeechResponse401'];
6186
6275
  };
6187
6276
  };
6188
- /** @description The API key does not hold any of the required scopes. */
6277
+ /** @description The API key lacks the `ai:generate` scope (`required_scopes` names it), or the billing organization names one you do not belong to (or is not a valid id), or an organization-billed API key names any organization but its own (`errorCode: billing_organization_mismatch`). */
6189
6278
  403: {
6190
6279
  headers: {
6191
6280
  /** @description Correlation id for this request; safe to log and quote in support requests. */
6192
6281
  'X-Request-ID'?: string;
6282
+ /** @description Request quota per minute. */
6283
+ 'X-RateLimit-Limit-Minute'?: number;
6284
+ /** @description Requests remaining in the current minute. */
6285
+ 'X-RateLimit-Remaining-Minute'?: number;
6286
+ /** @description Unix epoch (seconds) when the minute window resets. */
6287
+ 'X-RateLimit-Reset-Minute'?: number;
6288
+ /** @description Request quota per day. */
6289
+ 'X-RateLimit-Limit-Day'?: number;
6290
+ /** @description Requests remaining in the current day. */
6291
+ 'X-RateLimit-Remaining-Day'?: number;
6292
+ /** @description Unix epoch (seconds) when the day window resets. */
6293
+ 'X-RateLimit-Reset-Day'?: number;
6193
6294
  [name: string]: unknown;
6194
6295
  };
6195
6296
  content: {
6196
- 'application/json': components['schemas']['ScopeForbiddenResponse'];
6297
+ 'application/json': components['schemas']['synthesizeSpeechResponse403'];
6298
+ };
6299
+ };
6300
+ /** @description A nonexistent `organization_id`, for an admin caller; for anyone else it is `403`. */
6301
+ 404: {
6302
+ headers: {
6303
+ /** @description Correlation id for this request; safe to log and quote in support requests. */
6304
+ 'X-Request-ID'?: string;
6305
+ /** @description Request quota per minute. */
6306
+ 'X-RateLimit-Limit-Minute'?: number;
6307
+ /** @description Requests remaining in the current minute. */
6308
+ 'X-RateLimit-Remaining-Minute'?: number;
6309
+ /** @description Unix epoch (seconds) when the minute window resets. */
6310
+ 'X-RateLimit-Reset-Minute'?: number;
6311
+ /** @description Request quota per day. */
6312
+ 'X-RateLimit-Limit-Day'?: number;
6313
+ /** @description Requests remaining in the current day. */
6314
+ 'X-RateLimit-Remaining-Day'?: number;
6315
+ /** @description Unix epoch (seconds) when the day window resets. */
6316
+ 'X-RateLimit-Reset-Day'?: number;
6317
+ [name: string]: unknown;
6318
+ };
6319
+ content: {
6320
+ 'application/json': components['schemas']['synthesizeSpeechResponse404'];
6197
6321
  };
6198
6322
  };
6199
6323
  /** @description The path does not serve this HTTP method. */
@@ -6655,7 +6779,7 @@ interface operations {
6655
6779
  };
6656
6780
  content?: never;
6657
6781
  };
6658
- /** @description The billing user or organization could not be resolved. */
6782
+ /** @description The billing user or organization could not be resolved. An organization-billed API key bills an organization that no longer exists, or one its owner is no longer a member of; re-mint the key. */
6659
6783
  400: {
6660
6784
  headers: {
6661
6785
  /** @description Correlation id for this request; safe to log and quote in support requests. */
@@ -6689,15 +6813,50 @@ interface operations {
6689
6813
  'application/json': components['schemas']['ErrorResponse'];
6690
6814
  };
6691
6815
  };
6692
- /** @description The API key does not hold any of the required scopes. */
6816
+ /** @description The API key lacks the `ai:generate` scope (`required_scopes` names it), or the billing organization names one you do not belong to (or is not a valid id), or an organization-billed API key names any organization but its own (`errorCode: billing_organization_mismatch`). */
6693
6817
  403: {
6694
6818
  headers: {
6695
6819
  /** @description Correlation id for this request; safe to log and quote in support requests. */
6696
6820
  'X-Request-ID'?: string;
6821
+ /** @description Request quota per minute. */
6822
+ 'X-RateLimit-Limit-Minute'?: number;
6823
+ /** @description Requests remaining in the current minute. */
6824
+ 'X-RateLimit-Remaining-Minute'?: number;
6825
+ /** @description Unix epoch (seconds) when the minute window resets. */
6826
+ 'X-RateLimit-Reset-Minute'?: number;
6827
+ /** @description Request quota per day. */
6828
+ 'X-RateLimit-Limit-Day'?: number;
6829
+ /** @description Requests remaining in the current day. */
6830
+ 'X-RateLimit-Remaining-Day'?: number;
6831
+ /** @description Unix epoch (seconds) when the day window resets. */
6832
+ 'X-RateLimit-Reset-Day'?: number;
6697
6833
  [name: string]: unknown;
6698
6834
  };
6699
6835
  content: {
6700
- 'application/json': components['schemas']['ScopeForbiddenResponse'];
6836
+ 'application/json': components['schemas']['generateSoundEffectResponse403'];
6837
+ };
6838
+ };
6839
+ /** @description A nonexistent `organization_id`, for an admin caller; for anyone else it is `403`. */
6840
+ 404: {
6841
+ headers: {
6842
+ /** @description Correlation id for this request; safe to log and quote in support requests. */
6843
+ 'X-Request-ID'?: string;
6844
+ /** @description Request quota per minute. */
6845
+ 'X-RateLimit-Limit-Minute'?: number;
6846
+ /** @description Requests remaining in the current minute. */
6847
+ 'X-RateLimit-Remaining-Minute'?: number;
6848
+ /** @description Unix epoch (seconds) when the minute window resets. */
6849
+ 'X-RateLimit-Reset-Minute'?: number;
6850
+ /** @description Request quota per day. */
6851
+ 'X-RateLimit-Limit-Day'?: number;
6852
+ /** @description Requests remaining in the current day. */
6853
+ 'X-RateLimit-Remaining-Day'?: number;
6854
+ /** @description Unix epoch (seconds) when the day window resets. */
6855
+ 'X-RateLimit-Reset-Day'?: number;
6856
+ [name: string]: unknown;
6857
+ };
6858
+ content: {
6859
+ 'application/json': components['schemas']['ErrorResponse'];
6701
6860
  };
6702
6861
  };
6703
6862
  /** @description The path does not serve this HTTP method. */
@@ -7238,7 +7397,7 @@ interface operations {
7238
7397
  'application/json': components['schemas']['ErrorResponse'];
7239
7398
  };
7240
7399
  };
7241
- /** @description Request failed validation. */
7400
+ /** @description The body is malformed, or it names the billing organization ambiguously. Both `organizationId` and `organization_id` sent with different values is a `422`; so is an empty or blank value for either (a blank is never treated as an omission, which would bill a different payer), and so is any other billing-org-shaped key such as `billing_org_id` or `payerOrgId`, which would otherwise be stripped and silently bill the caller's home organization. */
7242
7401
  422: {
7243
7402
  headers: {
7244
7403
  /** @description Correlation id for this request; safe to log and quote in support requests. */
@@ -7392,7 +7551,7 @@ interface operations {
7392
7551
  'application/json': components['schemas']['ErrorResponse'];
7393
7552
  };
7394
7553
  };
7395
- /** @description Request failed validation. */
7554
+ /** @description The body is malformed, or it names the billing organization ambiguously. Both `organizationId` and `organization_id` sent with different values is a `422`; so is an empty or blank value for either (a blank is never treated as an omission, which would bill a different payer), and so is any other billing-org-shaped key such as `billing_org_id` or `payerOrgId`, which would otherwise be stripped and silently bill the caller's home organization. */
7396
7555
  422: {
7397
7556
  headers: {
7398
7557
  /** @description Correlation id for this request; safe to log and quote in support requests. */
package/dist/index.d.mts CHANGED
@@ -163,7 +163,7 @@ interface paths {
163
163
  put?: never;
164
164
  /**
165
165
  * Synthesize speech from text
166
- * @description Generates speech from text using OpenAI or ElevenLabs. When the requested provider has no usable key (or the provider rejects it), another configured provider stands in and the substitution is reported via `provider`/`fallbackFrom` and the `X-B4M-Tts-Provider*` headers. Input length is capped per provider (OpenAI 4096 characters, ElevenLabs 10000), and an output `format` the chosen provider cannot produce is rejected with a 422 before any provider cost is incurred. The default `encoding: "binary"` returns the raw audio bytes; `encoding: "base64"` returns JSON. Audio over the ~4MB response ceiling is returned by signed URL (a `303` for binary, the `delivery: "url"` variant for base64). Generated audio is saved to the file browser unless the call sets `preview`; the outcome is reported in the JSON save fields and the `X-B4M-Audio-*` headers - fetch the saved copy from `fileUrl` / `X-B4M-Audio-File-Url`, since `GET /api/files/{id}` fails closed until moderation completes. Authenticate with an API key (`b4m_live_`) or a JWT.
166
+ * @description Generates speech from text using OpenAI or ElevenLabs. When the requested provider has no usable key (or the provider rejects it), another configured provider stands in and the substitution is reported via `provider`/`fallbackFrom` and the `X-B4M-Tts-Provider*` headers. Input length is capped per provider (OpenAI 4096 characters, ElevenLabs 10000), and an output `format` the chosen provider cannot produce is rejected with a 422 before any provider cost is incurred. `organization_id` picks the payer: an organization you belong to, or null for your personal credits; omitted bills your personal credits, as this endpoint always has. The default `encoding: "binary"` returns the raw audio bytes; `encoding: "base64"` returns JSON. Audio over the ~4MB response ceiling is returned by signed URL (a `303` for binary, the `delivery: "url"` variant for base64). Generated audio is saved to the file browser unless the call sets `preview`; the outcome is reported in the JSON save fields and the `X-B4M-Audio-*` headers - fetch the saved copy from `fileUrl` / `X-B4M-Audio-File-Url`, since `GET /api/files/{id}` fails closed until moderation completes. Authenticate with an API key (`b4m_live_`) or a JWT.
167
167
  */
168
168
  post: operations['synthesizeSpeech'];
169
169
  delete?: never;
@@ -204,7 +204,7 @@ interface paths {
204
204
  put?: never;
205
205
  /**
206
206
  * Generate a sound effect
207
- * @description Generates a short sound effect from a text description. Omitting `durationSeconds` lets the provider pick the length (and bills at its default); `promptInfluence` trades prompt fidelity (1) against variation (0). Credits are reserved before generation and refunded if it fails. The default `encoding: "binary"` returns the raw audio bytes; `encoding: "base64"` returns JSON. Audio over the ~4MB response ceiling is returned by signed URL (a `303` for binary, the `delivery: "url"` variant for base64). Generated audio is saved to the file browser unless the call sets `preview`; the outcome is reported in the JSON save fields and the `X-B4M-Audio-*` headers - fetch the saved copy from `fileUrl` / `X-B4M-Audio-File-Url`, since `GET /api/files/{id}` fails closed until moderation completes. Authenticate with an API key (`b4m_live_`) or a JWT.
207
+ * @description Generates a short sound effect from a text description. Omitting `durationSeconds` lets the provider pick the length (and bills at its default); `promptInfluence` trades prompt fidelity (1) against variation (0). Credits are reserved before generation and refunded if it fails. `organization_id` picks the payer: an organization you belong to, or null for your personal credits; omitted bills your home organization (or personal credits if you have none). The default `encoding: "binary"` returns the raw audio bytes; `encoding: "base64"` returns JSON. Audio over the ~4MB response ceiling is returned by signed URL (a `303` for binary, the `delivery: "url"` variant for base64). Generated audio is saved to the file browser unless the call sets `preview`; the outcome is reported in the JSON save fields and the `X-B4M-Audio-*` headers - fetch the saved copy from `fileUrl` / `X-B4M-Audio-File-Url`, since `GET /api/files/{id}` fails closed until moderation completes. Authenticate with an API key (`b4m_live_`) or a JWT.
208
208
  */
209
209
  post: operations['generateSoundEffect'];
210
210
  delete?: never;
@@ -284,7 +284,7 @@ interface paths {
284
284
  put?: never;
285
285
  /**
286
286
  * Generate an image
287
- * @description Queues an image generation and returns immediately with the quest that will carry the result - no image yet, and the call never blocks on the render. Poll `GET /api/v1/quests/{id}` until `status` is `"done"` (see the `generateImage200PollResult` schema). Omit `sessionId` to create a new session. The prompt is resolved against the session history first, so a follow-up such as "make it darker" binds to the previous image; `enhancedPrompt` reports the prompt actually sent to the model. Send `prompt_resolution: "literal"` to skip that step and have the prompt sent as written (apart from truncation to the model's prompt limit). `referenceImageFabFileIds` passes up to 15 already-uploaded images as style anchors, after the input image taken from `fabFileIds`. Only gpt-image models accept them: sending any with another model is rejected with a 400 rather than ignored. Which `size` values a model accepts, and whether it honours `background`, `seed`, `quality`, `n` and reference images, is listed per model in the `image` block of `GET /api/v1/models`. Credits are checked when the render runs, so insufficient credits arrive on the polled quest rather than as a 422. `POST /api/ai/generate-image` is a legacy alias of this endpoint. Authenticate with an API key (`b4m_live_`) or a JWT.
287
+ * @description Queues an image generation and returns immediately with the quest that will carry the result - no image yet, and the call never blocks on the render. Poll `GET /api/v1/quests/{id}` until `status` is `"done"` (see the `generateImage200PollResult` schema). Omit `sessionId` to create a new session. The prompt is resolved against the session history first, so a follow-up such as "make it darker" binds to the previous image; `enhancedPrompt` reports the prompt actually sent to the model. Send `prompt_resolution: "literal"` to skip that step and have the prompt sent as written (apart from truncation to the model's prompt limit). `referenceImageFabFileIds` passes up to 15 already-uploaded images as style anchors, after the input image taken from `fabFileIds`. Only gpt-image models accept them: sending any with another model is rejected with a 400 rather than ignored. Which `size` values a model accepts, and whether it honours `background`, `seed`, `quality`, `n` and reference images, is listed per model in the `image` block of `GET /api/v1/models`. Credits are checked when the render runs, so insufficient credits arrive on the polled quest rather than as a 422. `organization_id` is accepted as an alias of `organizationId`, for callers used to the snake_case video and music bodies; `null` bills the personal account. `POST /api/ai/generate-image` is a legacy alias of this endpoint. Authenticate with an API key (`b4m_live_`) or a JWT.
288
288
  *
289
289
  * Optional `callbackUrl`: an https URL that receives a signed POST when the quest settles (success, failure, or a stop; a failed render is `type: "error"` in the body, same as the poll). The body is the `GET /api/v1/quests/{id}` response. Headers: `X-Webhook-Event-ID` (the same on every attempt for one settlement; delivery is at-least-once, so dedupe on it, and a retried quest settles again under a new one), `X-Webhook-Delivery-ID` (unique per attempt), `X-Webhook-Timestamp` (unix seconds), `X-Webhook-Signature-256` (`sha256=` + hex HMAC-SHA256 of `<timestamp>.<raw body>` keyed with the API key's callback signing secret), and `X-Event-Type: quest.settled`. Delivery makes up to 5 attempts, retrying on a 5xx, 408, 429, timeout or network error - never on any other 4xx, and redirects are not followed; your endpoint must answer 2xx within 10 seconds. Requires API-key authentication and a signing secret on that key (returned once at key creation, or via `POST /api/user-api-keys/{id}/callback-secret`). A `callbackUrl` is rejected with a 400 when the request is not API-key authenticated, the key has no signing secret, the URL resolves to a private address, or the deployment does not deliver callbacks; a URL that is not https fails request validation with a 422. Polling still works whether or not `callbackUrl` is set.
290
290
  */
@@ -306,7 +306,7 @@ interface paths {
306
306
  put?: never;
307
307
  /**
308
308
  * Edit an image
309
- * @description Queues an edit of an existing image and returns the quest that will carry the result, before the render runs. Poll `GET /api/v1/quests/{id}` until `status` is `"done"` (see the `editImage200PollResult` schema). `image` is the URL of the source image; `fabFileIds` must name at least one file, and the first is the inpainting mask. `referenceImageFabFileIds` adds up to 15 style anchors after the source image, so the mask always applies to the source; only gpt-image models accept them, and sending any with another model is rejected with a 400 rather than ignored. Both id fields take ids from `POST /api/v1/files`: upload each file, poll `GET /api/v1/files/{id}` until `moderation_status` is `clean`, then pass its `id`. An id that is not yet `clean` fails the edit on the polled quest. `image` takes a URL rather than an id, so a source uploaded the same way is passed as its `download_url`, which must still be unexpired when the render runs. The edited image is not a file id: read it from `files[].url` on the polled quest, not from `GET /api/v1/files/{id}`. `seed` makes an edit reproducible on BFL (FLUX) models only; gpt-image and Gemini models ignore it. Credits are checked when the render runs, so insufficient credits arrive on the polled quest rather than as a 422. `POST /api/ai/edit-image` is a legacy alias of this endpoint. Authenticate with an API key (`b4m_live_`) or a JWT.
309
+ * @description Queues an edit of an existing image and returns the quest that will carry the result, before the render runs. Poll `GET /api/v1/quests/{id}` until `status` is `"done"` (see the `editImage200PollResult` schema). `image` is the URL of the source image; `fabFileIds` must name at least one file, and the first is the inpainting mask. `referenceImageFabFileIds` adds up to 15 style anchors after the source image, so the mask always applies to the source; only gpt-image models accept them, and sending any with another model is rejected with a 400 rather than ignored. Both id fields take ids from `POST /api/v1/files`: upload each file, poll `GET /api/v1/files/{id}` until `moderation_status` is `clean`, then pass its `id`. An id that is not yet `clean` fails the edit on the polled quest. `image` takes a URL rather than an id, so a source uploaded the same way is passed as its `download_url`, which must still be unexpired when the render runs. The edited image is not a file id: read it from `files[].url` on the polled quest, not from `GET /api/v1/files/{id}`. `seed` makes an edit reproducible on BFL (FLUX) models only; gpt-image and Gemini models ignore it. Credits are checked when the render runs, so insufficient credits arrive on the polled quest rather than as a 422. `organization_id` is accepted as an alias of `organizationId`, for callers used to the snake_case video and music bodies; `null` bills the personal account. `POST /api/ai/edit-image` is a legacy alias of this endpoint. Authenticate with an API key (`b4m_live_`) or a JWT.
310
310
  *
311
311
  * Optional `callbackUrl`: an https URL that receives a signed POST when the quest settles (success, failure, or a stop; a failed render is `type: "error"` in the body, same as the poll). The body is the `GET /api/v1/quests/{id}` response. Headers: `X-Webhook-Event-ID` (the same on every attempt for one settlement; delivery is at-least-once, so dedupe on it, and a retried quest settles again under a new one), `X-Webhook-Delivery-ID` (unique per attempt), `X-Webhook-Timestamp` (unix seconds), `X-Webhook-Signature-256` (`sha256=` + hex HMAC-SHA256 of `<timestamp>.<raw body>` keyed with the API key's callback signing secret), and `X-Event-Type: quest.settled`. Delivery makes up to 5 attempts, retrying on a 5xx, 408, 429, timeout or network error - never on any other 4xx, and redirects are not followed; your endpoint must answer 2xx within 10 seconds. Requires API-key authentication and a signing secret on that key (returned once at key creation, or via `POST /api/user-api-keys/{id}/callback-secret`). A `callbackUrl` is rejected with a 400 when the request is not API-key authenticated, the key has no signing secret, the URL resolves to a private address, or the deployment does not deliver callbacks; a URL that is not https fails request validation with a 422. Polling still works whether or not `callbackUrl` is set.
312
312
  */
@@ -1763,7 +1763,7 @@ interface components {
1763
1763
  * @enum {string}
1764
1764
  */
1765
1765
  reasoningEffort?: 'none' | 'minimal' | 'low' | 'medium' | 'high' | 'xhigh';
1766
- /** @description Ask a model that can think to think on this turn. On Claude, `reasoningEffort` then sets how much it thinks, and `budget_tokens` (default 16000, minimum 1024) sizes thinking on older Claude models. Ignored by models that cannot think, and on the direct Anthropic API when a json_schema `response_format` is served by a forced tool, which cannot run alongside thinking. */
1766
+ /** @description Ask a model that can think to think on this turn. On Claude, `reasoningEffort` then sets how much it thinks, and `budget_tokens` (default 16000, minimum 1024, maximum 32000) sizes thinking on older Claude models. Ignored by models that cannot think, and on the direct Anthropic API when a json_schema `response_format` is served by a forced tool, which cannot run alongside thinking. */
1767
1767
  thinking?: {
1768
1768
  enabled: boolean;
1769
1769
  budget_tokens?: number;
@@ -1816,6 +1816,19 @@ interface components {
1816
1816
  delivery?: 'inline';
1817
1817
  audio: string;
1818
1818
  };
1819
+ synthesizeSpeechResponse400: {
1820
+ error: string;
1821
+ request_id?: string;
1822
+ /**
1823
+ * @deprecated
1824
+ * @description Deprecated, sunset 2026-12-01. The `name` of whatever the server threw - usually one of our own error classes (`NotFoundError`, `UnprocessableEntityError`, ...), but on an unhandled 500 it can be a library or driver class name instead. Unstable by nature: these are internal names we rename at will, and the set is open. Documented only so the wire and this spec agree for the deprecation window; it is removed on the sunset date. Branch on the HTTP status, not on this.
1825
+ */
1826
+ name?: string;
1827
+ /** @enum {string} */
1828
+ provider?: 'openai' | 'elevenlabs';
1829
+ /** @enum {string} */
1830
+ errorCode?: 'insufficient_credits' | 'provider_not_configured' | 'provider_rejected';
1831
+ };
1819
1832
  synthesizeSpeechResponse401: {
1820
1833
  error: string;
1821
1834
  request_id?: string;
@@ -1829,6 +1842,36 @@ interface components {
1829
1842
  /** @enum {string} */
1830
1843
  errorCode?: 'insufficient_credits' | 'provider_not_configured' | 'provider_rejected';
1831
1844
  };
1845
+ synthesizeSpeechResponse403: {
1846
+ error: string;
1847
+ request_id?: string;
1848
+ /**
1849
+ * @deprecated
1850
+ * @description Deprecated, sunset 2026-12-01. The `name` of whatever the server threw - usually one of our own error classes (`NotFoundError`, `UnprocessableEntityError`, ...), but on an unhandled 500 it can be a library or driver class name instead. Unstable by nature: these are internal names we rename at will, and the set is open. Documented only so the wire and this spec agree for the deprecation window; it is removed on the sunset date. Branch on the HTTP status, not on this.
1851
+ */
1852
+ name?: string;
1853
+ /** @description API key scopes this route accepts. Holding any one of them satisfies it. */
1854
+ required_scopes?: string[];
1855
+ /** @description API key scopes this route also requires. Every one must be held, on top of `required_scopes`. */
1856
+ also_required_scopes?: string[];
1857
+ /** @enum {string} */
1858
+ errorCode?: 'billing_organization_mismatch';
1859
+ /** @enum {string} */
1860
+ provider?: 'openai' | 'elevenlabs';
1861
+ };
1862
+ synthesizeSpeechResponse404: {
1863
+ error: string;
1864
+ request_id?: string;
1865
+ /**
1866
+ * @deprecated
1867
+ * @description Deprecated, sunset 2026-12-01. The `name` of whatever the server threw - usually one of our own error classes (`NotFoundError`, `UnprocessableEntityError`, ...), but on an unhandled 500 it can be a library or driver class name instead. Unstable by nature: these are internal names we rename at will, and the set is open. Documented only so the wire and this spec agree for the deprecation window; it is removed on the sunset date. Branch on the HTTP status, not on this.
1868
+ */
1869
+ name?: string;
1870
+ /** @enum {string} */
1871
+ provider?: 'openai' | 'elevenlabs';
1872
+ /** @enum {string} */
1873
+ errorCode?: 'insufficient_credits' | 'provider_not_configured' | 'provider_rejected';
1874
+ };
1832
1875
  synthesizeSpeechResponse413: {
1833
1876
  error: string;
1834
1877
  /** @enum {string} */
@@ -1896,6 +1939,8 @@ interface components {
1896
1939
  stability?: number;
1897
1940
  similarityBoost?: number;
1898
1941
  languageCode?: string;
1942
+ /** @description The organization to bill: one you belong to, or null for your personal credits. Omitted bills your personal credits, as this endpoint always has. An organization-billed API key always bills its own organization: omit this or set it to the key's organization; any other value, null included, is rejected with a 403 (`errorCode: billing_organization_mismatch`). */
1943
+ organization_id?: string | null;
1899
1944
  /** @enum {string} */
1900
1945
  encoding?: 'binary' | 'base64';
1901
1946
  preview?: boolean;
@@ -2005,6 +2050,21 @@ interface components {
2005
2050
  delivery?: 'inline';
2006
2051
  audio: string;
2007
2052
  };
2053
+ generateSoundEffectResponse403: {
2054
+ error: string;
2055
+ request_id?: string;
2056
+ /**
2057
+ * @deprecated
2058
+ * @description Deprecated, sunset 2026-12-01. The `name` of whatever the server threw - usually one of our own error classes (`NotFoundError`, `UnprocessableEntityError`, ...), but on an unhandled 500 it can be a library or driver class name instead. Unstable by nature: these are internal names we rename at will, and the set is open. Documented only so the wire and this spec agree for the deprecation window; it is removed on the sunset date. Branch on the HTTP status, not on this.
2059
+ */
2060
+ name?: string;
2061
+ /** @description API key scopes this route accepts. Holding any one of them satisfies it. */
2062
+ required_scopes?: string[];
2063
+ /** @description API key scopes this route also requires. Every one must be held, on top of `required_scopes`. */
2064
+ also_required_scopes?: string[];
2065
+ /** @enum {string} */
2066
+ errorCode?: 'billing_organization_mismatch';
2067
+ };
2008
2068
  generateSoundEffectResponse413: {
2009
2069
  error: string;
2010
2070
  };
@@ -2036,6 +2096,8 @@ interface components {
2036
2096
  durationSeconds?: number;
2037
2097
  promptInfluence?: number;
2038
2098
  format?: string;
2099
+ /** @description The organization to bill: one you belong to, or null for your personal credits. Omitted bills your home organization, or your personal credits if you have none. An organization-billed API key always bills its own organization: omit this or set it to the key's organization; any other value, null included, is rejected with a 403 (`errorCode: billing_organization_mismatch`). */
2100
+ organization_id?: string | null;
2039
2101
  /** @enum {string} */
2040
2102
  encoding?: 'binary' | 'base64';
2041
2103
  preview?: boolean;
@@ -2114,9 +2176,9 @@ interface components {
2114
2176
  * "replaced_by": null,
2115
2177
  * "image": null,
2116
2178
  * "credits_per_1m_tokens": {
2117
- * "input": 6000,
2118
- * "output": 30000,
2119
- * "cached_input": 600
2179
+ * "input": 4000,
2180
+ * "output": 20000,
2181
+ * "cached_input": 400
2120
2182
  * }
2121
2183
  * },
2122
2184
  * {
@@ -2367,6 +2429,8 @@ interface components {
2367
2429
  /** @enum {string|null} */
2368
2430
  output_format?: 'png' | 'jpeg' | 'webp' | null;
2369
2431
  sessionName?: string;
2432
+ /** @description Alias of `organizationId`, for callers used to the snake_case video and music bodies. Sending both with different values is a 422. */
2433
+ organization_id?: string | null;
2370
2434
  /**
2371
2435
  * Format: uri
2372
2436
  * @description Optional https URL that receives one signed POST when the job settles (success or failure). Requires API-key authentication and a callback signing secret on that key. The body is the GET /api/v1/quests/{id} response. Verify it with the `X-Webhook-Signature-256` header: `sha256=` + hex HMAC-SHA256 of `<X-Webhook-Timestamp>.<raw body>` keyed with the signing secret. Polling keeps working either way.
@@ -2445,6 +2509,8 @@ interface components {
2445
2509
  questId?: string;
2446
2510
  /** @description The organization to bill: one you belong to, or null for your personal credits. Omitted bills your home organization, or your personal credits if you have none. An organization-billed API key always bills its own organization: omit this or set it to the key's organization; any other value, null included, is rejected with a 403 (`errorCode: billing_organization_mismatch`). */
2447
2511
  organizationId?: string | null;
2512
+ /** @description Alias of `organizationId`, for callers used to the snake_case video and music bodies. Sending both with different values is a 422. */
2513
+ organization_id?: string | null;
2448
2514
  /** @default [] */
2449
2515
  fabFileIds?: string[];
2450
2516
  referenceImageFabFileIds?: string[];
@@ -6162,6 +6228,29 @@ interface operations {
6162
6228
  };
6163
6229
  content?: never;
6164
6230
  };
6231
+ /** @description The billing organization could not be resolved. An organization-billed API key bills an organization that no longer exists, or one its owner is no longer a member of; re-mint the key. */
6232
+ 400: {
6233
+ headers: {
6234
+ /** @description Correlation id for this request; safe to log and quote in support requests. */
6235
+ 'X-Request-ID'?: string;
6236
+ /** @description Request quota per minute. */
6237
+ 'X-RateLimit-Limit-Minute'?: number;
6238
+ /** @description Requests remaining in the current minute. */
6239
+ 'X-RateLimit-Remaining-Minute'?: number;
6240
+ /** @description Unix epoch (seconds) when the minute window resets. */
6241
+ 'X-RateLimit-Reset-Minute'?: number;
6242
+ /** @description Request quota per day. */
6243
+ 'X-RateLimit-Limit-Day'?: number;
6244
+ /** @description Requests remaining in the current day. */
6245
+ 'X-RateLimit-Remaining-Day'?: number;
6246
+ /** @description Unix epoch (seconds) when the day window resets. */
6247
+ 'X-RateLimit-Reset-Day'?: number;
6248
+ [name: string]: unknown;
6249
+ };
6250
+ content: {
6251
+ 'application/json': components['schemas']['synthesizeSpeechResponse400'];
6252
+ };
6253
+ };
6165
6254
  /** @description Missing/invalid credentials, no provider has a usable key (`provider_not_configured`), or the provider refused the key we sent and no alternate could stand in (`provider_rejected`). */
6166
6255
  401: {
6167
6256
  headers: {
@@ -6185,15 +6274,50 @@ interface operations {
6185
6274
  'application/json': components['schemas']['synthesizeSpeechResponse401'];
6186
6275
  };
6187
6276
  };
6188
- /** @description The API key does not hold any of the required scopes. */
6277
+ /** @description The API key lacks the `ai:generate` scope (`required_scopes` names it), or the billing organization names one you do not belong to (or is not a valid id), or an organization-billed API key names any organization but its own (`errorCode: billing_organization_mismatch`). */
6189
6278
  403: {
6190
6279
  headers: {
6191
6280
  /** @description Correlation id for this request; safe to log and quote in support requests. */
6192
6281
  'X-Request-ID'?: string;
6282
+ /** @description Request quota per minute. */
6283
+ 'X-RateLimit-Limit-Minute'?: number;
6284
+ /** @description Requests remaining in the current minute. */
6285
+ 'X-RateLimit-Remaining-Minute'?: number;
6286
+ /** @description Unix epoch (seconds) when the minute window resets. */
6287
+ 'X-RateLimit-Reset-Minute'?: number;
6288
+ /** @description Request quota per day. */
6289
+ 'X-RateLimit-Limit-Day'?: number;
6290
+ /** @description Requests remaining in the current day. */
6291
+ 'X-RateLimit-Remaining-Day'?: number;
6292
+ /** @description Unix epoch (seconds) when the day window resets. */
6293
+ 'X-RateLimit-Reset-Day'?: number;
6193
6294
  [name: string]: unknown;
6194
6295
  };
6195
6296
  content: {
6196
- 'application/json': components['schemas']['ScopeForbiddenResponse'];
6297
+ 'application/json': components['schemas']['synthesizeSpeechResponse403'];
6298
+ };
6299
+ };
6300
+ /** @description A nonexistent `organization_id`, for an admin caller; for anyone else it is `403`. */
6301
+ 404: {
6302
+ headers: {
6303
+ /** @description Correlation id for this request; safe to log and quote in support requests. */
6304
+ 'X-Request-ID'?: string;
6305
+ /** @description Request quota per minute. */
6306
+ 'X-RateLimit-Limit-Minute'?: number;
6307
+ /** @description Requests remaining in the current minute. */
6308
+ 'X-RateLimit-Remaining-Minute'?: number;
6309
+ /** @description Unix epoch (seconds) when the minute window resets. */
6310
+ 'X-RateLimit-Reset-Minute'?: number;
6311
+ /** @description Request quota per day. */
6312
+ 'X-RateLimit-Limit-Day'?: number;
6313
+ /** @description Requests remaining in the current day. */
6314
+ 'X-RateLimit-Remaining-Day'?: number;
6315
+ /** @description Unix epoch (seconds) when the day window resets. */
6316
+ 'X-RateLimit-Reset-Day'?: number;
6317
+ [name: string]: unknown;
6318
+ };
6319
+ content: {
6320
+ 'application/json': components['schemas']['synthesizeSpeechResponse404'];
6197
6321
  };
6198
6322
  };
6199
6323
  /** @description The path does not serve this HTTP method. */
@@ -6655,7 +6779,7 @@ interface operations {
6655
6779
  };
6656
6780
  content?: never;
6657
6781
  };
6658
- /** @description The billing user or organization could not be resolved. */
6782
+ /** @description The billing user or organization could not be resolved. An organization-billed API key bills an organization that no longer exists, or one its owner is no longer a member of; re-mint the key. */
6659
6783
  400: {
6660
6784
  headers: {
6661
6785
  /** @description Correlation id for this request; safe to log and quote in support requests. */
@@ -6689,15 +6813,50 @@ interface operations {
6689
6813
  'application/json': components['schemas']['ErrorResponse'];
6690
6814
  };
6691
6815
  };
6692
- /** @description The API key does not hold any of the required scopes. */
6816
+ /** @description The API key lacks the `ai:generate` scope (`required_scopes` names it), or the billing organization names one you do not belong to (or is not a valid id), or an organization-billed API key names any organization but its own (`errorCode: billing_organization_mismatch`). */
6693
6817
  403: {
6694
6818
  headers: {
6695
6819
  /** @description Correlation id for this request; safe to log and quote in support requests. */
6696
6820
  'X-Request-ID'?: string;
6821
+ /** @description Request quota per minute. */
6822
+ 'X-RateLimit-Limit-Minute'?: number;
6823
+ /** @description Requests remaining in the current minute. */
6824
+ 'X-RateLimit-Remaining-Minute'?: number;
6825
+ /** @description Unix epoch (seconds) when the minute window resets. */
6826
+ 'X-RateLimit-Reset-Minute'?: number;
6827
+ /** @description Request quota per day. */
6828
+ 'X-RateLimit-Limit-Day'?: number;
6829
+ /** @description Requests remaining in the current day. */
6830
+ 'X-RateLimit-Remaining-Day'?: number;
6831
+ /** @description Unix epoch (seconds) when the day window resets. */
6832
+ 'X-RateLimit-Reset-Day'?: number;
6697
6833
  [name: string]: unknown;
6698
6834
  };
6699
6835
  content: {
6700
- 'application/json': components['schemas']['ScopeForbiddenResponse'];
6836
+ 'application/json': components['schemas']['generateSoundEffectResponse403'];
6837
+ };
6838
+ };
6839
+ /** @description A nonexistent `organization_id`, for an admin caller; for anyone else it is `403`. */
6840
+ 404: {
6841
+ headers: {
6842
+ /** @description Correlation id for this request; safe to log and quote in support requests. */
6843
+ 'X-Request-ID'?: string;
6844
+ /** @description Request quota per minute. */
6845
+ 'X-RateLimit-Limit-Minute'?: number;
6846
+ /** @description Requests remaining in the current minute. */
6847
+ 'X-RateLimit-Remaining-Minute'?: number;
6848
+ /** @description Unix epoch (seconds) when the minute window resets. */
6849
+ 'X-RateLimit-Reset-Minute'?: number;
6850
+ /** @description Request quota per day. */
6851
+ 'X-RateLimit-Limit-Day'?: number;
6852
+ /** @description Requests remaining in the current day. */
6853
+ 'X-RateLimit-Remaining-Day'?: number;
6854
+ /** @description Unix epoch (seconds) when the day window resets. */
6855
+ 'X-RateLimit-Reset-Day'?: number;
6856
+ [name: string]: unknown;
6857
+ };
6858
+ content: {
6859
+ 'application/json': components['schemas']['ErrorResponse'];
6701
6860
  };
6702
6861
  };
6703
6862
  /** @description The path does not serve this HTTP method. */
@@ -7238,7 +7397,7 @@ interface operations {
7238
7397
  'application/json': components['schemas']['ErrorResponse'];
7239
7398
  };
7240
7399
  };
7241
- /** @description Request failed validation. */
7400
+ /** @description The body is malformed, or it names the billing organization ambiguously. Both `organizationId` and `organization_id` sent with different values is a `422`; so is an empty or blank value for either (a blank is never treated as an omission, which would bill a different payer), and so is any other billing-org-shaped key such as `billing_org_id` or `payerOrgId`, which would otherwise be stripped and silently bill the caller's home organization. */
7242
7401
  422: {
7243
7402
  headers: {
7244
7403
  /** @description Correlation id for this request; safe to log and quote in support requests. */
@@ -7392,7 +7551,7 @@ interface operations {
7392
7551
  'application/json': components['schemas']['ErrorResponse'];
7393
7552
  };
7394
7553
  };
7395
- /** @description Request failed validation. */
7554
+ /** @description The body is malformed, or it names the billing organization ambiguously. Both `organizationId` and `organization_id` sent with different values is a `422`; so is an empty or blank value for either (a blank is never treated as an omission, which would bill a different payer), and so is any other billing-org-shaped key such as `billing_org_id` or `payerOrgId`, which would otherwise be stripped and silently bill the caller's home organization. */
7396
7555
  422: {
7397
7556
  headers: {
7398
7557
  /** @description Correlation id for this request; safe to log and quote in support requests. */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bike4mind/sdk",
3
- "version": "1.1.0",
3
+ "version": "1.1.2",
4
4
  "description": "Typed client for the Bike4Mind HTTP API, generated from its OpenAPI spec",
5
5
  "license": "BUSL-1.1",
6
6
  "author": "Bike4Mind",