codai-sdk 0.67.0 → 0.68.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/index.d.ts CHANGED
@@ -5157,7 +5157,7 @@ type paths$1 = {
5157
5157
  * `GET /v1/studio/renders/{id}` with the returned `render_id`; the render reports `creative_id`. Billed like
5158
5158
  * `POST /v1/studio/renders`, once, when it has succeeded. The format must be 1920×1080, 1080×1920 or 1080×1080
5159
5159
  * (400 `unsupported_format`); every referenced asset must be yours and ready (400 `asset_not_found`). Video
5160
- * creatives only for now.
5160
+ * creatives; an `audio` creative renders a mixdown instead (see below).
5161
5161
  *
5162
5162
  * Renders are composed from per-scene segments: scenes unchanged since an earlier render are reused (the charge
5163
5163
  * is still per second of output). When the same render already exists for this exact version, format, quality and
@@ -5168,6 +5168,13 @@ type paths$1 = {
5168
5168
  * When omitted it is `corner` if the render uses TTS narration (synthetic voice) or AI-generated images, else
5169
5169
  * `none`; an explicit `none` with TTS narration is rejected (400 `ai_label_required`). The response returns the
5170
5170
  * resolved `ai_label`. As the deployer you remain responsible for labelling deepfakes you publish.
5171
+ *
5172
+ * **Audio creatives** (`kind: audio`) take `CreativeAudioRenderRequest`: `formats` (`wav` / `mp3` / `flac`,
5173
+ * default WAV + MP3), `stems` (one WAV per audible track), `lrc` and `loudness` (preset or LUFS). The document is
5174
+ * mixed with ffmpeg, mastered to the loudness target (two-pass loudnorm + true-peak limiter) and every output is
5175
+ * AI-marked in the file (RIFF ICMT / ID3v2.4 / Vorbis comment). The 202 is a `CreativeAudioRenderAccepted`; poll
5176
+ * `GET /v1/studio/renders/{id}`, whose `data[]` holds one signed asset per output. Price: 1 000 µUSD per output
5177
+ * second (minimum 10 000 µUSD), `stems: true` adds 50 %; at most 20 minutes per render.
5171
5178
  * Places a wallet hold of the quote before dispatch (402 `insufficient_funds` when short); the hold is settled with the billed amount when the job finishes and released on failure.
5172
5179
  * Supports `Idempotency-Key` (24 h): a retry with the same key and body replays the first response; a different body is 422 `idempotency_key_mismatch`; the first request still running is 409 `idempotency_in_progress`.
5173
5180
  */
@@ -5706,6 +5713,150 @@ type paths$1 = {
5706
5713
  readonly patch?: never;
5707
5714
  readonly trace?: never;
5708
5715
  };
5716
+ readonly '/v1/studio/lyrics': {
5717
+ readonly parameters: {
5718
+ readonly query?: never;
5719
+ readonly header?: never;
5720
+ readonly path?: never;
5721
+ readonly cookie?: never;
5722
+ };
5723
+ readonly get?: never;
5724
+ readonly put?: never;
5725
+ /**
5726
+ * Write song lyrics
5727
+ * @description Writes original song lyrics for a brief in Romanian or English: one bounded `codai` turn with a forced tool,
5728
+ * checked line by line for syllables (`syllables_per_line`, tolerance ±1) and the rhyme scheme (`AABB`, `ABAB` or
5729
+ * `free`). When more than 30 % of the lines miss, ONE repair turn names the problems and the better of the two answers
5730
+ * is returned (`repaired`). Billing: token-metered (usage model `codai::lyrics`, prompt caching on) under a small
5731
+ * wallet hold (20 000 µUSD, settled with the real cost; 402 `insufficient_funds` when short). Briefs and lyrics are
5732
+ * never logged. Supports `Idempotency-Key` (24 h).
5733
+ */
5734
+ readonly post: operations$1['writeStudioLyrics'];
5735
+ readonly delete?: never;
5736
+ readonly options?: never;
5737
+ readonly head?: never;
5738
+ readonly patch?: never;
5739
+ readonly trace?: never;
5740
+ };
5741
+ readonly '/v1/studio/lyrics/align': {
5742
+ readonly parameters: {
5743
+ readonly query?: never;
5744
+ readonly header?: never;
5745
+ readonly path?: never;
5746
+ readonly cookie?: never;
5747
+ };
5748
+ readonly get?: never;
5749
+ readonly put?: never;
5750
+ /**
5751
+ * Align lyrics to an audio clip
5752
+ * @description Karaoke alignment: matches written lyrics to the word timestamps of one clip of an audio (or video) creative and
5753
+ * writes the timed lines with one `setLyrics` edit (`apply: false` only returns them), plus an LRC file. The clip's
5754
+ * words come from the transcription cached on its asset (free, `cached: true`); otherwise the clip is transcribed
5755
+ * (Whisper, at most 25 MB) and billed `codai::lyrics-align` at the speech-to-text rate (6 000 µUSD per started minute)
5756
+ * under a wallet hold. Not available for EU data-residency accounts (403 `residency_unavailable`). Supports
5757
+ * `Idempotency-Key` (24 h).
5758
+ */
5759
+ readonly post: operations$1['alignStudioLyrics'];
5760
+ readonly delete?: never;
5761
+ readonly options?: never;
5762
+ readonly head?: never;
5763
+ readonly patch?: never;
5764
+ readonly trace?: never;
5765
+ };
5766
+ readonly '/v1/studio/media-ops': {
5767
+ readonly parameters: {
5768
+ readonly query?: never;
5769
+ readonly header?: never;
5770
+ readonly path?: never;
5771
+ readonly cookie?: never;
5772
+ };
5773
+ /**
5774
+ * List media operations
5775
+ * @description The media-op catalogue: one entry per op (`image.remove_background`, `audio.separate_stems`,
5776
+ * `music.generate_ace`…) with its engine, lane, sync/async mode, accepted inputs, output kind, whether the lane is
5777
+ * configured on this gateway (`available`) and a list quote for a reference input (default params, 60 s of input
5778
+ * audio or a 1024×1024 image; `quote_basis`). Free. Ask `POST /v1/studio/media-ops/{op}/quote` for the exact price
5779
+ * of a real request.
5780
+ */
5781
+ readonly get: operations$1['listStudioMediaOps'];
5782
+ readonly put?: never;
5783
+ readonly post?: never;
5784
+ readonly delete?: never;
5785
+ readonly options?: never;
5786
+ readonly head?: never;
5787
+ readonly patch?: never;
5788
+ readonly trace?: never;
5789
+ };
5790
+ readonly '/v1/studio/media-ops/{op}': {
5791
+ readonly parameters: {
5792
+ readonly query?: never;
5793
+ readonly header?: never;
5794
+ readonly path?: never;
5795
+ readonly cookie?: never;
5796
+ };
5797
+ readonly get?: never;
5798
+ readonly put?: never;
5799
+ /**
5800
+ * Run a media operation
5801
+ * @description Runs one op on your Studio assets: `asset_ids` (0–4 owned, ready assets, in the order the op expects) and
5802
+ * `params` (validated strictly per op, see `MediaOpRequest`). Sync ops (`mode: sync`: background removal,
5803
+ * upscale, inpaint / outpaint / erase, analyze) answer **200** with the stored outputs; async ops (stems, denoise,
5804
+ * MIDI, mastering, music and sound-effect generation) answer **202** with a job — poll
5805
+ * `GET /v1/studio/media-ops/jobs/{id}`; the sweeper settles it even when nobody polls. At most 3 async jobs run per
5806
+ * user (429 beyond). Money gate: the quote is held on the wallet first (402 `insufficient_funds` when it does not
5807
+ * fit), the measured cost is billed once and the rest of the hold released. Every output is marked as
5808
+ * AI-generated (C2PA / XMP on images, RIFF INFO / ID3 on audio, GCS metadata) and carries lineage:
5809
+ * `parent_asset_id` = the first input, `op` and `op_inputs`. Supports `Idempotency-Key`.
5810
+ */
5811
+ readonly post: operations$1['runStudioMediaOp'];
5812
+ readonly delete?: never;
5813
+ readonly options?: never;
5814
+ readonly head?: never;
5815
+ readonly patch?: never;
5816
+ readonly trace?: never;
5817
+ };
5818
+ readonly '/v1/studio/media-ops/{op}/quote': {
5819
+ readonly parameters: {
5820
+ readonly query?: never;
5821
+ readonly header?: never;
5822
+ readonly path?: never;
5823
+ readonly cookie?: never;
5824
+ };
5825
+ readonly get?: never;
5826
+ readonly put?: never;
5827
+ /**
5828
+ * Quote a media operation
5829
+ * @description The exact price of `{ asset_ids, params }` for one op, after the same validation as the run (op id, params,
5830
+ * asset ownership, kinds and mimes, lane configured). Nothing is held or billed. `quote_micro_eur` is what the
5831
+ * wallet hold would be; the run bills the measured cost, never more than the quote.
5832
+ */
5833
+ readonly post: operations$1['quoteStudioMediaOp'];
5834
+ readonly delete?: never;
5835
+ readonly options?: never;
5836
+ readonly head?: never;
5837
+ readonly patch?: never;
5838
+ readonly trace?: never;
5839
+ };
5840
+ readonly '/v1/studio/media-ops/jobs/{id}': {
5841
+ readonly parameters: {
5842
+ readonly query?: never;
5843
+ readonly header?: never;
5844
+ readonly path?: never;
5845
+ readonly cookie?: never;
5846
+ };
5847
+ /**
5848
+ * Retrieve a media job
5849
+ * @description The state of an async media job; a pending job whose result is ready is settled on the spot (outputs stored, billed once). Unknown or foreign ids are 404.
5850
+ */
5851
+ readonly get: operations$1['getStudioMediaOpJob'];
5852
+ readonly put?: never;
5853
+ readonly post?: never;
5854
+ readonly delete?: never;
5855
+ readonly options?: never;
5856
+ readonly head?: never;
5857
+ readonly patch?: never;
5858
+ readonly trace?: never;
5859
+ };
5709
5860
  readonly '/v1/studio/previews/{id}': {
5710
5861
  readonly parameters: {
5711
5862
  readonly query?: never;
@@ -5862,6 +6013,9 @@ type paths$1 = {
5862
6013
  * Timeline renders (`POST /v1/studio/timelines`) also return `timeline` (scenes with their assets),
5863
6014
  * `parent_render_id` and `root_render_id`; while a regenerated video scene is still being generated the render
5864
6015
  * stays `queued` with `stage: generating_scene`.
6016
+ *
6017
+ * Audio creative renders (`target: audio`) answer `StudioAudioRender`: `data` holds one asset per output
6018
+ * (`output`: `mix` / `stem` / `lrc`, `format`, `track_id`), `qa` the measured loudness and true peak.
5865
6019
  */
5866
6020
  readonly get: operations$1['getRender'];
5867
6021
  readonly put?: never;
@@ -9806,6 +9960,223 @@ type components$1 = {
9806
9960
  readonly seq: number;
9807
9961
  readonly warnings: readonly string[];
9808
9962
  };
9963
+ /**
9964
+ * Creative audio part
9965
+ * @description `doc.audio`: the audio timeline of every creative (voice / music / sfx tracks of a video) and the whole document
9966
+ * of an `audio` creative (song or podcast). Milliseconds are the source of truth; bars and beats are derived from
9967
+ * `meta.bpm` / `meta.timeSignature`. Every field but `tracks` is optional.
9968
+ */
9969
+ readonly CreativeAudio: {
9970
+ /** @description Human-contribution log of an `audio` creative, appended by the server for each edit (who: `human` or `ai`). */
9971
+ readonly humanLog?: readonly {
9972
+ /** @enum {string} */
9973
+ readonly actor: 'human' | 'ai';
9974
+ readonly detail?: string;
9975
+ readonly op: string;
9976
+ /** Format: date-time */
9977
+ readonly ts: string;
9978
+ }[];
9979
+ /** @description Timed lyric lines (exported as LRC). */
9980
+ readonly lyrics?: readonly {
9981
+ readonly endMs: number;
9982
+ readonly sectionId?: string;
9983
+ readonly startMs: number;
9984
+ readonly text: string;
9985
+ }[];
9986
+ /** @description Master bus. Unset fields resolve to `meta.loudnessTarget` (or -14 LUFS) and a -1 dBTP true peak. */
9987
+ readonly master?: {
9988
+ readonly fx?: readonly components$1['schemas']['CreativeAudioFx'][];
9989
+ readonly limiter?: boolean;
9990
+ readonly targetLufs?: number;
9991
+ readonly truePeakDb?: number;
9992
+ };
9993
+ /** @description Song / episode metadata. */
9994
+ readonly meta?: {
9995
+ readonly bpm?: number;
9996
+ readonly key?: {
9997
+ /** @enum {string} */
9998
+ readonly mode: 'major' | 'minor';
9999
+ /** @enum {string} */
10000
+ readonly tonic: 'C' | 'C#' | 'Db' | 'D' | 'D#' | 'Eb' | 'E' | 'F' | 'F#' | 'Gb' | 'G' | 'G#' | 'Ab' | 'A' | 'A#' | 'Bb' | 'B';
10001
+ };
10002
+ readonly language?: string;
10003
+ /** @description `streaming` (-14 LUFS), `podcast` (-16), `broadcast` (-23) or an integrated LUFS number (-40…-5). */
10004
+ readonly loudnessTarget?: ('streaming' | 'podcast' | 'broadcast') | number;
10005
+ /** @enum {integer} */
10006
+ readonly sampleRate?: 44100 | 48000;
10007
+ /** @description `[beats per bar, beat unit]`, e.g. `[4, 4]`. */
10008
+ readonly timeSignature?: readonly number[];
10009
+ };
10010
+ readonly sections?: readonly components$1['schemas']['CreativeAudioSection'][];
10011
+ readonly tracks: readonly components$1['schemas']['CreativeAudioTrack'][];
10012
+ };
10013
+ /**
10014
+ * Creative audio clip
10015
+ * @description One clip of an audio asset on a track. `inMs` / `outMs` are SOURCE offsets: the clip ends on the timeline at `startMs + (outMs - inMs) × stretch`.
10016
+ */
10017
+ readonly CreativeAudioClip: {
10018
+ /** @description Studio asset id (uuid). */
10019
+ readonly assetId: string;
10020
+ readonly color?: string;
10021
+ /** @description Duck under voice / vocal tracks (default on for music tracks of an `audio` creative). */
10022
+ readonly duck?: boolean;
10023
+ /** @enum {string} */
10024
+ readonly fadeCurve?: 'linear' | 'exp' | 's';
10025
+ readonly fadeInMs?: number;
10026
+ readonly fadeOutMs?: number;
10027
+ readonly gainDb?: number;
10028
+ /** @description How the clip was generated (public codai provider / model ids, never an upstream name). */
10029
+ readonly generation?: {
10030
+ readonly model: string;
10031
+ readonly op?: string;
10032
+ readonly parentClipId?: string;
10033
+ readonly prompt?: string;
10034
+ readonly provider: string;
10035
+ readonly seed?: number;
10036
+ };
10037
+ readonly id: string;
10038
+ readonly inMs?: number;
10039
+ readonly locked?: boolean;
10040
+ readonly loop?: boolean;
10041
+ readonly outMs?: number;
10042
+ readonly pan?: number;
10043
+ readonly pitchSemitones?: number;
10044
+ readonly startMs: number;
10045
+ /** @description Timeline length / source length (pitch kept). */
10046
+ readonly stretch?: number;
10047
+ };
10048
+ /** Creative audio effect */
10049
+ readonly CreativeAudioFx: {
10050
+ readonly bypass?: boolean;
10051
+ readonly id: string;
10052
+ /** @description Numeric effect parameters by name (`threshold`, `ratio`, `mix`…). */
10053
+ readonly params: {
10054
+ readonly [key: string]: number;
10055
+ };
10056
+ /** @enum {string} */
10057
+ readonly type: 'eq' | 'compressor' | 'reverb' | 'delay' | 'limiter' | 'gate' | 'deesser' | 'pitch' | 'chorus' | 'saturation';
10058
+ };
10059
+ /** Queued audio render */
10060
+ readonly CreativeAudioRenderAccepted: {
10061
+ /** @enum {boolean} */
10062
+ readonly cached: false;
10063
+ /** Format: uuid */
10064
+ readonly creative_id: string;
10065
+ readonly duration_seconds: number;
10066
+ readonly formats: readonly ('wav' | 'mp3' | 'flac')[];
10067
+ /** Format: uuid */
10068
+ readonly id: string;
10069
+ readonly lrc: boolean;
10070
+ readonly minimum_micro_usd: string;
10071
+ readonly model: string;
10072
+ /** @enum {string} */
10073
+ readonly object: 'studio.render';
10074
+ /** @description The files this render will produce, in result order: mixes, stems, LRC. */
10075
+ readonly outputs: readonly components$1['schemas']['CreativeAudioRenderOutput'][];
10076
+ readonly price_micro_usd_per_second: string;
10077
+ /** @description The amount held on the wallet (micro-USD); the bill uses the measured length. */
10078
+ readonly quote_micro_usd: string;
10079
+ /**
10080
+ * Format: uuid
10081
+ * @description Poll it with `GET /v1/studio/renders/{id}`.
10082
+ */
10083
+ readonly render_id: string;
10084
+ readonly seq: number;
10085
+ /** @enum {string} */
10086
+ readonly status: 'queued';
10087
+ readonly stems: boolean;
10088
+ readonly stems_surcharge_pct: number;
10089
+ /** @enum {string} */
10090
+ readonly target: 'audio';
10091
+ readonly target_lufs: number;
10092
+ readonly true_peak_db: number;
10093
+ };
10094
+ readonly CreativeAudioRenderOutput: {
10095
+ /** @enum {string} */
10096
+ readonly format: 'wav' | 'mp3' | 'flac' | 'lrc';
10097
+ /** @enum {string} */
10098
+ readonly kind: 'mix' | 'stem' | 'lrc';
10099
+ readonly mime_type: string;
10100
+ /** @description The track of a stem; null for the mix and the LRC. */
10101
+ readonly track_id: string | null;
10102
+ };
10103
+ /**
10104
+ * Audio creative render request
10105
+ * @description Body of `POST /v1/studio/creatives/{id}/render` for a creative of `kind: audio` (mixdown + mastering + exports).
10106
+ * Any other kind uses `CreativeRenderRequest`.
10107
+ */
10108
+ readonly CreativeAudioRenderRequest: {
10109
+ /**
10110
+ * @default [
10111
+ * "wav",
10112
+ * "mp3"
10113
+ * ]
10114
+ */
10115
+ readonly formats?: readonly ('wav' | 'mp3' | 'flac')[];
10116
+ /** @description Mastering target: a preset (streaming -14, podcast -16, broadcast -23 LUFS) or integrated LUFS (-40...-5). Default the document master or meta.loudnessTarget, else -14. */
10117
+ readonly loudness?: ('streaming' | 'podcast' | 'broadcast') | number;
10118
+ /** @description Export an LRC file (default on when the document has timed lyrics; true without lyrics is 400 `no_lyrics`). */
10119
+ readonly lrc?: boolean;
10120
+ /**
10121
+ * @description Also export one WAV stem per audible track (+50 % price).
10122
+ * @default false
10123
+ */
10124
+ readonly stems?: boolean;
10125
+ readonly title?: string;
10126
+ };
10127
+ /** Creative audio section */
10128
+ readonly CreativeAudioSection: {
10129
+ readonly durationMs: number;
10130
+ readonly id: string;
10131
+ /** @enum {string} */
10132
+ readonly kind: 'intro' | 'verse' | 'pre_chorus' | 'chorus' | 'bridge' | 'outro' | 'instrumental' | 'custom';
10133
+ readonly label?: string;
10134
+ readonly locked?: boolean;
10135
+ readonly lyrics?: string;
10136
+ readonly startMs: number;
10137
+ readonly styleHint?: string;
10138
+ };
10139
+ /** Creative audio track */
10140
+ readonly CreativeAudioTrack: {
10141
+ /** @description Breakpoint envelopes; `target` is `gainDb`, `pan` or `fx.<fxId>.<param>`. */
10142
+ readonly automation?: readonly {
10143
+ readonly points: readonly {
10144
+ readonly tMs: number;
10145
+ readonly value: number;
10146
+ }[];
10147
+ readonly target: string;
10148
+ }[];
10149
+ readonly clips: readonly components$1['schemas']['CreativeAudioClip'][];
10150
+ readonly fx?: readonly components$1['schemas']['CreativeAudioFx'][];
10151
+ readonly gainDb?: number;
10152
+ readonly id: string;
10153
+ /**
10154
+ * @description Absent = `audio`. MIDI tracks hold `midiClips` only; buses hold no clips.
10155
+ * @enum {string}
10156
+ */
10157
+ readonly kind?: 'audio' | 'midi' | 'bus';
10158
+ readonly locked?: boolean;
10159
+ readonly midiClips?: readonly ({
10160
+ readonly durationMs: number;
10161
+ readonly id: string;
10162
+ readonly notes: readonly {
10163
+ readonly [key: string]: unknown;
10164
+ }[];
10165
+ readonly startMs: number;
10166
+ } & {
10167
+ readonly [key: string]: unknown;
10168
+ })[];
10169
+ readonly mute?: boolean;
10170
+ readonly name?: string;
10171
+ readonly pan?: number;
10172
+ /** @enum {string} */
10173
+ readonly role: 'voice' | 'music' | 'sfx' | 'drums' | 'bass' | 'keys' | 'guitar' | 'vocal' | 'lead' | 'pad' | 'fx' | 'bus' | 'podcast_host' | 'podcast_guest';
10174
+ readonly sends?: readonly {
10175
+ readonly busId: string;
10176
+ readonly gainDb: number;
10177
+ }[];
10178
+ readonly solo?: boolean;
10179
+ };
9809
10180
  /**
9810
10181
  * Creative build request
9811
10182
  * @example {
@@ -10054,10 +10425,8 @@ type components$1 = {
10054
10425
  readonly assets: {
10055
10426
  readonly [key: string]: unknown;
10056
10427
  };
10057
- /** @description `{ tracks: [{ id, role: voice | music | sfx, clips[] }] }`. */
10058
- readonly audio: {
10059
- readonly [key: string]: unknown;
10060
- };
10428
+ /** @description Audio timeline: `{ tracks[], meta?, sections?, master?, lyrics?, humanLog? }` (see `CreativeAudio`). */
10429
+ readonly audio: components$1['schemas']['CreativeAudio'];
10061
10430
  /** @description `{ kitId?, tokens }`; nodes reference tokens as `{ "$token": "primary" }`. */
10062
10431
  readonly brand: {
10063
10432
  readonly [key: string]: unknown;
@@ -10114,7 +10483,7 @@ type components$1 = {
10114
10483
  readonly CreativeError: {
10115
10484
  readonly error: {
10116
10485
  /** @enum {string} */
10117
- readonly code: 'invalid_request' | 'stale' | 'invalid' | 'not_found' | 'locked' | 'duplicate_id' | 'too_large' | 'not_supported_for_kind' | 'unsupported_format' | 'asset_not_found' | 'not_implemented' | 'frame_failed' | 'too_many_frame_jobs' | 'no_edit' | 'timeout' | 'fetch_failed' | 'extract_failed' | 'kind_mismatch' | 'node_not_found' | 'invalid_pick' | 'duplicate_key' | 'unknown_var' | 'invalid_var_value' | 'unsupported_kind' | 'too_long' | 'ai_label_required';
10486
+ readonly code: 'invalid_request' | 'stale' | 'invalid' | 'not_found' | 'locked' | 'duplicate_id' | 'too_large' | 'not_supported_for_kind' | 'unsupported_format' | 'asset_not_found' | 'not_implemented' | 'frame_failed' | 'too_many_frame_jobs' | 'no_edit' | 'timeout' | 'fetch_failed' | 'extract_failed' | 'kind_mismatch' | 'node_not_found' | 'invalid_pick' | 'duplicate_key' | 'unknown_var' | 'invalid_var_value' | 'unsupported_kind' | 'too_long' | 'ai_label_required' | 'no_lyrics' | 'unsupported_media';
10118
10487
  readonly conflicts?: readonly {
10119
10488
  readonly head_prop?: string;
10120
10489
  readonly prop?: string;
@@ -10239,7 +10608,7 @@ type components$1 = {
10239
10608
  * Creative kind
10240
10609
  * @enum {string}
10241
10610
  */
10242
- readonly CreativeKind: 'video' | 'image' | 'deck' | 'doc' | 'sheet';
10611
+ readonly CreativeKind: 'video' | 'image' | 'deck' | 'doc' | 'sheet' | 'audio';
10243
10612
  /**
10244
10613
  * Lint code
10245
10614
  * @description `off_brand_color`, `outside_platform_safe_zone`, `text_too_small`, `flashing` (keyframes) and `text_overflow_locale` (the text shrinks to fit) can be fixed with `POST /v1/studio/creatives/{id}/lint/fix`. `missing_translation` and `stale_translation` are fixed with `POST /v1/studio/creatives/{id}/localize`.
@@ -10556,6 +10925,14 @@ type components$1 = {
10556
10925
  * (`control: null` clears it), `setMeta { title?, locale?, formats?, defaultFormat?, fps? }`,
10557
10926
  * `setLocaleText { locale, texts, by? }` (`texts`: unit key → translation, `null` removes it),
10558
10927
  * `setLocale { locale, tone?, audio?, captions?, remove? }`, `setLocalization { source?, glossary?, forkOf?, reset? }`.
10928
+ * Audio ops (any creative's `doc.audio`; songs and podcasts): `addSection { section }`, `updateSection { target, patch }`,
10929
+ * `removeSection { target }`, `moveSection { target, startMs }`, `addTrack { track, index? }`,
10930
+ * `updateTrack { target, patch }`, `removeTrack { target }`, `splitClip { clipId, atMs, newId }`,
10931
+ * `trimClip { clipId, startMs?, endMs? }`, `moveClip { clipId, startMs?, trackId? }`,
10932
+ * `setFades { clipId, fadeInMs?, fadeOutMs?, fadeCurve? }`, `addMidiClip { trackId, clip }`, `removeMidiClip { clipId }`,
10933
+ * `updateMidiNotes { clipId, update?, remove?, add?, replace? }`, `setMaster { master }`, `setLyrics { lines }`;
10934
+ * `setMeta` also takes `audio` (bpm, key, timeSignature, language, loudnessTarget, sampleRate) and `setAudioClip` a
10935
+ * `trackId`. `null` in a patch removes an optional field.
10559
10936
  * @example {
10560
10937
  * "op": "setProps",
10561
10938
  * "target": "title",
@@ -10566,7 +10943,7 @@ type components$1 = {
10566
10943
  */
10567
10944
  readonly CreativeOp: {
10568
10945
  /** @enum {string} */
10569
- readonly op: 'setProps' | 'setLayout' | 'setTiming' | 'setAnim' | 'insertNode' | 'removeNode' | 'moveNode' | 'addScene' | 'removeScene' | 'updateScene' | 'moveScene' | 'setVar' | 'removeVar' | 'setAsset' | 'replaceAsset' | 'setAudioClip' | 'removeAudioClip' | 'setBrand' | 'restyle' | 'adaptFormat' | 'setControl' | 'setMeta' | 'setLocaleText' | 'setLocale' | 'setLocalization';
10946
+ readonly op: 'setProps' | 'setLayout' | 'setTiming' | 'setAnim' | 'insertNode' | 'removeNode' | 'moveNode' | 'addScene' | 'removeScene' | 'updateScene' | 'moveScene' | 'setVar' | 'removeVar' | 'setAsset' | 'replaceAsset' | 'setAudioClip' | 'removeAudioClip' | 'setBrand' | 'restyle' | 'adaptFormat' | 'setControl' | 'setMeta' | 'setLocaleText' | 'setLocale' | 'setLocalization' | 'addSection' | 'updateSection' | 'removeSection' | 'moveSection' | 'addTrack' | 'updateTrack' | 'removeTrack' | 'splitClip' | 'trimClip' | 'moveClip' | 'setFades' | 'addMidiClip' | 'removeMidiClip' | 'updateMidiNotes' | 'setMaster' | 'setLyrics';
10570
10947
  } & {
10571
10948
  readonly [key: string]: unknown;
10572
10949
  };
@@ -12577,6 +12954,157 @@ type components$1 = {
12577
12954
  readonly price_watch?: boolean;
12578
12955
  readonly show_in_share?: boolean;
12579
12956
  };
12957
+ /**
12958
+ * Media op
12959
+ * @description One catalogue entry of `GET /v1/studio/media-ops`.
12960
+ */
12961
+ readonly MediaOp: {
12962
+ /** @description False when the lane is not configured on this gateway (a run then answers 503 `media_ops_unavailable`). */
12963
+ readonly available: boolean;
12964
+ /** @description Engine that runs the op (`birefnet`, `real-esrgan-x4plus`, `gemini-image-edit`, `htdemucs`, `deepfilternet3`, `basic-pitch`, `ffmpeg-loudnorm`, `librosa`, `ace-step-1.5`). */
12965
+ readonly engine: string;
12966
+ readonly id: components$1['schemas']['MediaOpId'];
12967
+ /** @description Asset kinds accepted as input (`image`, `upload`, `frame` for image ops; `music`, `speech`, `sfx`, `upload` for audio ops). */
12968
+ readonly input_kinds: readonly string[];
12969
+ /**
12970
+ * @description `gpu` / `cpu` = the codai Studio media service, `vertex` = Gemini image edit.
12971
+ * @enum {string}
12972
+ */
12973
+ readonly lane: 'gpu' | 'vertex' | 'cpu';
12974
+ readonly max_inputs: number;
12975
+ readonly min_inputs: number;
12976
+ /**
12977
+ * @description `sync` answers 200 with the outputs; `async` answers 202 with a job.
12978
+ * @enum {string}
12979
+ */
12980
+ readonly mode: 'sync' | 'async';
12981
+ /** @description Caveat for the op, when there is one (mask ops: the mask is followed closely, not pixel-exactly). */
12982
+ readonly note?: string;
12983
+ /** @description Kind of the stored outputs (`image`, `music`, `sfx`, `midi`), `same` (the kind of the first input) or `analysis` (JSON only, no asset). */
12984
+ readonly output_kind: string;
12985
+ /** @description The same as a wallet amount, EUR micros. */
12986
+ readonly quote_micro_eur: number;
12987
+ /** @description List price for the reference input (`quote_basis`), USD micros. */
12988
+ readonly quote_micro_usd: number;
12989
+ /** @description Human-readable name. */
12990
+ readonly title: string;
12991
+ };
12992
+ /**
12993
+ * Media op id
12994
+ * @enum {string}
12995
+ */
12996
+ readonly MediaOpId: 'image.remove_background' | 'image.upscale' | 'image.inpaint' | 'image.outpaint' | 'image.erase' | 'audio.separate_stems' | 'audio.denoise' | 'audio.to_midi' | 'audio.master' | 'audio.analyze' | 'music.generate_ace' | 'music.repaint' | 'music.extend' | 'music.cover' | 'sfx.generate';
12997
+ /** Media op job */
12998
+ readonly MediaOpJob: {
12999
+ readonly analysis: {
13000
+ readonly [key: string]: unknown;
13001
+ } | null;
13002
+ /** @description Billed cost, USD micros (0 until settled). */
13003
+ readonly cost_micro_usd: number;
13004
+ /** Format: date-time */
13005
+ readonly created_at: string;
13006
+ /** @description Failure reason (`timeout`, `input_refused`, `dispatch_failed`, `store_failed` or an engine message). */
13007
+ readonly error: string | null;
13008
+ /** Format: uuid */
13009
+ readonly id: string;
13010
+ /** @enum {string} */
13011
+ readonly object: 'media_op.job';
13012
+ readonly op: components$1['schemas']['MediaOpId'];
13013
+ /** @description Stored outputs once `ready` (stems: one asset per stem). */
13014
+ readonly outputs: readonly components$1['schemas']['AssetDto'][];
13015
+ /**
13016
+ * Format: uuid
13017
+ * @description The first input asset (lineage).
13018
+ */
13019
+ readonly parent_asset_id: string | null;
13020
+ /**
13021
+ * @description `pending` while the engine runs; `ready` with outputs; `failed` with `error` (the hold is released, nothing billed).
13022
+ * @enum {string}
13023
+ */
13024
+ readonly status: 'pending' | 'ready' | 'failed';
13025
+ /** Format: date-time */
13026
+ readonly updated_at: string;
13027
+ };
13028
+ /** Media op catalogue */
13029
+ readonly MediaOpList: {
13030
+ readonly data: readonly components$1['schemas']['MediaOp'][];
13031
+ /** @enum {string} */
13032
+ readonly object: 'list';
13033
+ /** @description Reference input of the list quotes. */
13034
+ readonly quote_basis: string;
13035
+ };
13036
+ /** Media op quote */
13037
+ readonly MediaOpQuote: {
13038
+ /** @enum {string} */
13039
+ readonly mode: 'sync' | 'async';
13040
+ /** @enum {string} */
13041
+ readonly object: 'media_op.quote';
13042
+ readonly op: components$1['schemas']['MediaOpId'];
13043
+ /** @description Wallet hold for this request, EUR micros. */
13044
+ readonly quote_micro_eur: number;
13045
+ /** @description Upstream cost ceiling, USD micros. */
13046
+ readonly quote_micro_usd: number;
13047
+ };
13048
+ /**
13049
+ * Media op request
13050
+ * @description `asset_ids` are the inputs, in order; `params` are validated strictly per op (unknown keys are rejected):
13051
+ *
13052
+ * | Op | Assets | Params (defaults) |
13053
+ * | --- | --- | --- |
13054
+ * | `image.remove_background` | 1 image | `format`: `png` \| `webp` (`png`) |
13055
+ * | `image.upscale` | 1 image | `scale`: 2 \| 4 (4); output at most 64 MP |
13056
+ * | `image.inpaint` | image + PNG mask | `prompt` (required, ≤ 2000), `model`, `image_size`: `1K` \| `2K` \| `4K` |
13057
+ * | `image.erase` | image + PNG mask | `prompt` (optional), `model`, `image_size` |
13058
+ * | `image.outpaint` | 1 image | `aspect_ratio` (required: `1:1`, `2:3`, `3:2`, `3:4`, `4:3`, `4:5`, `5:4`, `9:16`, `16:9`, `21:9`, `9:21`), `prompt`, `model`, `image_size` |
13059
+ * | `audio.separate_stems` | 1 audio | `stems`: 2 \| 4 (4: vocals, drums, bass, other; 2: vocals, accompaniment) |
13060
+ * | `audio.denoise` | 1 audio | `strength`: 0–1 (1) |
13061
+ * | `audio.to_midi` | 1 audio | `onset_threshold`: 0.05–0.95 (0.5), `min_note_ms`: 10–1000 (58) |
13062
+ * | `audio.master` | 1 audio | `target_lufs`: -14 \| -16 \| -23 (-14), `true_peak_db`: -3…-0.1 (-1), `format`: `wav` \| `mp3` (`wav`) |
13063
+ * | `audio.analyze` | 1 audio | none |
13064
+ * | `music.generate_ace` | 0–1 audio | `prompt` (required, ≤ 1000), `lyrics` (≤ 4000), `duration_seconds`: 10–240 (60), `bpm`: 40–220, `key`, `language`, `seed` |
13065
+ * | `music.repaint` | 1 audio | `prompt`, `lyrics`, `start_seconds`, `end_seconds` (after start), `seed` |
13066
+ * | `music.extend` | 1 audio | `prompt`, `lyrics`, `extend_seconds`: 5–120, `seed` |
13067
+ * | `music.cover` | 1 audio | `prompt`, `lyrics`, `strength`: 0–1 (0.8), `seed` |
13068
+ * | `sfx.generate` | none | `prompt` (required), `duration_seconds`: 1–30 (5), `seed` |
13069
+ * @example {
13070
+ * "asset_ids": [
13071
+ * "3f2b8c1e-0000-4000-8000-000000000001"
13072
+ * ],
13073
+ * "params": {
13074
+ * "stems": 4
13075
+ * }
13076
+ * }
13077
+ */
13078
+ readonly MediaOpRequest: {
13079
+ /**
13080
+ * @description Owned, ready Studio asset ids, distinct, in the order the op expects (mask second).
13081
+ * @default []
13082
+ */
13083
+ readonly asset_ids?: readonly string[];
13084
+ /**
13085
+ * @description Per-op parameters (table above).
13086
+ * @default {}
13087
+ */
13088
+ readonly params?: {
13089
+ readonly [key: string]: unknown;
13090
+ };
13091
+ };
13092
+ /** Media op result */
13093
+ readonly MediaOpResult: {
13094
+ /** @description `audio.analyze`: `{ duration_seconds, bpm, key, key_confidence, integrated_lufs, sample_peak_dbfs }`; otherwise `null`. */
13095
+ readonly analysis: {
13096
+ readonly [key: string]: unknown;
13097
+ } | null;
13098
+ /** @description Billed cost, USD micros. */
13099
+ readonly cost_micro_usd: number;
13100
+ /** @enum {string} */
13101
+ readonly object: 'media_op.result';
13102
+ readonly op: components$1['schemas']['MediaOpId'];
13103
+ /** @description Stored outputs, AI-marked, each with lineage to the first input (empty for `audio.analyze`). */
13104
+ readonly outputs: readonly components$1['schemas']['AssetDto'][];
13105
+ /** @enum {string} */
13106
+ readonly status: 'ready';
13107
+ };
12580
13108
  /**
12581
13109
  * Media response format
12582
13110
  * @description `b64_json` (default) returns the bytes inline, base64-encoded — the original shape. `url` stores the result as an asset (kept 90 days) and returns `AssetDto` items with a 1-hour signed `url`; 503 `assets_unavailable` when storage is not configured.
@@ -14804,6 +15332,41 @@ type components$1 = {
14804
15332
  */
14805
15333
  readonly surface: 'share' | 'review';
14806
15334
  };
15335
+ /**
15336
+ * Audio render
15337
+ * @description An audio creative render as returned by `GET /v1/studio/renders/{id}` (`target: audio`).
15338
+ */
15339
+ readonly StudioAudioRender: {
15340
+ readonly cost_micro_usd?: string;
15341
+ /** Format: uuid */
15342
+ readonly creative_id: string;
15343
+ /** @description One stored, AI-marked asset per output (1-hour signed `url`), only when `succeeded`. */
15344
+ readonly data?: readonly (components$1['schemas']['AssetDto'] & {
15345
+ /** @enum {string} */
15346
+ readonly format: 'wav' | 'mp3' | 'flac' | 'lrc';
15347
+ /** @enum {string} */
15348
+ readonly output: 'mix' | 'stem' | 'lrc';
15349
+ readonly track_id: string | null;
15350
+ })[];
15351
+ readonly duration_seconds?: number | null;
15352
+ readonly error: string | null;
15353
+ readonly formats: readonly ('wav' | 'mp3' | 'flac')[];
15354
+ /** Format: uuid */
15355
+ readonly id: string;
15356
+ readonly lrc: boolean;
15357
+ readonly model: string;
15358
+ /** @enum {string} */
15359
+ readonly object: 'studio.render';
15360
+ readonly progress?: number | null;
15361
+ /** @description Measured `lufs`, `true_peak_db`, `clipping`, `warnings` of the master. */
15362
+ readonly qa?: Record<string, never> | null;
15363
+ readonly stage?: string | null;
15364
+ readonly status: components$1['schemas']['StudioRenderStatus'];
15365
+ readonly stems: boolean;
15366
+ /** @enum {string} */
15367
+ readonly target: 'audio';
15368
+ readonly target_lufs: number;
15369
+ };
14807
15370
  /** Studio batch */
14808
15371
  readonly StudioBatch: {
14809
15372
  /** @description The CSV header and the column mapping. */
@@ -15190,6 +15753,119 @@ type components$1 = {
15190
15753
  /** @description Non-fatal problems, e.g. audio assets that were skipped because they are missing or not ready. */
15191
15754
  readonly warnings: readonly string[];
15192
15755
  };
15756
+ /** Written lyrics */
15757
+ readonly StudioLyrics: {
15758
+ /** @description Charge in micro-USD (string, bigint-safe): the token cost of the turns. */
15759
+ readonly cost_micro_usd: string;
15760
+ /** @enum {string} */
15761
+ readonly language: 'ro' | 'en';
15762
+ /** @enum {string} */
15763
+ readonly object: 'studio.lyrics';
15764
+ /** @description True when the second (repair) turn produced the returned lyrics. */
15765
+ readonly repaired: boolean;
15766
+ /** @description Syllable and rhyme check of the returned lyrics. */
15767
+ readonly report: {
15768
+ readonly lines: number;
15769
+ readonly off_lines: number;
15770
+ readonly off_ratio: number;
15771
+ readonly pairs: number;
15772
+ readonly repair_ratio: number;
15773
+ readonly rhymed: number;
15774
+ };
15775
+ /** @enum {string} */
15776
+ readonly rhyme_scheme: 'AABB' | 'ABAB' | 'free';
15777
+ readonly sections: readonly {
15778
+ readonly kind: components$1['schemas']['StudioLyricsSectionKind'];
15779
+ readonly lines: readonly components$1['schemas']['StudioLyricsLine'][];
15780
+ }[];
15781
+ readonly syllables_per_line: number | null;
15782
+ /** @description The whole song as text, one `[kind]` header per section (ready for `lyrics_text` of the align call). */
15783
+ readonly text: string;
15784
+ readonly title: string | null;
15785
+ };
15786
+ /** Lyrics alignment */
15787
+ readonly StudioLyricsAlignment: {
15788
+ readonly applied: boolean;
15789
+ /** @description True when the cached words of the clip were used (no transcription charge). */
15790
+ readonly cached: boolean;
15791
+ readonly clip_id: string;
15792
+ readonly cost_micro_usd: string;
15793
+ /** Format: uuid */
15794
+ readonly creative_id: string;
15795
+ readonly doc_hash?: string;
15796
+ /** @description Timed lines on the document timeline (the `setLyrics` payload). */
15797
+ readonly lines: readonly {
15798
+ readonly endMs: number;
15799
+ readonly sectionId?: string;
15800
+ readonly startMs: number;
15801
+ readonly text: string;
15802
+ }[];
15803
+ /** @description The lines as an LRC file. */
15804
+ readonly lrc: string;
15805
+ /** @description Share of lyric words matched to a transcribed word. */
15806
+ readonly match_ratio: number;
15807
+ /** @enum {string} */
15808
+ readonly object: 'studio.lyrics_alignment';
15809
+ /** @description The new version, when applied. */
15810
+ readonly seq?: number;
15811
+ };
15812
+ /** Lyrics alignment request */
15813
+ readonly StudioLyricsAlignRequest: {
15814
+ /**
15815
+ * @description false returns the timed lines and LRC without editing the creative.
15816
+ * @default true
15817
+ */
15818
+ readonly apply?: boolean;
15819
+ /** @description Version the setLyrics edit is based on (default the head). */
15820
+ readonly base_seq?: number;
15821
+ /** @description The audio clip of the creative to align to (its asset must be a ready speech, music, video or upload asset). */
15822
+ readonly clip_id: string;
15823
+ readonly creative_id: string;
15824
+ /**
15825
+ * @description Transcription language hint (default the document `meta.language`).
15826
+ * @enum {string}
15827
+ */
15828
+ readonly language?: 'ro' | 'en';
15829
+ /** @description The lyrics as text; `[verse]` / `[chorus]` header lines start sections. */
15830
+ readonly lyrics_text: string;
15831
+ /** @description Ignore the cached words of the clip asset and transcribe again (billed). */
15832
+ readonly retranscribe?: boolean;
15833
+ };
15834
+ /** Checked lyric line */
15835
+ readonly StudioLyricsLine: {
15836
+ /** @description Rhyme letter of the line inside its section (A, B, ...). */
15837
+ readonly letter: string;
15838
+ /** @description True when the syllable count is outside the target ±1. */
15839
+ readonly off: boolean;
15840
+ /** @description The rhyme ending used for the scheme check. */
15841
+ readonly rhyme: string;
15842
+ /** @description Counted syllables (Romanian or English rules). */
15843
+ readonly syllables: number;
15844
+ readonly text: string;
15845
+ };
15846
+ /** Lyrics request */
15847
+ readonly StudioLyricsRequest: {
15848
+ /** @description What the song is about (3-4000 chars). Never logged. */
15849
+ readonly brief: string;
15850
+ readonly genre?: string;
15851
+ /** @enum {string} */
15852
+ readonly language: 'ro' | 'en';
15853
+ /** @default 4 */
15854
+ readonly lines_per_section?: number;
15855
+ readonly mood?: string;
15856
+ /**
15857
+ * @default free
15858
+ * @enum {string}
15859
+ */
15860
+ readonly rhyme_scheme?: 'AABB' | 'ABAB' | 'free';
15861
+ /** @description Section order (default verse, chorus, verse, chorus, bridge, chorus). */
15862
+ readonly structure?: readonly components$1['schemas']['StudioLyricsSectionKind'][];
15863
+ /** @description Target syllables per line (checked with a tolerance of 1). */
15864
+ readonly syllables_per_line?: number;
15865
+ readonly title?: string;
15866
+ };
15867
+ /** @enum {string} */
15868
+ readonly StudioLyricsSectionKind: 'intro' | 'verse' | 'pre_chorus' | 'chorus' | 'bridge' | 'outro' | 'instrumental' | 'custom';
15193
15869
  /** Narration defaults */
15194
15870
  readonly StudioNarrationDefaults: {
15195
15871
  /** @description Delivery instructions for expressive voices. */
@@ -17351,6 +18027,8 @@ type components$1 = {
17351
18027
  readonly EnvironmentId: string;
17352
18028
  /** @description Replays the stored response of an earlier request with the same key for 24 h instead of running it again. */
17353
18029
  readonly IdempotencyKey: string;
18030
+ /** @description Dotted media-op id, e.g. `image.remove_background` or `audio.separate_stems`. */
18031
+ readonly MediaOpIdPath: components$1['schemas']['MediaOpId'];
17354
18032
  /** @description Project UUID. A malformed value is 400; an unknown or foreign project is 404. */
17355
18033
  readonly ProjectId: string;
17356
18034
  /** @description Client correlation id; echoed back as `x-codai-trace-id` and persisted on the usage row. */
@@ -28295,7 +28973,7 @@ interface operations$1 {
28295
28973
  };
28296
28974
  readonly requestBody?: {
28297
28975
  readonly content: {
28298
- readonly 'application/json': components$1['schemas']['CreativeRenderRequest'];
28976
+ readonly 'application/json': components$1['schemas']['CreativeRenderRequest'] | components$1['schemas']['CreativeAudioRenderRequest'];
28299
28977
  };
28300
28978
  };
28301
28979
  readonly responses: {
@@ -28314,10 +28992,10 @@ interface operations$1 {
28314
28992
  readonly [name: string]: unknown;
28315
28993
  };
28316
28994
  content: {
28317
- readonly 'application/json': components$1['schemas']['CreativeRenderAccepted'];
28995
+ readonly 'application/json': components$1['schemas']['CreativeRenderAccepted'] | components$1['schemas']['CreativeAudioRenderAccepted'];
28318
28996
  };
28319
28997
  };
28320
- /** @description Invalid body, an unsupported format (`unsupported_format`), a missing asset (`asset_not_found`), a non-video creative (`not_supported_for_kind`) or `ai_label: none` on a creative with TTS narration (`ai_label_required`). */
28998
+ /** @description Invalid body, an unsupported format (`unsupported_format`), a missing asset (`asset_not_found`), a kind that cannot render (`not_supported_for_kind`), an audio creative with nothing to render (`empty_audio`) or over 20 minutes (`too_long`), `lrc: true` without timed lyrics (`no_lyrics`) or `ai_label: none` on a creative with TTS narration (`ai_label_required`). */
28321
28999
  readonly 400: {
28322
29000
  headers: {
28323
29001
  readonly [name: string]: unknown;
@@ -29408,6 +30086,281 @@ interface operations$1 {
29408
30086
  readonly 404: components$1['responses']['NotFound'];
29409
30087
  };
29410
30088
  };
30089
+ readonly writeStudioLyrics: {
30090
+ readonly parameters: {
30091
+ readonly query?: never;
30092
+ readonly header?: {
30093
+ /** @description Replays the stored response of an earlier request with the same key for 24 h instead of running it again. */
30094
+ readonly 'Idempotency-Key'?: components$1['parameters']['IdempotencyKey'];
30095
+ /** @description Client correlation id; echoed back as `x-codai-trace-id` and persisted on the usage row. */
30096
+ readonly 'x-request-id'?: components$1['parameters']['RequestId'];
30097
+ };
30098
+ readonly path?: never;
30099
+ readonly cookie?: never;
30100
+ };
30101
+ readonly requestBody: {
30102
+ readonly content: {
30103
+ readonly 'application/json': components$1['schemas']['StudioLyricsRequest'];
30104
+ };
30105
+ };
30106
+ readonly responses: {
30107
+ /** @description The lyrics with a per-line syllable and rhyme report. */
30108
+ readonly 200: {
30109
+ headers: {
30110
+ readonly [name: string]: unknown;
30111
+ };
30112
+ content: {
30113
+ readonly 'application/json': components$1['schemas']['StudioLyrics'];
30114
+ };
30115
+ };
30116
+ /** @description Invalid body (`invalid_request`). */
30117
+ readonly 400: {
30118
+ headers: {
30119
+ readonly [name: string]: unknown;
30120
+ };
30121
+ content: {
30122
+ readonly 'application/json': components$1['schemas']['CreativeError'];
30123
+ };
30124
+ };
30125
+ readonly 401: components$1['responses']['Unauthorized'];
30126
+ readonly 402: components$1['responses']['InsufficientFunds'];
30127
+ readonly 403: components$1['responses']['Forbidden'];
30128
+ /** @description The brief could not be turned into lyrics (`no_lyrics`); only the turns that ran are billed. */
30129
+ readonly 422: {
30130
+ headers: {
30131
+ readonly [name: string]: unknown;
30132
+ };
30133
+ content: {
30134
+ readonly 'application/json': components$1['schemas']['CreativeError'];
30135
+ };
30136
+ };
30137
+ readonly 429: components$1['responses']['RateLimited'];
30138
+ readonly 502: components$1['responses']['UpstreamError'];
30139
+ };
30140
+ };
30141
+ readonly alignStudioLyrics: {
30142
+ readonly parameters: {
30143
+ readonly query?: never;
30144
+ readonly header?: {
30145
+ /** @description Replays the stored response of an earlier request with the same key for 24 h instead of running it again. */
30146
+ readonly 'Idempotency-Key'?: components$1['parameters']['IdempotencyKey'];
30147
+ /** @description Client correlation id; echoed back as `x-codai-trace-id` and persisted on the usage row. */
30148
+ readonly 'x-request-id'?: components$1['parameters']['RequestId'];
30149
+ };
30150
+ readonly path?: never;
30151
+ readonly cookie?: never;
30152
+ };
30153
+ readonly requestBody: {
30154
+ readonly content: {
30155
+ readonly 'application/json': components$1['schemas']['StudioLyricsAlignRequest'];
30156
+ };
30157
+ };
30158
+ readonly responses: {
30159
+ /** @description The timed lines, the LRC and the new version when applied. */
30160
+ readonly 200: {
30161
+ headers: {
30162
+ readonly [name: string]: unknown;
30163
+ };
30164
+ content: {
30165
+ readonly 'application/json': components$1['schemas']['StudioLyricsAlignment'];
30166
+ };
30167
+ };
30168
+ /** @description Invalid body, lyrics without lines, or clip audio over 25 MB (`unsupported_media`). */
30169
+ readonly 400: {
30170
+ headers: {
30171
+ readonly [name: string]: unknown;
30172
+ };
30173
+ content: {
30174
+ readonly 'application/json': components$1['schemas']['CreativeError'];
30175
+ };
30176
+ };
30177
+ readonly 401: components$1['responses']['Unauthorized'];
30178
+ readonly 402: components$1['responses']['InsufficientFunds'];
30179
+ /** @description EU data-residency account (`residency_unavailable`). */
30180
+ readonly 403: {
30181
+ headers: {
30182
+ readonly [name: string]: unknown;
30183
+ };
30184
+ content: {
30185
+ readonly 'application/json': components$1['schemas']['Error'];
30186
+ };
30187
+ };
30188
+ readonly 404: components$1['responses']['NotFound'];
30189
+ /** @description The creative moved past `base_seq` and the edit could not be rebased (`stale`). */
30190
+ readonly 409: {
30191
+ headers: {
30192
+ readonly [name: string]: unknown;
30193
+ };
30194
+ content: {
30195
+ readonly 'application/json': components$1['schemas']['CreativeError'];
30196
+ };
30197
+ };
30198
+ /** @description Transcription is not configured or not available right now (`transcription_unavailable`). */
30199
+ readonly 503: {
30200
+ headers: {
30201
+ readonly [name: string]: unknown;
30202
+ };
30203
+ content: {
30204
+ readonly 'application/json': components$1['schemas']['Error'];
30205
+ };
30206
+ };
30207
+ };
30208
+ };
30209
+ readonly listStudioMediaOps: {
30210
+ readonly parameters: {
30211
+ readonly query?: never;
30212
+ readonly header?: never;
30213
+ readonly path?: never;
30214
+ readonly cookie?: never;
30215
+ };
30216
+ readonly requestBody?: never;
30217
+ readonly responses: {
30218
+ /** @description The op catalogue. */
30219
+ readonly 200: {
30220
+ headers: {
30221
+ readonly [name: string]: unknown;
30222
+ };
30223
+ content: {
30224
+ readonly 'application/json': components$1['schemas']['MediaOpList'];
30225
+ };
30226
+ };
30227
+ readonly 401: components$1['responses']['Unauthorized'];
30228
+ };
30229
+ };
30230
+ readonly runStudioMediaOp: {
30231
+ readonly parameters: {
30232
+ readonly query?: never;
30233
+ readonly header?: {
30234
+ /** @description Replays the stored response of an earlier request with the same key for 24 h instead of running it again. */
30235
+ readonly 'Idempotency-Key'?: components$1['parameters']['IdempotencyKey'];
30236
+ };
30237
+ readonly path: {
30238
+ /** @description Dotted media-op id, e.g. `image.remove_background` or `audio.separate_stems`. */
30239
+ readonly op: components$1['parameters']['MediaOpIdPath'];
30240
+ };
30241
+ readonly cookie?: never;
30242
+ };
30243
+ readonly requestBody: {
30244
+ readonly content: {
30245
+ readonly 'application/json': components$1['schemas']['MediaOpRequest'];
30246
+ };
30247
+ };
30248
+ readonly responses: {
30249
+ /** @description Sync op done: the stored, AI-marked outputs (or `analysis` for `audio.analyze`). */
30250
+ readonly 200: {
30251
+ headers: {
30252
+ readonly [name: string]: unknown;
30253
+ };
30254
+ content: {
30255
+ readonly 'application/json': components$1['schemas']['MediaOpResult'];
30256
+ };
30257
+ };
30258
+ /** @description Async op dispatched: the job (`status: pending`). */
30259
+ readonly 202: {
30260
+ headers: {
30261
+ readonly [name: string]: unknown;
30262
+ };
30263
+ content: {
30264
+ readonly 'application/json': components$1['schemas']['MediaOpJob'];
30265
+ };
30266
+ };
30267
+ readonly 400: components$1['responses']['BadRequest'];
30268
+ readonly 401: components$1['responses']['Unauthorized'];
30269
+ readonly 402: components$1['responses']['InsufficientFunds'];
30270
+ /** @description Unknown op id, or an asset that does not exist, is not ready or belongs to another account. */
30271
+ readonly 404: {
30272
+ headers: {
30273
+ readonly [name: string]: unknown;
30274
+ };
30275
+ content: {
30276
+ readonly 'application/json': components$1['schemas']['Error'];
30277
+ };
30278
+ };
30279
+ readonly 429: components$1['responses']['RateLimited'];
30280
+ readonly 502: components$1['responses']['UpstreamError'];
30281
+ /** @description The op lane is not configured on this gateway (code `media_ops_unavailable`) or asset storage is off (`assets_unavailable`). Nothing was held or billed. */
30282
+ readonly 503: {
30283
+ headers: {
30284
+ readonly [name: string]: unknown;
30285
+ };
30286
+ content: {
30287
+ readonly 'application/json': components$1['schemas']['Error'];
30288
+ };
30289
+ };
30290
+ };
30291
+ };
30292
+ readonly quoteStudioMediaOp: {
30293
+ readonly parameters: {
30294
+ readonly query?: never;
30295
+ readonly header?: never;
30296
+ readonly path: {
30297
+ /** @description Dotted media-op id, e.g. `image.remove_background` or `audio.separate_stems`. */
30298
+ readonly op: components$1['parameters']['MediaOpIdPath'];
30299
+ };
30300
+ readonly cookie?: never;
30301
+ };
30302
+ readonly requestBody: {
30303
+ readonly content: {
30304
+ readonly 'application/json': components$1['schemas']['MediaOpRequest'];
30305
+ };
30306
+ };
30307
+ readonly responses: {
30308
+ /** @description The quote. */
30309
+ readonly 200: {
30310
+ headers: {
30311
+ readonly [name: string]: unknown;
30312
+ };
30313
+ content: {
30314
+ readonly 'application/json': components$1['schemas']['MediaOpQuote'];
30315
+ };
30316
+ };
30317
+ readonly 400: components$1['responses']['BadRequest'];
30318
+ readonly 401: components$1['responses']['Unauthorized'];
30319
+ /** @description Unknown op id, or an asset that does not exist, is not ready or belongs to another account. */
30320
+ readonly 404: {
30321
+ headers: {
30322
+ readonly [name: string]: unknown;
30323
+ };
30324
+ content: {
30325
+ readonly 'application/json': components$1['schemas']['Error'];
30326
+ };
30327
+ };
30328
+ /** @description The op lane is not configured on this gateway (code `media_ops_unavailable`) or asset storage is off (`assets_unavailable`). */
30329
+ readonly 503: {
30330
+ headers: {
30331
+ readonly [name: string]: unknown;
30332
+ };
30333
+ content: {
30334
+ readonly 'application/json': components$1['schemas']['Error'];
30335
+ };
30336
+ };
30337
+ };
30338
+ };
30339
+ readonly getStudioMediaOpJob: {
30340
+ readonly parameters: {
30341
+ readonly query?: never;
30342
+ readonly header?: never;
30343
+ readonly path: {
30344
+ /** @description Job UUID (the `id` of the 202 answer). */
30345
+ readonly id: string;
30346
+ };
30347
+ readonly cookie?: never;
30348
+ };
30349
+ readonly requestBody?: never;
30350
+ readonly responses: {
30351
+ /** @description The job. */
30352
+ readonly 200: {
30353
+ headers: {
30354
+ readonly [name: string]: unknown;
30355
+ };
30356
+ content: {
30357
+ readonly 'application/json': components$1['schemas']['MediaOpJob'];
30358
+ };
30359
+ };
30360
+ readonly 401: components$1['responses']['Unauthorized'];
30361
+ readonly 404: components$1['responses']['NotFound'];
30362
+ };
30363
+ };
29411
30364
  readonly retrievePreview: {
29412
30365
  readonly parameters: {
29413
30366
  readonly query?: never;
@@ -29650,7 +30603,7 @@ interface operations$1 {
29650
30603
  readonly [name: string]: unknown;
29651
30604
  };
29652
30605
  content: {
29653
- readonly 'application/json': components$1['schemas']['StudioRender'];
30606
+ readonly 'application/json': components$1['schemas']['StudioRender'] | components$1['schemas']['StudioAudioRender'];
29654
30607
  };
29655
30608
  };
29656
30609
  readonly 401: components$1['responses']['Unauthorized'];
@@ -33616,7 +34569,7 @@ export type Receipt = Reply<'getReceipt'>;
33616
34569
  export type FeedbackRequest = Mutable<Body<'submitFeedback'>>;
33617
34570
  export type FeedbackResponse = Reply<'submitFeedback'>;
33618
34571
  export type PhoneModel = Schema<'AccountPhoneModel'>;
33619
- type CallOpts$37 = {
34572
+ type CallOpts$38 = {
33620
34573
  ext?: CodaiRequestExtensions;
33621
34574
  signal?: AbortSignal;
33622
34575
  };
@@ -33624,9 +34577,9 @@ export declare class Account {
33624
34577
  private readonly http;
33625
34578
  constructor(http: HttpClient);
33626
34579
  /** `GET /v1/account` — the full account card. */
33627
- get(opts?: CallOpts$37): Promise<AccountView>;
34580
+ get(opts?: CallOpts$38): Promise<AccountView>;
33628
34581
  /** `PATCH /v1/account` — consents, username, referral (at least one field). */
33629
- update(body: AccountPatchRequest, opts?: CallOpts$37): Promise<AccountPatchResponse>;
34582
+ update(body: AccountPatchRequest, opts?: CallOpts$38): Promise<AccountPatchResponse>;
33630
34583
  }
33631
34584
  export declare class Receipts {
33632
34585
  private readonly http;
@@ -33638,7 +34591,7 @@ export declare class Receipts {
33638
34591
  get(query?: {
33639
34592
  sessionId?: string;
33640
34593
  since?: string | Date;
33641
- }, opts?: CallOpts$37): Promise<Receipt>;
34594
+ }, opts?: CallOpts$38): Promise<Receipt>;
33642
34595
  }
33643
34596
  export declare class Feedback {
33644
34597
  private readonly http;
@@ -33647,13 +34600,13 @@ export declare class Feedback {
33647
34600
  * `POST /v1/feedback` — rate one turn. Exactly one of `event_id`,
33648
34601
  * `session_id`, `client_request_id` must be present.
33649
34602
  */
33650
- submit(body: FeedbackRequest, opts?: CallOpts$37): Promise<FeedbackResponse>;
34603
+ submit(body: FeedbackRequest, opts?: CallOpts$38): Promise<FeedbackResponse>;
33651
34604
  }
33652
34605
  export declare class PhoneModels {
33653
34606
  private readonly http;
33654
34607
  constructor(http: HttpClient);
33655
34608
  /** `GET /v1/phone/models` — on-device model catalog with signed URLs. */
33656
- list(opts?: CallOpts$37): Promise<PhoneModel[]>;
34609
+ list(opts?: CallOpts$38): Promise<PhoneModel[]>;
33657
34610
  }
33658
34611
  //#endregion
33659
34612
  //#region src/resources/agents.d.ts
@@ -33665,7 +34618,7 @@ export type AgentRun = Reply<'getAgentRun'>;
33665
34618
  export type AgentRunStep = Schema<'AgentRunStep'>;
33666
34619
  export type AgentRunStats = Reply<'getAgentRunStats'>;
33667
34620
  export type AgentRunStatus = Schema<'AgentRunStatus'>;
33668
- type CallOpts$36 = {
34621
+ type CallOpts$37 = {
33669
34622
  ext?: CodaiRequestExtensions;
33670
34623
  signal?: AbortSignal;
33671
34624
  };
@@ -33702,28 +34655,28 @@ export declare class AgentRuns {
33702
34655
  private readonly http;
33703
34656
  constructor(http: HttpClient);
33704
34657
  /** `POST /v1/agents/runs` — returns 202 with the run id. */
33705
- create(body: AgentRunCreateRequest, opts?: CallOpts$36): Promise<AgentRunAccepted>;
34658
+ create(body: AgentRunCreateRequest, opts?: CallOpts$37): Promise<AgentRunAccepted>;
33706
34659
  /** `GET /v1/agents/runs/{id}` */
33707
- get(id: string, opts?: CallOpts$36): Promise<AgentRun>;
34660
+ get(id: string, opts?: CallOpts$37): Promise<AgentRun>;
33708
34661
  /** `GET /v1/agents/runs/{id}/steps` — newest first. */
33709
- steps(id: string, opts?: CallOpts$36): Promise<AgentRunStep[]>;
34662
+ steps(id: string, opts?: CallOpts$37): Promise<AgentRunStep[]>;
33710
34663
  /** `GET /v1/agents/runs/stats?days=` */
33711
- stats(days?: number, opts?: CallOpts$36): Promise<AgentRunStats>;
34664
+ stats(days?: number, opts?: CallOpts$37): Promise<AgentRunStats>;
33712
34665
  /** `POST /v1/agents/runs/{id}/cancel` */
33713
- cancel(id: string, opts?: CallOpts$36): Promise<Reply<'cancelAgentRun'>>;
34666
+ cancel(id: string, opts?: CallOpts$37): Promise<Reply<'cancelAgentRun'>>;
33714
34667
  /**
33715
34668
  * `GET /v1/agents/runs/{id}/stream` — async iterator over `step` / `done` /
33716
34669
  * `timeout` events. The iterator ends after `done`; on `timeout` (30 min)
33717
34670
  * it also ends and you may reconnect (full replay from seq 0).
33718
34671
  */
33719
- stream(id: string, opts?: CallOpts$36): AsyncGenerator<AgentRunStreamEvent, void, undefined>;
34672
+ stream(id: string, opts?: CallOpts$37): AsyncGenerator<AgentRunStreamEvent, void, undefined>;
33720
34673
  }
33721
34674
  export declare class Agents {
33722
34675
  private readonly http;
33723
34676
  readonly runs: AgentRuns;
33724
34677
  constructor(http: HttpClient);
33725
34678
  /** `POST /v1/agents/run` — blocks until the agent loop finishes. */
33726
- run(body: AgentRunRequest, opts?: CallOpts$36): Promise<AgentRunResult>;
34679
+ run(body: AgentRunRequest, opts?: CallOpts$37): Promise<AgentRunResult>;
33727
34680
  }
33728
34681
  //#endregion
33729
34682
  //#region src/resources/audio.d.ts
@@ -33888,7 +34841,7 @@ export interface StudioQuoteQuery {
33888
34841
  model?: string;
33889
34842
  n?: number;
33890
34843
  }
33891
- type CallOpts$35 = {
34844
+ type CallOpts$36 = {
33892
34845
  ext?: CodaiRequestExtensions;
33893
34846
  signal?: AbortSignal;
33894
34847
  };
@@ -33912,16 +34865,16 @@ export declare class Billing {
33912
34865
  private readonly http;
33913
34866
  constructor(http: HttpClient);
33914
34867
  /** `GET /v1/billing` — plan, wallet, auto top-up, cards and pay links (read-only). */
33915
- get(opts?: CallOpts$35): Promise<BillingOverview>;
34868
+ get(opts?: CallOpts$36): Promise<BillingOverview>;
33916
34869
  /** `GET /v1/billing/invoices` — fiscal invoices and credit notes, newest first. */
33917
34870
  invoices(query?: {
33918
34871
  limit?: number;
33919
- }, opts?: CallOpts$35): Promise<BillingInvoice[]>;
34872
+ }, opts?: CallOpts$36): Promise<BillingInvoice[]>;
33920
34873
  /**
33921
34874
  * `GET /v1/studio/quote` — what a Studio action costs (USD and wallet EUR micros) and your spendable balance,
33922
34875
  * before you run it. Paid Studio calls answer 402 `insufficient_funds` when `sufficient` is false. Free.
33923
34876
  */
33924
- studioQuote(query: StudioQuoteQuery, opts?: CallOpts$35): Promise<StudioQuote>;
34877
+ studioQuote(query: StudioQuoteQuery, opts?: CallOpts$36): Promise<StudioQuote>;
33925
34878
  /**
33926
34879
  * Poll `get()` every `intervalMs` and call `onLow` once each time the wallet
33927
34880
  * balance crosses below `thresholdEur`. Read-only: never creates a checkout.
@@ -33966,7 +34919,7 @@ export interface CardsRendered {
33966
34919
  width: number | null;
33967
34920
  height: number | null;
33968
34921
  }
33969
- type CallOpts$34 = {
34922
+ type CallOpts$35 = {
33970
34923
  ext?: CodaiRequestExtensions;
33971
34924
  signal?: AbortSignal;
33972
34925
  };
@@ -33975,59 +34928,59 @@ export declare class Cards {
33975
34928
  constructor(http: HttpClient);
33976
34929
  private get;
33977
34930
  /** `GET /v1/cards/weather` — `weather` block from MET Norway (cached 30–60 min per 0.01°, free). */
33978
- weather(params: CardsWeatherParams, opts?: CallOpts$34): Promise<CardsWeatherResponse>;
34931
+ weather(params: CardsWeatherParams, opts?: CallOpts$35): Promise<CardsWeatherResponse>;
33979
34932
  /**
33980
34933
  * `GET /v1/cards/places` — `places` block from Google Places: Text Search with `q` (biased to `lat`/`lng`/`radius`),
33981
34934
  * Nearby Search without it. Billed per call; `block` is null when nothing matched.
33982
34935
  */
33983
- places(params: CardsPlacesParams, opts?: CallOpts$34): Promise<CardsPlacesResponse>;
34936
+ places(params: CardsPlacesParams, opts?: CallOpts$35): Promise<CardsPlacesResponse>;
33984
34937
  /** `GET /v1/cards/geocode` — `map` block (≤ 5 markers) plus raw `results` (Google Geocoding, billed). */
33985
- geocode(params: CardsGeocodeParams, opts?: CallOpts$34): Promise<CardsGeocodeResponse>;
34938
+ geocode(params: CardsGeocodeParams, opts?: CallOpts$35): Promise<CardsGeocodeResponse>;
33986
34939
  /**
33987
34940
  * `GET /v1/cards/static-map` — PNG from Google Maps Static proxied through the gateway (no maps key on the client).
33988
34941
  * Needs `center` or `markers` (`lat,lng[,L]` joined by `|`); ≤ 640×400 points. Billed per call.
33989
34942
  */
33990
- staticMap(params: CardsStaticMapParams, opts?: CallOpts$34): Promise<CardsStaticMap>;
34943
+ staticMap(params: CardsStaticMapParams, opts?: CallOpts$35): Promise<CardsStaticMap>;
33991
34944
  /**
33992
34945
  * `GET /v1/cards/fx` — BNR (default) or ECB reference rates: a `metric` block with `from`+`to`, otherwise a `table`
33993
34946
  * block against `quote`, optionally limited to `symbols` (comma-separated). Free.
33994
34947
  */
33995
- fx(params?: CardsFxParams, opts?: CallOpts$34): Promise<CardsFxResponse>;
34948
+ fx(params?: CardsFxParams, opts?: CallOpts$35): Promise<CardsFxResponse>;
33996
34949
  /**
33997
34950
  * `GET /v1/cards/route` — travel time from Google Routes: `route` { mode, durationS, staticDurationS, distanceM,
33998
34951
  * polyline } and a `map` block. `origin`/`destination` as "lat,lng" or `from`/`to` as addresses; `mode` drive
33999
34952
  * (traffic-aware, default), walk, bicycle, transit, two_wheeler. Billed per call; both null when no route exists.
34000
34953
  */
34001
- route(params: CardsRouteParams, opts?: CallOpts$34): Promise<CardsRouteResponse>;
34954
+ route(params: CardsRouteParams, opts?: CallOpts$35): Promise<CardsRouteResponse>;
34002
34955
  /**
34003
34956
  * `GET /v1/cards/track` — parcel history as a `timeline` block plus `result` (carrier, configured, found,
34004
34957
  * delivered, events, trackingUrl). `carrier` (sameday | fan | cargus | dpd) is guessed from the AWB when omitted;
34005
34958
  * carriers without gateway credentials answer `configured: false` with only the tracking link. Free.
34006
34959
  */
34007
- track(params: CardsTrackParams, opts?: CallOpts$34): Promise<CardsTrackResponse>;
34960
+ track(params: CardsTrackParams, opts?: CallOpts$35): Promise<CardsTrackResponse>;
34008
34961
  /**
34009
34962
  * `GET /v1/cards/efactura` — your fiscal documents issued through Brivio with their ANAF e-Factura status
34010
34963
  * (`documents[]` + a `table` block, null when there are none). Free.
34011
34964
  */
34012
- efactura(params?: CardsEfacturaParams, opts?: CallOpts$34): Promise<CardsEfacturaResponse>;
34965
+ efactura(params?: CardsEfacturaParams, opts?: CallOpts$35): Promise<CardsEfacturaResponse>;
34013
34966
  /**
34014
34967
  * `POST /v1/cards/unfurl` — `links` block (variant `preview`) for a public https page; SSRF-guarded, cached 24 h.
34015
34968
  * Private targets throw 400 `unfurl_blocked`, non-https pages 422 `unfurl_not_https`.
34016
34969
  */
34017
- unfurl(url: string, opts?: CallOpts$34): Promise<CardsUnfurlResponse>;
34970
+ unfurl(url: string, opts?: CallOpts$35): Promise<CardsUnfurlResponse>;
34018
34971
  /**
34019
34972
  * `POST /v1/cards/product` — `products` block with one item from a public https product page's schema.org
34020
34973
  * `Product` JSON-LD (or OpenGraph product tags): name, image, price + currency (lowest offer), old price, rating
34021
34974
  * (0–5), reviews, seller, availability badge in `lang` (en default). Only what the page states; never sponsored.
34022
34975
  * SSRF-guarded like `unfurl`, cached 6 h. No product data throws 422 `product_not_found`.
34023
34976
  */
34024
- product(url: string, lang?: 'en' | 'ro', opts?: CallOpts$34): Promise<CardsProductResponse>;
34977
+ product(url: string, lang?: 'en' | 'ro', opts?: CallOpts$35): Promise<CardsProductResponse>;
34025
34978
  /**
34026
34979
  * `POST /v1/cards/render` — renders a `chart` or `qr` block to `format` (`png` default, or `svg`) at
34027
34980
  * `width` x `height` CSS px (64–1200, defaults 480 x 300; QR is square) times `scale` (1–3, PNG only).
34028
34981
  * Other block types (Mermaid `diagram`, `math`, …) throw 422 `render_unsupported`. Free; 2000 renders per day.
34029
34982
  */
34030
- render(body: CardsRenderBody, opts?: CallOpts$34): Promise<CardsRendered>;
34983
+ render(body: CardsRenderBody, opts?: CallOpts$35): Promise<CardsRendered>;
34031
34984
  }
34032
34985
  //#endregion
34033
34986
  //#region src/resources/chat.d.ts
@@ -34143,7 +35096,7 @@ export type Device = Schema<'DeviceListItem'>;
34143
35096
  export type DevicePatch = Mutable<Body<'updateDevice'>>;
34144
35097
  export type DevicePatched = Reply<'updateDevice'>;
34145
35098
  export type DispatchInbox = Reply<'getMyDispatchInbox'>;
34146
- type CallOpts$33 = {
35099
+ type CallOpts$34 = {
34147
35100
  ext?: CodaiRequestExtensions;
34148
35101
  signal?: AbortSignal;
34149
35102
  };
@@ -34151,23 +35104,23 @@ export declare class Devices {
34151
35104
  private readonly http;
34152
35105
  constructor(http: HttpClient);
34153
35106
  /** `GET /v1/devices` — most recently seen first. */
34154
- list(opts?: CallOpts$33): Promise<Device[]>;
35107
+ list(opts?: CallOpts$34): Promise<Device[]>;
34155
35108
  /** `PATCH /v1/devices/{id}` — push token and/or capabilities. */
34156
- update(id: string, body: DevicePatch, opts?: CallOpts$33): Promise<DevicePatched>;
35109
+ update(id: string, body: DevicePatch, opts?: CallOpts$34): Promise<DevicePatched>;
34157
35110
  /** `DELETE /v1/devices/{id}` */
34158
- delete(id: string, opts?: CallOpts$33): Promise<Reply<'deleteDevice'>>;
35111
+ delete(id: string, opts?: CallOpts$34): Promise<Reply<'deleteDevice'>>;
34159
35112
  /**
34160
35113
  * `POST /v1/keys/self/revoke` — the API key this client uses revokes ITSELF (sign out).
34161
35114
  * Every later call with it fails with 401.
34162
35115
  */
34163
- revokeSelfKey(opts?: CallOpts$33): Promise<Reply<'revokeSelfKey'>>;
35116
+ revokeSelfKey(opts?: CallOpts$34): Promise<Reply<'revokeSelfKey'>>;
34164
35117
  /**
34165
35118
  * `GET /v1/devices/me/dispatch?limit=` — pending controls dispatched at the
34166
35119
  * calling device (`x-codai-device` required) across all owned sessions.
34167
35120
  */
34168
35121
  dispatchInbox(query?: {
34169
35122
  limit?: number;
34170
- }, opts?: CallOpts$33): Promise<DispatchInbox>;
35123
+ }, opts?: CallOpts$34): Promise<DispatchInbox>;
34171
35124
  }
34172
35125
  //#endregion
34173
35126
  //#region src/resources/embeddings.d.ts
@@ -34230,7 +35183,7 @@ export type EnvironmentJobStartBody = Mutable<Body<'startEnvironmentJob'>>;
34230
35183
  export type EnvironmentJobStarted = Schema<'EnvironmentJobStarted'>;
34231
35184
  export type EnvironmentJob = Schema<'EnvironmentJob'>;
34232
35185
  export type GetEnvironmentJobQuery = Mutable<QueryOf<'getEnvironmentJob'>>;
34233
- type CallOpts$32 = {
35186
+ type CallOpts$33 = {
34234
35187
  ext?: CodaiRequestExtensions;
34235
35188
  signal?: AbortSignal;
34236
35189
  };
@@ -34238,70 +35191,70 @@ export declare class EnvironmentMembers {
34238
35191
  private readonly http;
34239
35192
  constructor(http: HttpClient);
34240
35193
  /** `GET /v1/environments/{id}/members` — any role. */
34241
- list(envId: string, opts?: CallOpts$32): Promise<EnvironmentMember[]>;
35194
+ list(envId: string, opts?: CallOpts$33): Promise<EnvironmentMember[]>;
34242
35195
  /** `POST /v1/environments/{id}/members` — exactly one of `user_id` / `email`. */
34243
- add(envId: string, body: EnvironmentAddMemberBody, opts?: CallOpts$32): Promise<EnvironmentMemberCreated>;
35196
+ add(envId: string, body: EnvironmentAddMemberBody, opts?: CallOpts$33): Promise<EnvironmentMemberCreated>;
34244
35197
  /** `PUT /v1/environments/{id}/members/me/ssh-key` — one `authorized_keys` line. */
34245
- setSshKey(envId: string, publicKey: string, opts?: CallOpts$32): Promise<Reply<'setMyEnvironmentSshKey'>>;
35198
+ setSshKey(envId: string, publicKey: string, opts?: CallOpts$33): Promise<Reply<'setMyEnvironmentSshKey'>>;
34246
35199
  /** `PATCH /v1/environments/{id}/members/{userId}` — 409 `last_owner` on demoting the last owner. */
34247
- setRole(envId: string, userId: string, role: EnvironmentRole, opts?: CallOpts$32): Promise<Reply<'setEnvironmentMemberRole'>['member']>;
35200
+ setRole(envId: string, userId: string, role: EnvironmentRole, opts?: CallOpts$33): Promise<Reply<'setEnvironmentMemberRole'>['member']>;
34248
35201
  /** `DELETE /v1/environments/{id}/members/{userId}` — pass your own id to leave. */
34249
- remove(envId: string, userId: string, opts?: CallOpts$32): Promise<Reply<'removeEnvironmentMember'>>;
35202
+ remove(envId: string, userId: string, opts?: CallOpts$33): Promise<Reply<'removeEnvironmentMember'>>;
34250
35203
  /** `POST /v1/environments/{id}/members/me/ssh-cert` — 12 h OpenSSH user certificate for your key. */
34251
- sshCert(envId: string, body: EnvironmentSshCertBody, opts?: CallOpts$32): Promise<EnvironmentSshCert>;
35204
+ sshCert(envId: string, body: EnvironmentSshCertBody, opts?: CallOpts$33): Promise<EnvironmentSshCert>;
34252
35205
  }
34253
35206
  /** `/v1/environments/{id}/tasks` — fire-and-forget agent tasks run in the environment. */
34254
35207
  export declare class EnvironmentTasks {
34255
35208
  private readonly http;
34256
35209
  constructor(http: HttpClient);
34257
35210
  /** `GET /v1/environments/{id}/tasks` */
34258
- list(envId: string, opts?: CallOpts$32): Promise<EnvironmentTaskList>;
35211
+ list(envId: string, opts?: CallOpts$33): Promise<EnvironmentTaskList>;
34259
35212
  /** `POST /v1/environments/{id}/tasks` — queued; you get a notification when it finishes. */
34260
- create(envId: string, body: EnvironmentTaskCreateBody, opts?: CallOpts$32): Promise<EnvironmentTaskCreated>;
35213
+ create(envId: string, body: EnvironmentTaskCreateBody, opts?: CallOpts$33): Promise<EnvironmentTaskCreated>;
34261
35214
  /** `GET /v1/environments/{id}/tasks/{taskId}` */
34262
- get(envId: string, taskId: string, opts?: CallOpts$32): Promise<EnvironmentTaskDetail>;
35215
+ get(envId: string, taskId: string, opts?: CallOpts$33): Promise<EnvironmentTaskDetail>;
34263
35216
  }
34264
35217
  /** `/v1/environments/{id}/files` — read/write/list over the relay (developer role or higher). */
34265
35218
  export declare class EnvironmentFiles {
34266
35219
  private readonly http;
34267
35220
  constructor(http: HttpClient);
34268
35221
  /** `GET /v1/environments/{id}/files?path=` — directory entries; no path → your workspace. */
34269
- list(envId: string, path?: string, opts?: CallOpts$32): Promise<EnvironmentFileList>;
35222
+ list(envId: string, path?: string, opts?: CallOpts$33): Promise<EnvironmentFileList>;
34270
35223
  /** `GET /v1/environments/{id}/files/{path}` — UTF-8 text (64 KB default, `maxBytes` ≤ 512 KB). */
34271
35224
  get(envId: string, path: string, options?: {
34272
35225
  maxBytes?: number;
34273
- } & CallOpts$32): Promise<EnvironmentFile>;
35226
+ } & CallOpts$33): Promise<EnvironmentFile>;
34274
35227
  /** `PUT /v1/environments/{id}/files/{path}` — replace with UTF-8 text (≤ 2 MB). */
34275
- put(envId: string, path: string, content: string, opts?: CallOpts$32): Promise<EnvironmentFileWritten>;
35228
+ put(envId: string, path: string, content: string, opts?: CallOpts$33): Promise<EnvironmentFileWritten>;
34276
35229
  }
34277
35230
  /** `/v1/environments/{id}/jobs` — background jobs on the environment daemon. */
34278
35231
  export declare class EnvironmentJobs {
34279
35232
  private readonly http;
34280
35233
  constructor(http: HttpClient);
34281
35234
  /** `POST /v1/environments/{id}/jobs` — returns at once with `job_id`. */
34282
- start(envId: string, body: EnvironmentJobStartBody, opts?: CallOpts$32): Promise<EnvironmentJobStarted>;
35235
+ start(envId: string, body: EnvironmentJobStartBody, opts?: CallOpts$33): Promise<EnvironmentJobStarted>;
34283
35236
  /** `GET /v1/environments/{id}/jobs/{jobId}` — status + output (`since` = previous `next_offset`). */
34284
- get(envId: string, jobId: string | number, query?: GetEnvironmentJobQuery, opts?: CallOpts$32): Promise<EnvironmentJob>;
35237
+ get(envId: string, jobId: string | number, query?: GetEnvironmentJobQuery, opts?: CallOpts$33): Promise<EnvironmentJob>;
34285
35238
  }
34286
35239
  export declare class EnvironmentPorts {
34287
35240
  private readonly http;
34288
35241
  constructor(http: HttpClient);
34289
35242
  /** `GET /v1/environments/{id}/ports` — published (forwarded) ports. */
34290
- list(envId: string, opts?: CallOpts$32): Promise<EnvironmentPort[]>;
35243
+ list(envId: string, opts?: CallOpts$33): Promise<EnvironmentPort[]>;
34291
35244
  /** `PUT /v1/environments/{id}/ports/{port}` — publish or change visibility (upsert). */
34292
- set(envId: string, port: number, body: EnvironmentPortBody, opts?: CallOpts$32): Promise<EnvironmentPort>;
35245
+ set(envId: string, port: number, body: EnvironmentPortBody, opts?: CallOpts$33): Promise<EnvironmentPort>;
34293
35246
  /** `DELETE /v1/environments/{id}/ports/{port}` — unpublish. */
34294
- remove(envId: string, port: number, opts?: CallOpts$32): Promise<Reply<'removeEnvironmentPort'>>;
35247
+ remove(envId: string, port: number, opts?: CallOpts$33): Promise<Reply<'removeEnvironmentPort'>>;
34295
35248
  }
34296
35249
  export declare class EnvironmentSecrets {
34297
35250
  private readonly http;
34298
35251
  constructor(http: HttpClient);
34299
35252
  /** `GET /v1/environments/{id}/secrets` — names and timestamps only, never values. */
34300
- list(envId: string, opts?: CallOpts$32): Promise<EnvironmentSecret[]>;
35253
+ list(envId: string, opts?: CallOpts$33): Promise<EnvironmentSecret[]>;
34301
35254
  /** `PUT /v1/environments/{id}/secrets/{name}` — upsert; `name` is `ENV_STYLE`. */
34302
- set(envId: string, name: string, value: string, opts?: CallOpts$32): Promise<EnvironmentSecretSet>;
35255
+ set(envId: string, name: string, value: string, opts?: CallOpts$33): Promise<EnvironmentSecretSet>;
34303
35256
  /** `DELETE /v1/environments/{id}/secrets/{name}` */
34304
- remove(envId: string, name: string, opts?: CallOpts$32): Promise<Reply<'removeEnvironmentSecret'>>;
35257
+ remove(envId: string, name: string, opts?: CallOpts$33): Promise<Reply<'removeEnvironmentSecret'>>;
34305
35258
  }
34306
35259
  export declare class Environments {
34307
35260
  private readonly http;
@@ -34316,41 +35269,41 @@ export declare class Environments {
34316
35269
  * `POST /v1/environments/{id}/exec` — run one relay op and wait (developer+). `op` defaults to
34317
35270
  * `shell` with `command`; 409 `environment_offline`, 504 `host_timeout`.
34318
35271
  */
34319
- exec(envId: string, body: EnvironmentExecBody, opts?: CallOpts$32): Promise<EnvironmentExecResult>;
35272
+ exec(envId: string, body: EnvironmentExecBody, opts?: CallOpts$33): Promise<EnvironmentExecResult>;
34320
35273
  /** `GET /v1/environments/{id}/ssh-ca` — CA public keys to trust (`@cert-authority` lines). */
34321
- sshCa(envId: string, opts?: CallOpts$32): Promise<EnvironmentSshCa>;
35274
+ sshCa(envId: string, opts?: CallOpts$33): Promise<EnvironmentSshCa>;
34322
35275
  /** `GET /v1/environments?project_id=&for_user_id=me` — newest first, every state. */
34323
- list(query?: ListEnvironmentsQuery, opts?: CallOpts$32): Promise<Environment[]>;
35276
+ list(query?: ListEnvironmentsQuery, opts?: CallOpts$33): Promise<Environment[]>;
34324
35277
  /**
34325
35278
  * `POST /v1/environments` — `byo` starts `pending`; managed providers start
34326
35279
  * `creating`. 409 `already_has_env` in a `vm_per_dev` project (the error
34327
35280
  * body carries the `environment_id` to reuse).
34328
35281
  */
34329
- create(body: EnvironmentCreateBody, opts?: CallOpts$32): Promise<Environment>;
35282
+ create(body: EnvironmentCreateBody, opts?: CallOpts$33): Promise<Environment>;
34330
35283
  /**
34331
35284
  * `POST /v1/environments/enroll` — daemon side. The one-time `codai_env_…`
34332
35285
  * token in the body is the only credential; the client's API key header is
34333
35286
  * ignored by this route. Managed environments additionally receive a
34334
35287
  * freshly minted `api_key`, returned exactly once.
34335
35288
  */
34336
- enroll(body: EnvironmentEnrollBody, opts?: CallOpts$32): Promise<EnvironmentEnrolled>;
35289
+ enroll(body: EnvironmentEnrollBody, opts?: CallOpts$33): Promise<EnvironmentEnrolled>;
34337
35290
  /** `GET /v1/environments/{id}` — environment, your role, members, ports, recent events. */
34338
- get(envId: string, opts?: CallOpts$32): Promise<EnvironmentDetail>;
35291
+ get(envId: string, opts?: CallOpts$33): Promise<EnvironmentDetail>;
34339
35292
  /** `PATCH /v1/environments/{id}` — `name` and/or `idle_timeout_minutes` (5..1440). */
34340
- update(envId: string, body: EnvironmentPatchBody, opts?: CallOpts$32): Promise<Environment>;
35293
+ update(envId: string, body: EnvironmentPatchBody, opts?: CallOpts$33): Promise<Environment>;
34341
35294
  /** `POST /v1/environments/{id}/start` — managed providers only (`stopped` → `starting`). */
34342
- start(envId: string, opts?: CallOpts$32): Promise<EnvironmentTransition>;
35295
+ start(envId: string, opts?: CallOpts$33): Promise<EnvironmentTransition>;
34343
35296
  /** `POST /v1/environments/{id}/stop` — managed providers only (`running` → `stopping`). */
34344
- stop(envId: string, opts?: CallOpts$32): Promise<EnvironmentTransition>;
35297
+ stop(envId: string, opts?: CallOpts$33): Promise<EnvironmentTransition>;
34345
35298
  /** `POST /v1/environments/{id}/archive` — keeps history, releases the machine. */
34346
- archive(envId: string, opts?: CallOpts$32): Promise<EnvironmentTransition>;
35299
+ archive(envId: string, opts?: CallOpts$33): Promise<EnvironmentTransition>;
34347
35300
  /** `POST /v1/environments/{id}/destroy` — owner only; terminal. */
34348
- destroy(envId: string, opts?: CallOpts$32): Promise<EnvironmentTransition>;
35301
+ destroy(envId: string, opts?: CallOpts$33): Promise<EnvironmentTransition>;
34349
35302
  /**
34350
35303
  * `POST /v1/environments/{id}/enroll-token` — `byo` only; a 30-minute
34351
35304
  * one-time token for `enroll()`. Minting again replaces the previous one.
34352
35305
  */
34353
- enrollToken(envId: string, opts?: CallOpts$32): Promise<EnvironmentEnrollToken>;
35306
+ enrollToken(envId: string, opts?: CallOpts$33): Promise<EnvironmentEnrollToken>;
34354
35307
  private transition;
34355
35308
  }
34356
35309
  //#endregion
@@ -34387,7 +35340,7 @@ export type HostExecBody = Mutable<Body<'execOnHost'>>;
34387
35340
  export type HostExecResponse = Reply<'execOnHost'>;
34388
35341
  export type HostExecRequest = Schema<'HostExecRequest'>;
34389
35342
  export type HostExecResultBody = Mutable<Body<'postHostExecResult'>>;
34390
- type CallOpts$31 = {
35343
+ type CallOpts$32 = {
34391
35344
  ext?: CodaiRequestExtensions;
34392
35345
  signal?: AbortSignal;
34393
35346
  };
@@ -34414,7 +35367,7 @@ export declare class Hosts {
34414
35367
  private readonly http;
34415
35368
  constructor(http: HttpClient);
34416
35369
  /** `GET /v1/hosts` — your devices currently connected as hosts. */
34417
- list(opts?: CallOpts$31): Promise<HostPresence[]>;
35370
+ list(opts?: CallOpts$32): Promise<HostPresence[]>;
34418
35371
  /**
34419
35372
  * `POST /v1/hosts/{deviceId}/exec` — run one op on a connected host and
34420
35373
  * block until it answers (or `timeout_ms`, default 60 s).
@@ -34422,9 +35375,9 @@ export declare class Hosts {
34422
35375
  exec(deviceId: string, op: HostOp, args?: Record<string, unknown>, extra?: {
34423
35376
  timeoutMs?: number;
34424
35377
  label?: string;
34425
- } & CallOpts$31): Promise<HostExecResponse>;
35378
+ } & CallOpts$32): Promise<HostExecResponse>;
34426
35379
  /** `POST /v1/hosts/exec/{reqId}/result` — host side: deliver an exec result. */
34427
- postResult(reqId: string, body: HostExecResultBody, opts?: CallOpts$31): Promise<Reply<'postHostExecResult'>>;
35380
+ postResult(reqId: string, body: HostExecResultBody, opts?: CallOpts$32): Promise<Reply<'postHostExecResult'>>;
34428
35381
  /**
34429
35382
  * `GET /v1/hosts/stream?os=&hostname=&roots=` — host side: announce this
34430
35383
  * device and receive `hello` / `ping` / `exec` events. Closed by the server
@@ -34434,7 +35387,7 @@ export declare class Hosts {
34434
35387
  os?: string;
34435
35388
  hostname?: string;
34436
35389
  roots?: string[];
34437
- }, opts?: CallOpts$31): AsyncGenerator<HostStreamEvent, void, undefined>;
35390
+ }, opts?: CallOpts$32): AsyncGenerator<HostStreamEvent, void, undefined>;
34438
35391
  }
34439
35392
  //#endregion
34440
35393
  //#region src/resources/assets.d.ts
@@ -34446,7 +35399,7 @@ export type AssetDeleted = Reply<'deleteAsset'>;
34446
35399
  export type AssetListQuery = QueryOf<'listAssets'>;
34447
35400
  /** `b64_json` (default, inline bytes) or `url` (stored asset + 1 h signed URL; 503 `assets_unavailable` without storage). */
34448
35401
  export type MediaResponseFormat = Schema<'MediaResponseFormat'>;
34449
- type CallOpts$30 = {
35402
+ type CallOpts$31 = {
34450
35403
  ext?: CodaiRequestExtensions;
34451
35404
  signal?: AbortSignal;
34452
35405
  };
@@ -34456,25 +35409,25 @@ export declare class Assets {
34456
35409
  private readonly http;
34457
35410
  constructor(http: HttpClient);
34458
35411
  /** `GET /v1/assets` — newest first, `limit` ≤ 100 (default 30). Paginate by passing `next_before` as `before`. */
34459
- list(query?: AssetListQuery, opts?: CallOpts$30): Promise<AssetList>;
35412
+ list(query?: AssetListQuery, opts?: CallOpts$31): Promise<AssetList>;
34460
35413
  /** Iterate every asset across pages (`list` with `before` = previous `next_before`). */
34461
- iterate(query?: Omit<AssetListQuery, 'before'>, opts?: CallOpts$30): AsyncGenerator<AssetDto, void, undefined>;
35414
+ iterate(query?: Omit<AssetListQuery, 'before'>, opts?: CallOpts$31): AsyncGenerator<AssetDto, void, undefined>;
34462
35415
  /** `GET /v1/assets/{id}` — one asset with a fresh 1 h signed `url` (`null` while not `ready`). */
34463
- retrieve(id: string, opts?: CallOpts$30): Promise<AssetDto>;
35416
+ retrieve(id: string, opts?: CallOpts$31): Promise<AssetDto>;
34464
35417
  /**
34465
35418
  * A fresh signed URL of the asset's bytes (valid 1 h), from `GET /v1/assets/{id}`. Throws when the asset has no
34466
35419
  * content yet. Use it in `<audio>`/`<video>`/`fetch` — it needs no Authorization header.
34467
35420
  */
34468
- contentUrl(id: string, opts?: CallOpts$30): Promise<string>;
35421
+ contentUrl(id: string, opts?: CallOpts$31): Promise<string>;
34469
35422
  /**
34470
35423
  * The authenticated redirect endpoint `GET /v1/assets/{id}/content` (302 to the signed URL). Useful for tools that
34471
35424
  * follow redirects with the API key (`curl -L -H 'Authorization: Bearer …'`); browsers should use `contentUrl()`.
34472
35425
  */
34473
35426
  contentPath(id: string): string;
34474
35427
  /** Download the asset's bytes (fetches the signed URL, no API key sent to storage). */
34475
- content(id: string, opts?: CallOpts$30): Promise<Uint8Array>;
35428
+ content(id: string, opts?: CallOpts$31): Promise<Uint8Array>;
34476
35429
  /** `DELETE /v1/assets/{id}` — deletes the object; signed URLs already handed out stop working. */
34477
- delete(id: string, opts?: CallOpts$30): Promise<AssetDeleted>;
35430
+ delete(id: string, opts?: CallOpts$31): Promise<AssetDeleted>;
34478
35431
  }
34479
35432
  //#endregion
34480
35433
  //#region src/resources/images.d.ts
@@ -34977,11 +35930,11 @@ export type DocumentPreview = Reply<'retrievePreview'>;
34977
35930
  export type DocumentPreviewStatus = DocumentPreview['status'];
34978
35931
  export type DocumentVideoRequest = Mutable<Body<'createDocumentVideo'>>;
34979
35932
  export type DocumentVideoAccepted = Reply<'createDocumentVideo', 202>;
34980
- type CallOpts$29 = {
35933
+ type CallOpts$30 = {
34981
35934
  ext?: CodaiRequestExtensions;
34982
35935
  signal?: AbortSignal;
34983
35936
  };
34984
- export interface DocumentPollOptions extends CallOpts$29 {
35937
+ export interface DocumentPollOptions extends CallOpts$30 {
34985
35938
  /** Delay between polls (default 3000 ms for previews, 5000 ms for videos). */
34986
35939
  pollIntervalMs?: number;
34987
35940
  /** Give up after this long (default 300 000 ms for previews, 900 000 ms for videos). */
@@ -34996,21 +35949,21 @@ export declare class Documents {
34996
35949
  * `sheet` -> `SheetSpec`); invalid specs are 400 `invalid_spec`. Files are free. `based_on` creates the next version
34997
35950
  * of one of your documents; `preview: true` also queues a (billed) preview, returned as `preview`.
34998
35951
  */
34999
- create(body: DocumentCreateRequest, opts?: CallOpts$29): Promise<StudioDocument>;
35952
+ create(body: DocumentCreateRequest, opts?: CallOpts$30): Promise<StudioDocument>;
35000
35953
  /** `GET /v1/studio/documents/{id}` — fresh 1 h signed `file.url`, the stored `spec` and `latest_preview_id`. */
35001
- retrieve(id: string, opts?: CallOpts$29): Promise<StudioDocument>;
35954
+ retrieve(id: string, opts?: CallOpts$30): Promise<StudioDocument>;
35002
35955
  /**
35003
35956
  * Queue a preview (`POST /v1/studio/documents/{id}/previews`, HTTP 202): tagged PDF, page PNGs (1280 px) and a
35004
35957
  * contact sheet. Billed once on the first poll that sees the result; at most 3 active previews per user (429).
35005
35958
  */
35006
- preview(id: string, body?: DocumentPreviewRequest, opts?: CallOpts$29): Promise<DocumentPreviewAccepted>;
35959
+ preview(id: string, body?: DocumentPreviewRequest, opts?: CallOpts$30): Promise<DocumentPreviewAccepted>;
35007
35960
  /** Poll a preview (`GET /v1/studio/previews/{id}`): `queued` | `rendering` | `succeeded` | `failed`. */
35008
- retrievePreview(previewId: string, opts?: CallOpts$29): Promise<DocumentPreview>;
35961
+ retrievePreview(previewId: string, opts?: CallOpts$30): Promise<DocumentPreview>;
35009
35962
  /**
35010
35963
  * Turn a deck into an MP4 (`POST /v1/studio/documents/{id}/video`, HTTP 202). Returns a render: poll it with
35011
35964
  * `renders.retrieve(id)` or use `videoAndWait`. Narration (`narrate`) is synthesized and billed now.
35012
35965
  */
35013
- video(id: string, body?: DocumentVideoRequest, opts?: CallOpts$29): Promise<DocumentVideoAccepted>;
35966
+ video(id: string, body?: DocumentVideoRequest, opts?: CallOpts$30): Promise<DocumentVideoAccepted>;
35014
35967
  /** Queue a preview and poll until it succeeds. Throws on `failed` or timeout. */
35015
35968
  createPreviewAndWait(id: string, opts?: DocumentPollOptions & {
35016
35969
  body?: DocumentPreviewRequest;
@@ -35032,11 +35985,11 @@ export interface LottieDownload {
35032
35985
  filename: string | null;
35033
35986
  contentType: string | null;
35034
35987
  }
35035
- type CallOpts$28 = {
35988
+ type CallOpts$29 = {
35036
35989
  ext?: CodaiRequestExtensions;
35037
35990
  signal?: AbortSignal;
35038
35991
  };
35039
- export interface ExportWaitOptions extends CallOpts$28 {
35992
+ export interface ExportWaitOptions extends CallOpts$29 {
35040
35993
  /** Delay between polls (default 3000 ms). */
35041
35994
  intervalMs?: number;
35042
35995
  /** Give up after this long (default 900 000 ms = 15 min). */
@@ -35046,7 +35999,7 @@ export declare class Exports {
35046
35999
  private readonly http;
35047
36000
  constructor(http: HttpClient);
35048
36001
  /** The export: `queued` / `running`, then `succeeded` (signed `url`, valid 1 h) or `failed` (`error`). Free. */
35049
- retrieve(id: string, opts?: CallOpts$28): Promise<StudioExport>;
36002
+ retrieve(id: string, opts?: CallOpts$29): Promise<StudioExport>;
35050
36003
  /**
35051
36004
  * Poll `retrieve` every `intervalMs` (default 3 s) until the export is `succeeded` or `failed` and resolve with it
35052
36005
  * (a `failed` export resolves too — check `status` / `error`). Throws when it is not done within `timeoutMs`
@@ -35076,11 +36029,18 @@ export type CreativeRevertResult = Reply<'revertCreative'>;
35076
36029
  export type CreativeForkRequest = Mutable<Body<'forkCreative'>>;
35077
36030
  export type CreativeLintResult = Reply<'lintCreative'>;
35078
36031
  export type CreativeCompiled = Reply<'getCreativeCompiled'>;
35079
- export type CreativeRenderRequest = Mutable<Body<'renderCreative'>>;
35080
- export type CreativeRenderAccepted = Reply<'renderCreative', 202>;
36032
+ export type CreativeRenderRequest = Mutable<Schema<'CreativeRenderRequest'>>;
36033
+ export type CreativeRenderAccepted = Schema<'CreativeRenderAccepted'>;
35081
36034
  export type CreativeRenderCached = Reply<'renderCreative', 200>;
35082
36035
  /** `render` answer: a new queued render (202, `cached: false`) or the identical existing one (200, `cached: true`). */
35083
36036
  export type CreativeRenderResult = CreativeRenderAccepted | CreativeRenderCached;
36037
+ /** `renderAudio` body (MU-05): `formats` (wav | mp3 | flac), `stems`, `lrc`, `loudness` (preset or LUFS), `title`. */
36038
+ export type CreativeAudioRenderRequest = Mutable<Schema<'CreativeAudioRenderRequest'>>;
36039
+ /** `renderAudio` answer (202): the queued mixdown with its planned `outputs` and `quote_micro_usd`. */
36040
+ export type CreativeAudioRenderAccepted = Schema<'CreativeAudioRenderAccepted'>;
36041
+ export type CreativeAudioRenderOutput = Schema<'CreativeAudioRenderOutput'>;
36042
+ /** `GET /v1/studio/renders/{id}` of an audio render (`target: 'audio'`): one `data[]` asset per output. */
36043
+ export type StudioAudioRender = Schema<'StudioAudioRender'>;
35084
36044
  export type CreativeFrameRequest = Mutable<Body<'createCreativeFrame'>>;
35085
36045
  export type CreativeFrame = Schema<'CreativeFrame'>;
35086
36046
  export type CreativeFrames = Reply<'createCreativeFrame', 200>;
@@ -35179,7 +36139,7 @@ export interface CreativeEditRequest {
35179
36139
  /** Bypass locked nodes and variables. */
35180
36140
  force?: boolean;
35181
36141
  }
35182
- type CallOpts$27 = {
36142
+ type CallOpts$28 = {
35183
36143
  ext?: CodaiRequestExtensions;
35184
36144
  signal?: AbortSignal;
35185
36145
  };
@@ -35187,49 +36147,49 @@ export declare class Creatives {
35187
36147
  private readonly http;
35188
36148
  constructor(http: HttpClient);
35189
36149
  /** List your creatives, most recently updated first (`next_before` pages). */
35190
- list(query?: CreativeListQuery, opts?: CallOpts$27): Promise<CreativeList>;
36150
+ list(query?: CreativeListQuery, opts?: CallOpts$28): Promise<CreativeList>;
35191
36151
  /**
35192
36152
  * Create a creative (`kind` + optional `title` / `doc`); without `doc` you get an empty document for the kind.
35193
36153
  * `brand_kit_id` applies one of your brand kits (`brandKits`) to version 1: `brand = { kitId, tokens }` + its logo.
35194
36154
  * `template` (+ `vars`, values by var key) starts from one of your templates (`templates`) instead of `doc`.
35195
36155
  */
35196
- create(body: CreativeCreateRequest, opts?: CallOpts$27): Promise<Creative>;
36156
+ create(body: CreativeCreateRequest, opts?: CallOpts$28): Promise<Creative>;
35197
36157
  /** The document at the head (or `seq`) with signed `assets` (1 h URLs). */
35198
36158
  retrieve(id: string, query?: {
35199
36159
  seq?: number;
35200
- }, opts?: CallOpts$27): Promise<CreativeDetail>;
36160
+ }, opts?: CallOpts$28): Promise<CreativeDetail>;
35201
36161
  /** Compact text outline (+ formats and vars) — the cheapest structure for a prompt. */
35202
- outline(id: string, opts?: CallOpts$27): Promise<CreativeOutline>;
36162
+ outline(id: string, opts?: CallOpts$28): Promise<CreativeOutline>;
35203
36163
  /** Node ids matching `query` (a string = text/name/id substring, or `{ text, type, sceneId, assetId, locked }`). */
35204
- find(id: string, query: CreativeFindRequest['query'], opts?: CallOpts$27): Promise<CreativeFindResult>;
36164
+ find(id: string, query: CreativeFindRequest['query'], opts?: CallOpts$28): Promise<CreativeFindResult>;
35205
36165
  /** Full JSON of `ids` (scene ids return whole scenes) or of one `sceneId`. */
35206
- subtree(id: string, body: CreativeSubtreeRequest, opts?: CallOpts$27): Promise<CreativeSubtree>;
36166
+ subtree(id: string, body: CreativeSubtreeRequest, opts?: CallOpts$28): Promise<CreativeSubtree>;
35207
36167
  /**
35208
36168
  * Apply an op batch (all or nothing) authored against `baseSeq`. A stale base is rebased when the touched
35209
36169
  * targets did not change meanwhile; otherwise the call throws `CodaiError` 409 `stale` (reload and retry). Rejected
35210
36170
  * ops throw 400 with `code` (`invalid`, `not_found`, `locked`, `duplicate_id`).
35211
36171
  */
35212
- edit(id: string, body: CreativeEditRequest, opts?: CallOpts$27): Promise<CreativeOpsResult>;
36172
+ edit(id: string, body: CreativeEditRequest, opts?: CallOpts$28): Promise<CreativeOpsResult>;
35213
36173
  /** Version history, newest first (`beforeSeq` pages). */
35214
36174
  versions(id: string, query?: {
35215
36175
  beforeSeq?: number;
35216
36176
  limit?: number;
35217
- }, opts?: CallOpts$27): Promise<CreativeVersionList>;
36177
+ }, opts?: CallOpts$28): Promise<CreativeVersionList>;
35218
36178
  /** New head whose document is version `seq`'s (undo / redo). */
35219
- revert(id: string, seq: number, opts?: CallOpts$27): Promise<CreativeRevertResult>;
36179
+ revert(id: string, seq: number, opts?: CallOpts$28): Promise<CreativeRevertResult>;
35220
36180
  /** New creative from version `seq` (default the head). */
35221
- fork(id: string, body?: CreativeForkRequest, opts?: CallOpts$27): Promise<Creative>;
36181
+ fork(id: string, body?: CreativeForkRequest, opts?: CallOpts$28): Promise<Creative>;
35222
36182
  /** Soft-delete the creative. */
35223
- delete(id: string, opts?: CallOpts$27): Promise<CreativeDeleted>;
36183
+ delete(id: string, opts?: CallOpts$28): Promise<CreativeDeleted>;
35224
36184
  /**
35225
36185
  * Contrast, safe area, empty text, missing assets, brand colours, platform safe zones and text floors, alt text,
35226
36186
  * missing captions, reading speed, flashing, missing / stale translations. Issues carry `format` / `fixable` /
35227
36187
  * `locale`; `fixable` counts them (`lintFix`). `locale` lints the translated document (adds
35228
36188
  * `text_overflow_locale`); 404 `Locale not found.` for an unknown locale.
35229
36189
  */
35230
- lint(id: string, body?: CreativeLintRequest, opts?: CallOpts$27): Promise<CreativeLintResult>;
36190
+ lint(id: string, body?: CreativeLintRequest, opts?: CallOpts$28): Promise<CreativeLintResult>;
35231
36191
  /** Preview HTML (signed asset URLs) for `format` / one `scene` / a translation (`locale`). */
35232
- compiled(id: string, query?: CreativeCompiledQuery, opts?: CallOpts$27): Promise<CreativeCompiled>;
36192
+ compiled(id: string, query?: CreativeCompiledQuery, opts?: CallOpts$28): Promise<CreativeCompiled>;
35233
36193
  /**
35234
36194
  * Queue an MP4 render of the head (`codai-render`, HTTP 202, `cached: false`); poll `renders.retrieve(render_id)`.
35235
36195
  * When the same render already exists for this version / format / quality / fps you get it back at once
@@ -35238,48 +36198,59 @@ export declare class Creatives {
35238
36198
  * `ai_label` (`none` | `corner` | `end_card`, EU AI Act art. 50(4)) burns a visible AI label into the video; omitted =
35239
36199
  * `corner` when the creative uses TTS narration or AI images, else `none` (`none` with narration: 400 `ai_label_required`).
35240
36200
  */
35241
- render(id: string, body?: CreativeRenderRequest, opts?: CallOpts$27): Promise<CreativeRenderResult>;
36201
+ render(id: string, body?: CreativeRenderRequest, opts?: CallOpts$28): Promise<CreativeRenderResult>;
36202
+ /**
36203
+ * Mixdown + mastering + exports of an `audio` creative (MU-05; same `POST …/render` route, HTTP 202). `formats`
36204
+ * (default `['wav', 'mp3']`), `stems: true` adds one WAV per audible track (+50 %), `lrc` exports the timed lyrics
36205
+ * (default on when the document has them), `loudness` is `streaming` (−14) | `podcast` (−16) | `broadcast` (−23) or
36206
+ * LUFS (−40…−5). Poll `renders.retrieve(render_id)`: the finished render's `data[]` holds one signed asset per output
36207
+ * (`output: mix | stem | lrc`). $0.001 per output second, minimum $0.01; held up front, billed on the measured length.
36208
+ * 400 `empty_audio` / `too_long` (20 min) / `no_lyrics`; video creatives use `render`.
36209
+ */
36210
+ renderAudio(id: string, body?: CreativeAudioRenderRequest, opts?: CallOpts$28 & {
36211
+ idempotencyKey?: string;
36212
+ }): Promise<CreativeAudioRenderAccepted>;
35242
36213
  /**
35243
36214
  * PNG still frames at up to 6 times (`t_ms`). `exact: false` (default) screenshots the compiled HTML; `exact: true`
35244
36215
  * cuts them from a draft render of the covering scenes. Waits up to ~90 s: frames (`status: 'succeeded'`) or a
35245
36216
  * running job (`status: 'running'`) to poll with `frameJob(id, frame_job_id)`. Cached frames are free; 60 frame
35246
36217
  * jobs per UTC day are free, then billed (`billed_micro_usd`).
35247
36218
  */
35248
- frame(id: string, body: CreativeFrameRequest, opts?: CallOpts$27): Promise<CreativeFrameResult>;
36219
+ frame(id: string, body: CreativeFrameRequest, opts?: CallOpts$28): Promise<CreativeFrameResult>;
35249
36220
  /**
35250
36221
  * Turn a comment pinned on a frame (`t_ms`, optional `node_id` / `scene_id`) into an edit: one bounded `codai`
35251
36222
  * model turn proposes ops, applied like `edit` against `base_seq` (rebased when possible, 409 `stale` else).
35252
36223
  * 422 `no_edit` when the model made no edit (its answer in `error.text`); `apply: false` only proposes the ops.
35253
36224
  * Token-metered like any `codai` text call.
35254
36225
  */
35255
- comment(id: string, body: CreativeCommentRequest, opts?: CallOpts$27): Promise<CreativeCommentResult>;
36226
+ comment(id: string, body: CreativeCommentRequest, opts?: CallOpts$28): Promise<CreativeCommentResult>;
35256
36227
  /**
35257
36228
  * Generate A/B variants: one bounded `codai` model turn proposes `count` (default 3) variants changing only
35258
36229
  * `focus` (default hook / title / cta); each becomes a fork of the creative at `base_seq` with the ops applied, plus
35259
36230
  * a queued draft render (`render: false` to skip; poll `renders.retrieve(render_id)`). The original is unchanged
35260
36231
  * until `pickVariant`. 422 `no_edit` when no valid variant came back, 504 `timeout` after 90 s. Token-metered.
35261
36232
  */
35262
- variants(id: string, body: CreativeVariantsRequest, opts?: CallOpts$27): Promise<CreativeVariantsResult>;
36233
+ variants(id: string, body: CreativeVariantsRequest, opts?: CallOpts$28): Promise<CreativeVariantsResult>;
35263
36234
  /** The latest variant group of a creative (`group_id: null` when none) with statuses and stored render state. */
35264
- listVariants(id: string, opts?: CallOpts$27): Promise<CreativeVariantList>;
36235
+ listVariants(id: string, opts?: CallOpts$28): Promise<CreativeVariantList>;
35265
36236
  /**
35266
36237
  * Pick the winner: its ops are applied to the original against `base_seq` (rebased when possible, 409 `stale`
35267
36238
  * else); the winner is marked `winner`, the rest of its group `rejected`.
35268
36239
  */
35269
- pickVariant(id: string, variantId: string, body: CreativeVariantPickRequest, opts?: CallOpts$27): Promise<CreativeVariantPickResult>;
36240
+ pickVariant(id: string, variantId: string, body: CreativeVariantPickRequest, opts?: CallOpts$28): Promise<CreativeVariantPickResult>;
35270
36241
  /**
35271
36242
  * Save the creative (at `seq`, default the head) as a private template: each `vars` entry turns a text node's text
35272
36243
  * (`prop: 'text'`) or an image node's asset (`prop: 'image'`) into a variable whose default is the current value.
35273
36244
  * 400 `node_not_found` / `invalid_pick` / `duplicate_key`. Free.
35274
36245
  */
35275
- saveTemplate(id: string, body: SaveTemplateRequest, opts?: CallOpts$27): Promise<CreativeTemplate>;
36246
+ saveTemplate(id: string, body: SaveTemplateRequest, opts?: CallOpts$28): Promise<CreativeTemplate>;
35276
36247
  /**
35277
36248
  * Queue an FCPXML export of a video creative (`seq`, default the head; `format`, default the first 1920×1080 /
35278
36249
  * 1080×1920 / 1080×1080 format): a zip with `project.fcpxml` + per-scene MP4 segments + audio, for Final Cut Pro,
35279
36250
  * DaVinci Resolve or Premiere. Resolves to the queued export; poll it with `exports.wait(e.id)`. Only newly
35280
36251
  * rendered seconds are billed (final render price). 400 `unsupported_kind` / `unsupported_format` / `too_long`.
35281
36252
  */
35282
- exportFcpxml(id: string, query?: ExportFcpxmlQuery, opts?: CallOpts$27): Promise<StudioExport>;
36253
+ exportFcpxml(id: string, query?: ExportFcpxmlQuery, opts?: CallOpts$28): Promise<StudioExport>;
35283
36254
  /**
35284
36255
  * Export a video creative as a Lottie animation (`seq`, default the head; `format`, default the document's default
35285
36256
  * format, or `formats: 'all'`; `container: 'json'` (default, Bodymovin JSON with embedded images) or `'dotlottie'`).
@@ -35287,33 +36258,33 @@ export declare class Creatives {
35287
36258
  * fidelity report in `warnings` (video, chart, HTML block, table, cell grid and audio nodes are not exported).
35288
36259
  * 400 `unsupported_kind` / `invalid_request`, 413 `too_large` (over 20 MB).
35289
36260
  */
35290
- exportLottie(id: string, query?: ExportLottieQuery, opts?: CallOpts$27): Promise<StudioExport>;
36261
+ exportLottie(id: string, query?: ExportLottieQuery, opts?: CallOpts$28): Promise<StudioExport>;
35291
36262
  /**
35292
36263
  * The Lottie file itself (`download=1`, nothing stored): `application/json` for one Bodymovin JSON, `application/zip`
35293
36264
  * for a dotLottie archive or a zip of JSON files (`formats: 'all'`). Same options and errors as `exportLottie`. Free.
35294
36265
  */
35295
- downloadLottie(id: string, query?: ExportLottieQuery, opts?: CallOpts$27): Promise<LottieDownload>;
36266
+ downloadLottie(id: string, query?: ExportLottieQuery, opts?: CallOpts$28): Promise<LottieDownload>;
35296
36267
  /**
35297
36268
  * Turn one of your Studio documents (deck, doc, sheet) into an editable creative — slides become scenes with a
35298
36269
  * `layout` and speaker `notes`, doc pages a `flow` group, sheets a `cell_grid`; nodes carry semantic `role`s.
35299
36270
  * Idempotent: a document that already has a creative resolves to it (`existing: true`). Free. 404 unknown document,
35300
36271
  * 409 `document_spec_missing`, 400 `invalid_spec`, 413 `too_large`.
35301
36272
  */
35302
- fromDocument(documentId: string, opts?: CallOpts$27): Promise<StudioCreativeFromDocument>;
36273
+ fromDocument(documentId: string, opts?: CallOpts$28): Promise<StudioCreativeFromDocument>;
35303
36274
  /**
35304
36275
  * Build a deck / doc / sheet creative (at `seq`, default the head) into a PPTX / DOCX / XLSX — a new version of its
35305
36276
  * Studio document (`document`, exactly the `POST /v1/studio/documents` body). Converter notes come back in
35306
36277
  * `warnings`. The file is free; `preview: true` also queues a billed preview (poll it with
35307
36278
  * `documents.waitForPreview`). 400 `not_supported_for_kind` (video / image) or `invalid_spec`.
35308
36279
  */
35309
- build(id: string, body?: CreativeBuildRequest, opts?: CallOpts$27): Promise<StudioCreativeBuild>;
36280
+ build(id: string, body?: CreativeBuildRequest, opts?: CallOpts$28): Promise<StudioCreativeBuild>;
35310
36281
  /**
35311
36282
  * Re-apply a brand kit (`brand_kit_id`) or a flat token map (`tokens`) to the creative as one new version: literal
35312
36283
  * colours equal to the old brand become token refs, `snap: true` maps every other colour to the nearest kit colour,
35313
36284
  * `fonts` (default true) sets heading / body font refs by role, locked nodes are skipped unless `force`. The kit
35314
36285
  * logo is registered too. `base_seq` defaults to the head (rebased like `edit`, 409 `stale` else). Free.
35315
36286
  */
35316
- restyle(id: string, body: CreativeRestyleRequest, opts?: CallOpts$27): Promise<CreativeRestyleResult>;
36287
+ restyle(id: string, body: CreativeRestyleRequest, opts?: CallOpts$28): Promise<CreativeRestyleResult>;
35317
36288
  /**
35318
36289
  * Auto-captions: transcribe a voice clip (`clip_id`, default the first voice clip) word by word and add or update a
35319
36290
  * captions node (`preset`, default `bold-pill`) as one new version. Words are cached on the asset (free next time
@@ -35321,83 +36292,83 @@ export declare class Creatives {
35321
36292
  * transcription is billed at the speech-to-text rate (`cost_micro_usd`). Video creatives only (400
35322
36293
  * `unsupported_kind`); 403 `residency_unavailable`, 503 `transcription_unavailable`.
35323
36294
  */
35324
- captions(id: string, body?: CreativeCaptionsRequest, opts?: CallOpts$27): Promise<CreativeCaptionsResult>;
36295
+ captions(id: string, body?: CreativeCaptionsRequest, opts?: CallOpts$28): Promise<CreativeCaptionsResult>;
35325
36296
  /** The captions as SubRip text on the document timeline (`node_id`, `seq` optional); 404 without captions. Free. */
35326
- captionsSrt(id: string, query?: CreativeCaptionsQuery, opts?: CallOpts$27): Promise<string>;
36297
+ captionsSrt(id: string, query?: CreativeCaptionsQuery, opts?: CallOpts$28): Promise<string>;
35327
36298
  /** The captions as WebVTT text on the document timeline (`node_id`, `seq` optional); 404 without captions. Free. */
35328
- captionsVtt(id: string, query?: CreativeCaptionsQuery, opts?: CallOpts$27): Promise<string>;
36299
+ captionsVtt(id: string, query?: CreativeCaptionsQuery, opts?: CallOpts$28): Promise<string>;
35329
36300
  /**
35330
36301
  * Adapt to platforms (`tiktok`, `reels`, `shorts`, `feed-square`, `feed-portrait`, `youtube`): one format per
35331
36302
  * platform in one new version, text kept inside each platform's safe zone and above its legible size.
35332
36303
  * `focal: 'vision'` (token-metered) finds the focal point of full-bleed images; it fails open. Free otherwise.
35333
36304
  */
35334
- adapt(id: string, body: CreativeAdaptRequest, opts?: CallOpts$27): Promise<CreativeAdaptResult>;
36305
+ adapt(id: string, body: CreativeAdaptRequest, opts?: CallOpts$28): Promise<CreativeAdaptResult>;
35335
36306
  /**
35336
36307
  * Fix lint issues as one new version: deterministic fixes (free) for `off_brand_color`, `text_too_small`,
35337
36308
  * `outside_platform_safe_zone` and `flashing` (`codes` limits them); `agent: true` (token-metered) gives the rest
35338
36309
  * to one `codai` turn. Nothing to fix: the current `seq`, empty `fixed`, no new version.
35339
36310
  */
35340
- lintFix(id: string, body?: CreativeLintFixRequest, opts?: CallOpts$27): Promise<CreativeLintFixResult>;
36311
+ lintFix(id: string, body?: CreativeLintFixRequest, opts?: CallOpts$28): Promise<CreativeLintFixResult>;
35341
36312
  /**
35342
36313
  * The tweak panel model: one control per variable (stored `meta.controls` entry or derived from the type). Change
35343
36314
  * values with a `setVar` op and controls with a `setControl` op (`edit`). Free.
35344
36315
  */
35345
- controls(id: string, opts?: CallOpts$27): Promise<CreativeControls>;
36316
+ controls(id: string, opts?: CallOpts$28): Promise<CreativeControls>;
35346
36317
  /**
35347
36318
  * Localisation state: source locale, glossary, unit count and per locale translated / missing / stale / voice.
35348
36319
  * With `locale` (+ `units`, default 1) also the units of that locale (paged with `offset` / `limit` ≤ 500). Free.
35349
36320
  */
35350
- locales(id: string, query?: CreativeLocalesQuery, opts?: CallOpts$27): Promise<CreativeLocaleStatus>;
36321
+ locales(id: string, query?: CreativeLocalesQuery, opts?: CallOpts$28): Promise<CreativeLocaleStatus>;
35351
36322
  /**
35352
36323
  * Translate every text into up to 10 BCP-47 `locales` as per-locale overrides (one new version, author `agent`).
35353
36324
  * Token-metered `codai` turns; `glossary` terms and the brand kit name stay verbatim, `tone` picks the address,
35354
36325
  * `only_missing` (default true) skips fresh translations, `voice: true` (video, billed) narrates voice clips again.
35355
36326
  * 400 `nothing_to_translate`; 503 `localize_unavailable` when every locale failed.
35356
36327
  */
35357
- localize(id: string, body: CreativeLocalizeRequest, opts?: CallOpts$27): Promise<CreativeLocalizeResult>;
36328
+ localize(id: string, body: CreativeLocalizeRequest, opts?: CallOpts$28): Promise<CreativeLocalizeResult>;
35358
36329
  /**
35359
36330
  * Save `locale` as a new standalone creative (translations applied, overrides dropped, `fork_of` recorded; default
35360
36331
  * title `<title> (<locale>)`). 404 `Locale not found.`. Free (HTTP 201).
35361
36332
  */
35362
- forkLocale(id: string, locale: string, body?: CreativeLocaleForkRequest, opts?: CallOpts$27): Promise<CreativeLocaleForkResult>;
36333
+ forkLocale(id: string, locale: string, body?: CreativeLocaleForkRequest, opts?: CallOpts$28): Promise<CreativeLocaleForkResult>;
35363
36334
  /**
35364
36335
  * Create a public link: `view` (read-only preview of version `seq` or the head; `allow_remix` default false) or
35365
36336
  * `review` (comments by name, no account; `can_approve` lets the holder approve). The `token` and `url` are shown
35366
36337
  * only in this answer (HTTP 201). 400 `unknown_seq`; 409 `too_many_shares` (20 active links). Free.
35367
36338
  */
35368
- createShare(id: string, body: StudioShareCreateRequest, opts?: CallOpts$27): Promise<StudioShareCreated>;
36339
+ createShare(id: string, body: StudioShareCreateRequest, opts?: CallOpts$28): Promise<StudioShareCreated>;
35369
36340
  /** The active links (not revoked, not expired), newest first; `url` is always null. Free. */
35370
- listShares(id: string, opts?: CallOpts$27): Promise<StudioShareList>;
36341
+ listShares(id: string, opts?: CallOpts$28): Promise<StudioShareList>;
35371
36342
  /** Revoke a link: it answers 404 from now on. 404 when unknown or already revoked. Free. */
35372
- revokeShare(id: string, shareId: string, opts?: CallOpts$27): Promise<void>;
36343
+ revokeShare(id: string, shareId: string, opts?: CallOpts$28): Promise<void>;
35373
36344
  /**
35374
36345
  * The review state: `status` (`draft` → `in_review` → `approved` | `changes_requested`), requested / approved
35375
36346
  * version (`approved_is_head` false once the creative changed), decider and thread counts. Free.
35376
36347
  */
35377
- review(id: string, opts?: CallOpts$27): Promise<StudioReview>;
36348
+ review(id: string, opts?: CallOpts$28): Promise<StudioReview>;
35378
36349
  /** Send the head to review (`in_review`, earlier decision cleared) so approver links can decide. Free. */
35379
- requestReview(id: string, opts?: CallOpts$27): Promise<StudioReview>;
36350
+ requestReview(id: string, opts?: CallOpts$28): Promise<StudioReview>;
35380
36351
  /** Back to `draft` (decision cleared, comments kept). Free. */
35381
- resetReview(id: string, opts?: CallOpts$27): Promise<StudioReview>;
36352
+ resetReview(id: string, opts?: CallOpts$28): Promise<StudioReview>;
35382
36353
  /** Comment threads, newest first (≤ 200), replies oldest first; `status` `open` | `resolved` | `all`. Free. */
35383
- reviewThreads(id: string, query?: StudioReviewThreadsQuery, opts?: CallOpts$27): Promise<StudioReviewThreadList>;
36354
+ reviewThreads(id: string, query?: StudioReviewThreadsQuery, opts?: CallOpts$28): Promise<StudioReviewThreadList>;
35384
36355
  /**
35385
36356
  * Start a thread as the owner, optionally anchored to `node_id` / `scene_id` / `t_ms` (checked against the head:
35386
36357
  * 400 `unknown_node` / `unknown_scene`; HTTP 201). 409 `too_many_comments`. Free.
35387
36358
  */
35388
- createReviewThread(id: string, body: StudioReviewThreadCreateRequest, opts?: CallOpts$27): Promise<StudioReviewThread>;
36359
+ createReviewThread(id: string, body: StudioReviewThreadCreateRequest, opts?: CallOpts$28): Promise<StudioReviewThread>;
35389
36360
  /** Reply in a thread as the owner (HTTP 201) — returns the whole thread. Free. */
35390
36361
  replyReviewThread(id: string, threadId: string, body: {
35391
36362
  body: string;
35392
- }, opts?: CallOpts$27): Promise<StudioReviewThread>;
36363
+ }, opts?: CallOpts$28): Promise<StudioReviewThread>;
35393
36364
  /** Resolve a thread. Free. */
35394
- resolveReviewThread(id: string, threadId: string, opts?: CallOpts$27): Promise<StudioReviewThread>;
36365
+ resolveReviewThread(id: string, threadId: string, opts?: CallOpts$28): Promise<StudioReviewThread>;
35395
36366
  /** Reopen a resolved thread. Free. */
35396
- reopenReviewThread(id: string, threadId: string, opts?: CallOpts$27): Promise<StudioReviewThread>;
36367
+ reopenReviewThread(id: string, threadId: string, opts?: CallOpts$28): Promise<StudioReviewThread>;
35397
36368
  /** Delete any comment (owner moderation; deleting a root hides the thread). 404 when unknown. Free. */
35398
- deleteReviewComment(id: string, commentId: string, opts?: CallOpts$27): Promise<void>;
36369
+ deleteReviewComment(id: string, commentId: string, opts?: CallOpts$28): Promise<void>;
35399
36370
  /** Poll a frame job: frames when done (`status: 'succeeded'`), `status: 'running'` meanwhile; 404 unknown job. */
35400
- frameJob(id: string, jobId: string, opts?: CallOpts$27): Promise<CreativeFrameResult>;
36371
+ frameJob(id: string, jobId: string, opts?: CallOpts$28): Promise<CreativeFrameResult>;
35401
36372
  }
35402
36373
  //#endregion
35403
36374
  //#region src/resources/brand-kits.d.ts
@@ -35413,7 +36384,7 @@ export type BrandKitCreateRequest = Mutable<Body<'createBrandKit'>>;
35413
36384
  export type BrandKitUpdateRequest = Mutable<Body<'updateBrandKit'>>;
35414
36385
  export type BrandKitList = Reply<'listBrandKits'>;
35415
36386
  export type BrandKitDeleted = Reply<'deleteBrandKit'>;
35416
- type CallOpts$26 = {
36387
+ type CallOpts$27 = {
35417
36388
  ext?: CodaiRequestExtensions;
35418
36389
  signal?: AbortSignal;
35419
36390
  };
@@ -35425,29 +36396,29 @@ export declare class BrandKits {
35425
36396
  * (import) — exactly one. 400 `invalid_tokens` (with `details.issues`) for an invalid DTCG document, 404 when
35426
36397
  * `logo_asset_id` is not one of your ready image assets. Free.
35427
36398
  */
35428
- create(body: BrandKitCreateRequest, opts?: CallOpts$26): Promise<BrandKit>;
36399
+ create(body: BrandKitCreateRequest, opts?: CallOpts$27): Promise<BrandKit>;
35429
36400
  /**
35430
36401
  * Edit a kit: `tokens` is merged onto the current kit, `dtcg` replaces the whole document (not both),
35431
36402
  * `logo_asset_id: null` removes the logo. Creatives keep their tokens until `creatives.restyle`. Free.
35432
36403
  */
35433
- update(id: string, body: BrandKitUpdateRequest, opts?: CallOpts$26): Promise<BrandKit>;
36404
+ update(id: string, body: BrandKitUpdateRequest, opts?: CallOpts$27): Promise<BrandKit>;
35434
36405
  /** The kit as a DTCG 2025.10 JSON document (`$extensions['ro.codai']` = kit id, name, logo asset id). Free. */
35435
- exportDtcg(id: string, opts?: CallOpts$26): Promise<BrandKitDtcg>;
36406
+ exportDtcg(id: string, opts?: CallOpts$27): Promise<BrandKitDtcg>;
35436
36407
  /**
35437
36408
  * Extract a brand kit from a public `https` page (`{ url }`) or from one of your logo images
35438
36409
  * (`{ logo_asset_id }`, PNG / JPEG / WebP up to 5 MB; it becomes the kit logo): palette (primary, secondary, accent,
35439
36410
  * background, text) and heading / body fonts. One bounded `codai` model call (token-metered); 400 `url_blocked` for
35440
36411
  * private hosts, 400 `unsupported_media` for a bad logo, 422 `fetch_failed` / `extract_failed`, 504 `timeout`.
35441
36412
  */
35442
- extract(body: BrandKitExtractRequest, opts?: CallOpts$26): Promise<BrandKit>;
36413
+ extract(body: BrandKitExtractRequest, opts?: CallOpts$27): Promise<BrandKit>;
35443
36414
  /** Your brand kits, newest first (`limit` 1–100, default 50). Free. */
35444
36415
  list(query?: {
35445
36416
  limit?: number;
35446
- }, opts?: CallOpts$26): Promise<BrandKitList>;
36417
+ }, opts?: CallOpts$27): Promise<BrandKitList>;
35447
36418
  /** One kit with a signed logo URL (1 h), its `dtcg` and the WCAG `contrast` pairs. Free. */
35448
- retrieve(id: string, opts?: CallOpts$26): Promise<BrandKit>;
36419
+ retrieve(id: string, opts?: CallOpts$27): Promise<BrandKit>;
35449
36420
  /** Delete a kit (creatives keep their tokens; the logo asset stays). Free. */
35450
- delete(id: string, opts?: CallOpts$26): Promise<BrandKitDeleted>;
36421
+ delete(id: string, opts?: CallOpts$27): Promise<BrandKitDeleted>;
35451
36422
  }
35452
36423
  //#endregion
35453
36424
  //#region src/resources/templates.d.ts
@@ -35455,7 +36426,7 @@ export type CreativeTemplateVar = Schema<'CreativeTemplateVar'>;
35455
36426
  export type CreativeTemplateList = Reply<'listCreativeTemplates'>;
35456
36427
  export type CreativeTemplateListQuery = QueryOf<'listCreativeTemplates'>;
35457
36428
  export type CreativeTemplateDeleted = Reply<'deleteCreativeTemplate'>;
35458
- type CallOpts$25 = {
36429
+ type CallOpts$26 = {
35459
36430
  ext?: CodaiRequestExtensions;
35460
36431
  signal?: AbortSignal;
35461
36432
  };
@@ -35468,25 +36439,25 @@ export declare class Templates {
35468
36439
  * (default). `kind` filters both. Without `doc`. Free. A starter id works anywhere a template id does
35469
36440
  * (`retrieve`, `creatives.create({ template })`, batches); starters cannot be deleted.
35470
36441
  */
35471
- list(query?: CreativeTemplateListQuery, opts?: CallOpts$25): Promise<CreativeTemplateList>;
36442
+ list(query?: CreativeTemplateListQuery, opts?: CallOpts$26): Promise<CreativeTemplateList>;
35472
36443
  /** One template with its variables and `doc`. Free. */
35473
- retrieve(id: string, opts?: CallOpts$25): Promise<Schema<'CreativeTemplate'>>;
36444
+ retrieve(id: string, opts?: CallOpts$26): Promise<Schema<'CreativeTemplate'>>;
35474
36445
  /** Delete a template (creatives made from it are not affected). Free. */
35475
- delete(id: string, opts?: CallOpts$25): Promise<CreativeTemplateDeleted>;
36446
+ delete(id: string, opts?: CallOpts$26): Promise<CreativeTemplateDeleted>;
35476
36447
  }
35477
36448
  //#endregion
35478
36449
  //#region src/resources/productions.d.ts
35479
36450
  export type StudioProductionCreate = Mutable<Body<'createStudioProduction'>>;
35480
36451
  export type StudioProduction = Schema<'StudioProduction'>;
35481
- type CallOpts$24 = {
36452
+ type CallOpts$25 = {
35482
36453
  ext?: CodaiRequestExtensions;
35483
36454
  signal?: AbortSignal;
35484
36455
  };
35485
- export interface ProductionCreateOptions extends CallOpts$24 {
36456
+ export interface ProductionCreateOptions extends CallOpts$25 {
35486
36457
  /** `Idempotency-Key`: a retry with the same key replays the first production instead of starting another one. */
35487
36458
  idempotencyKey?: string;
35488
36459
  }
35489
- export interface ProductionWaitOptions extends CallOpts$24 {
36460
+ export interface ProductionWaitOptions extends CallOpts$25 {
35490
36461
  /** Delay between polls (default 5000 ms). */
35491
36462
  intervalMs?: number;
35492
36463
  /** Give up after this long (default 600 000 ms = 10 min). */
@@ -35499,7 +36470,7 @@ export declare class Productions {
35499
36470
  /** `POST /v1/studio/productions` — brief → storyboard → assets → creative → queued draft render (202). */
35500
36471
  create(body: StudioProductionCreate, opts?: ProductionCreateOptions): Promise<StudioProduction>;
35501
36472
  /** `GET /v1/studio/productions/{id}` — advances the production and returns it (another account's id is a 404). */
35502
- retrieve(id: string, opts?: CallOpts$24): Promise<StudioProduction>;
36473
+ retrieve(id: string, opts?: CallOpts$25): Promise<StudioProduction>;
35503
36474
  /**
35504
36475
  * Poll `retrieve` every `intervalMs` (default 5 s) until the production `succeeded` or `failed` (a failed one
35505
36476
  * resolves too — check `status` / `error`). Throws after `timeoutMs` (default 10 min) or when `signal` aborts.
@@ -35509,6 +36480,344 @@ export declare class Productions {
35509
36480
  run(body: StudioProductionCreate, opts?: ProductionCreateOptions & ProductionWaitOptions): Promise<StudioProduction>;
35510
36481
  }
35511
36482
  //#endregion
36483
+ //#region src/resources/media-ops.d.ts
36484
+ export type MediaOpId = Schema<'MediaOpId'>;
36485
+ export type MediaOp = Schema<'MediaOp'>;
36486
+ export type MediaOpList = Reply<'listStudioMediaOps'>;
36487
+ export type MediaOpRequest = Mutable<Schema<'MediaOpRequest'>>;
36488
+ export type MediaOpQuote = Schema<'MediaOpQuote'>;
36489
+ export type MediaOpResult = Schema<'MediaOpResult'>;
36490
+ export type MediaOpJob = Schema<'MediaOpJob'>;
36491
+ type CallOpts$24 = {
36492
+ ext?: CodaiRequestExtensions;
36493
+ signal?: AbortSignal;
36494
+ };
36495
+ export interface MediaOpInput {
36496
+ /** Owned, ready Studio asset ids in the order the op expects (mask second for inpaint / erase). */
36497
+ assetIds?: string[];
36498
+ /** Per-op parameters (validated strictly by the gateway; see the docs table). */
36499
+ params?: Record<string, unknown>;
36500
+ }
36501
+ export interface MediaOpRunOptions extends CallOpts$24 {
36502
+ /** `Idempotency-Key`: a retry with the same key replays the first answer instead of running (and billing) again. */
36503
+ idempotencyKey?: string;
36504
+ }
36505
+ export interface MediaOpWaitOptions extends CallOpts$24 {
36506
+ /** Delay between polls (default 3000 ms). */
36507
+ intervalMs?: number;
36508
+ /** Give up after this long (default 1 200 000 ms = 20 min, the server-side job timeout). */
36509
+ timeoutMs?: number;
36510
+ }
36511
+ /** A run answer is a job (async op, HTTP 202) when `object` is `media_op.job`. */
36512
+ export declare const isMediaOpJob: (r: MediaOpResult | MediaOpJob) => r is MediaOpJob;
36513
+ export declare const isMediaOpJobFinished: (j: Pick<MediaOpJob, "status">) => boolean;
36514
+ export declare class MediaOps {
36515
+ private readonly http;
36516
+ constructor(http: HttpClient);
36517
+ /** `GET /v1/studio/media-ops` — every op with engine, mode, inputs, `available` and a list quote (free). */
36518
+ list(opts?: CallOpts$24): Promise<MediaOpList>;
36519
+ /** `POST /v1/studio/media-ops/{op}/quote` — exact price of this request; nothing is held or billed. */
36520
+ quote(op: MediaOpId | string, input?: MediaOpInput, opts?: CallOpts$24): Promise<MediaOpQuote>;
36521
+ /**
36522
+ * `POST /v1/studio/media-ops/{op}` — sync ops resolve to a `media_op.result` with the outputs, async ops to a
36523
+ * `media_op.job` (`status: pending`; poll with `job` / `wait`). Use `isMediaOpJob` to tell them apart.
36524
+ */
36525
+ run(op: MediaOpId | string, input?: MediaOpInput, opts?: MediaOpRunOptions): Promise<MediaOpResult | MediaOpJob>;
36526
+ /** `GET /v1/studio/media-ops/jobs/{id}` — the job; reading a finished one stores its outputs and bills it once. */
36527
+ job(id: string, opts?: CallOpts$24): Promise<MediaOpJob>;
36528
+ /**
36529
+ * Poll `job` every `intervalMs` (default 3 s) until it is `ready` or `failed` (a failed job resolves too — check
36530
+ * `status` / `error`). Throws after `timeoutMs` (default 20 min) or when `signal` aborts.
36531
+ */
36532
+ wait(id: string, opts?: MediaOpWaitOptions): Promise<MediaOpJob>;
36533
+ /** `run`, then `wait` when the op is async. */
36534
+ runAndWait(op: MediaOpId | string, input?: MediaOpInput, opts?: MediaOpRunOptions & MediaOpWaitOptions): Promise<MediaOpResult | MediaOpJob>;
36535
+ }
36536
+ //#endregion
36537
+ //#region src/resources/lyrics.d.ts
36538
+ export type LyricsRequest = Mutable<Schema<'StudioLyricsRequest'>>;
36539
+ export type LyricsSectionKind = Schema<'StudioLyricsSectionKind'>;
36540
+ export type LyricsLine = Schema<'StudioLyricsLine'>;
36541
+ export type Lyrics = Schema<'StudioLyrics'>;
36542
+ export type LyricsAlignRequest = Mutable<Schema<'StudioLyricsAlignRequest'>>;
36543
+ export type LyricsAlignment = Schema<'StudioLyricsAlignment'>;
36544
+ export interface LyricsCallOptions {
36545
+ ext?: CodaiRequestExtensions;
36546
+ signal?: AbortSignal;
36547
+ /** `Idempotency-Key`: a retry with the same key replays the first answer instead of running (and billing) again. */
36548
+ idempotencyKey?: string;
36549
+ }
36550
+ export declare class LyricsResource {
36551
+ private readonly http;
36552
+ constructor(http: HttpClient);
36553
+ private post;
36554
+ /**
36555
+ * `POST /v1/studio/lyrics` — `{ brief, language: 'ro' | 'en', genre?, mood?, structure?, syllables_per_line?,
36556
+ * rhyme_scheme?, lines_per_section?, title? }` → `studio.lyrics` with every line's syllables and rhyme letter, the
36557
+ * whole song as `text` (`[kind]` headers) and a `report`. `repaired: true` when the repair turn won.
36558
+ */
36559
+ write(body: LyricsRequest, opts?: LyricsCallOptions): Promise<Lyrics>;
36560
+ /**
36561
+ * `POST /v1/studio/lyrics/align` — `{ creative_id, clip_id, lyrics_text, language?, apply?, base_seq?,
36562
+ * retranscribe? }` → `studio.lyrics_alignment`: timed `lines`, `lrc`, `match_ratio`, `cached`, and `seq` /
36563
+ * `doc_hash` of the new version when applied.
36564
+ */
36565
+ align(body: LyricsAlignRequest, opts?: LyricsCallOptions): Promise<LyricsAlignment>;
36566
+ }
36567
+ //#endregion
36568
+ //#region src/resources/realtime.d.ts
36569
+ /**
36570
+ * `wss://…/v1/realtime` — dependency-free realtime client (live transcription and the OpenAI
36571
+ * Realtime protocol lanes). Not an OpenAPI operation (OpenAPI cannot describe WebSockets), so it is
36572
+ * outside the `OPERATION_METHODS` parity table.
36573
+ *
36574
+ * const live = codai.realtime.connect({ model: 'codai-transcribe-live', language: 'ro', token });
36575
+ * live.appendAudio(pcm16At24kHz); // Int16Array | ArrayBuffer | Uint8Array
36576
+ * for await (const ev of live) {
36577
+ * if (ev.type === 'conversation.item.input_audio_transcription.delta') draw(ev.delta);
36578
+ * }
36579
+ *
36580
+ * Uses the global `WebSocket` (browsers, Node ≥ 22, Deno, Bun) or an injected constructor.
36581
+ * - Browser path: pass an ephemeral `token` (scope `realtime` or `live`); it travels as `?key=`.
36582
+ * Raw `codai_` keys in the query string are refused by the gateway (close 4401).
36583
+ * - Server path: pass `apiKey` (or a token) with a WebSocket constructor that accepts headers
36584
+ * (e.g. `ws`); it is sent as `Authorization: Bearer` on the upgrade.
36585
+ */
36586
+ /** Minimal WebSocket surface (browser `WebSocket`, Node 22 global, or the `ws` package). */
36587
+ export interface RealtimeSocket {
36588
+ readonly readyState: number;
36589
+ binaryType?: string;
36590
+ send(data: string | ArrayBuffer | ArrayBufferView): void;
36591
+ close(code?: number, reason?: string): void;
36592
+ onopen: ((ev: unknown) => void) | null;
36593
+ onmessage: ((ev: {
36594
+ data: unknown;
36595
+ }) => void) | null;
36596
+ onclose: ((ev: {
36597
+ code: number;
36598
+ reason: string;
36599
+ }) => void) | null;
36600
+ onerror: ((ev: unknown) => void) | null;
36601
+ }
36602
+ /** `new (url, protocols?, options?)` — the third argument is used for headers by `ws`. */
36603
+ export type RealtimeSocketCtor = new (url: string, protocols?: string | string[], options?: {
36604
+ headers?: Record<string, string>;
36605
+ }) => RealtimeSocket;
36606
+ export type RealtimeModel = 'codai-transcribe-live' | 'codai-realtime' | 'codai-voice' | (string & Record<never, never>);
36607
+ export interface RealtimeConnectOptions {
36608
+ /** Default `codai-transcribe-live`. */
36609
+ model?: RealtimeModel;
36610
+ /** Language hint (`ro`, `en`, …). `ro` uses the Deepgram Nova-3 lane when the gateway has it. */
36611
+ language?: string;
36612
+ /** Ephemeral token (scope `realtime` or `live`) — sent as `?key=`. Required in browsers. */
36613
+ token?: string;
36614
+ /** Raw API key — sent as `Authorization: Bearer` (needs a ctor that supports headers). */
36615
+ apiKey?: string;
36616
+ /** Conversation id recorded on the usage row (`?session_id=`). */
36617
+ sessionId?: string;
36618
+ /**
36619
+ * First frame sent on open. Default for `codai-transcribe-live`: a transcription
36620
+ * `session.update` (PCM 24 kHz, `language` when set). Pass `null` to send nothing.
36621
+ */
36622
+ sessionUpdate?: Record<string, unknown> | null;
36623
+ /** Injectable WebSocket constructor (tests, `ws` on older Node). Defaults to `globalThis.WebSocket`. */
36624
+ WebSocket?: RealtimeSocketCtor;
36625
+ /** Override the gateway base URL (default: the client's `baseUrl`). */
36626
+ baseUrl?: string;
36627
+ }
36628
+ /** Typed subset of server events; anything else arrives as `RealtimeUnknownEvent`. */
36629
+ export type RealtimeEvent = {
36630
+ type: 'session.created' | 'session.updated';
36631
+ session?: Record<string, unknown>;
36632
+ event_id?: string;
36633
+ } | {
36634
+ type: 'conversation.item.input_audio_transcription.delta';
36635
+ item_id: string;
36636
+ content_index?: number;
36637
+ delta: string;
36638
+ event_id?: string;
36639
+ } | {
36640
+ type: 'conversation.item.input_audio_transcription.completed';
36641
+ item_id: string;
36642
+ content_index?: number;
36643
+ transcript: string;
36644
+ event_id?: string;
36645
+ } | {
36646
+ type: 'input_audio_buffer.committed';
36647
+ item_id?: string;
36648
+ previous_item_id?: string | null;
36649
+ } | {
36650
+ type: 'input_audio_buffer.cleared';
36651
+ } | {
36652
+ type: 'error';
36653
+ error: {
36654
+ type?: string;
36655
+ code?: string;
36656
+ message?: string;
36657
+ };
36658
+ } |
36659
+ /** Emitted by the client itself when the socket closes (always the last event). */
36660
+ {
36661
+ type: 'close';
36662
+ code: number;
36663
+ reason: string;
36664
+ };
36665
+ export type RealtimeUnknownEvent = {
36666
+ type: string;
36667
+ [k: string]: unknown;
36668
+ };
36669
+ export type RealtimeAnyEvent = RealtimeEvent | RealtimeUnknownEvent;
36670
+ type Listener$1 = (ev: RealtimeAnyEvent) => void;
36671
+ /** A live realtime session: async-iterable of events + `on()` listeners. */
36672
+ export declare class RealtimeSession implements AsyncIterable<RealtimeAnyEvent> {
36673
+ readonly socket: RealtimeSocket;
36674
+ private readonly listeners;
36675
+ private readonly queue;
36676
+ private readonly waiters;
36677
+ private readonly outbox;
36678
+ private closed;
36679
+ /** Resolves when the socket is open (rejects if it closes first). */
36680
+ readonly ready: Promise<void>;
36681
+ constructor(socket: RealtimeSocket, firstFrame: Record<string, unknown> | null);
36682
+ /** Listen for one event type (`'*'` = every event). Returns an unsubscribe function. */
36683
+ on(type: string, fn: Listener$1): () => void;
36684
+ /** Send any client event (JSON). Queued until the socket opens. */
36685
+ send(event: Record<string, unknown>): void;
36686
+ /** Append PCM16 little-endian mono audio (24 kHz for `codai-transcribe-live`). */
36687
+ appendAudio(audio: Int16Array | ArrayBuffer | Uint8Array): void;
36688
+ /** Close the current utterance: the server answers with one `...transcription.completed`. */
36689
+ commit(): void;
36690
+ /** Drop audio the server holds for the current utterance. */
36691
+ clear(): void;
36692
+ close(code?: number, reason?: string): void;
36693
+ [Symbol.asyncIterator](): AsyncIterator<RealtimeAnyEvent>;
36694
+ private emit;
36695
+ }
36696
+ /** Build the `wss://…/v1/realtime?…` URL (exported for tests and custom transports). */
36697
+ export declare function realtimeUrl(baseUrl: string, opts: RealtimeConnectOptions): string;
36698
+ export declare class Realtime {
36699
+ private readonly defaults;
36700
+ constructor(defaults: {
36701
+ baseUrl: string;
36702
+ apiKey?: string;
36703
+ });
36704
+ /** Open a realtime session. Returns immediately; `await session.ready` to wait for the socket. */
36705
+ connect(opts?: RealtimeConnectOptions): RealtimeSession;
36706
+ }
36707
+ //#endregion
36708
+ //#region src/resources/jam.d.ts
36709
+ export declare const JAM_SUBPROTOCOL = "codai-jam";
36710
+ /** WebSocket close codes of `/v1/studio/jam`. */
36711
+ export declare const JAM_CLOSE_CODES: {
36712
+ readonly invalidMessage: 4400;
36713
+ readonly unauthorized: 4401;
36714
+ readonly insufficientFunds: 4402;
36715
+ readonly forbidden: 4403;
36716
+ readonly maxDuration: 4408;
36717
+ readonly busy: 4409;
36718
+ readonly upstream: 4502;
36719
+ readonly unavailable: 4503;
36720
+ };
36721
+ export declare const JAM_SCALES: readonly ["SCALE_UNSPECIFIED", "C_MAJOR_A_MINOR", "D_FLAT_MAJOR_B_FLAT_MINOR", "D_MAJOR_B_MINOR", "E_FLAT_MAJOR_C_MINOR", "E_MAJOR_D_FLAT_MINOR", "F_MAJOR_D_MINOR", "G_FLAT_MAJOR_E_FLAT_MINOR", "G_MAJOR_E_MINOR", "A_FLAT_MAJOR_F_MINOR", "A_MAJOR_G_FLAT_MINOR", "B_FLAT_MAJOR_G_MINOR", "B_MAJOR_A_FLAT_MINOR"];
36722
+ export type JamScale = (typeof JAM_SCALES)[number];
36723
+ /** A weighted prompt: 1..8 per message, `weight` in [-10, 10] and not 0. */
36724
+ export interface JamPrompt {
36725
+ text: string;
36726
+ weight: number;
36727
+ }
36728
+ /** Partial config; the server merges it into the last full config. bpm / scale changes reset the context. */
36729
+ export interface JamConfig {
36730
+ bpm?: number;
36731
+ density?: number;
36732
+ brightness?: number;
36733
+ scale?: JamScale;
36734
+ }
36735
+ export type JamClientMessage = {
36736
+ type: 'prompts';
36737
+ prompts: JamPrompt[];
36738
+ } | ({
36739
+ type: 'config';
36740
+ } & JamConfig) | {
36741
+ type: 'play' | 'pause' | 'stop' | 'reset';
36742
+ };
36743
+ export type JamState = 'connecting' | 'ready' | 'playing' | 'paused' | 'stopped' | (string & Record<never, never>);
36744
+ export type JamEvent = {
36745
+ type: 'status';
36746
+ state: JamState;
36747
+ remaining_ms: number;
36748
+ sample_rate?: number;
36749
+ channels?: number;
36750
+ } | {
36751
+ type: 'filtered';
36752
+ text: string;
36753
+ reason: string;
36754
+ } | {
36755
+ type: 'error';
36756
+ code: string;
36757
+ message: string;
36758
+ } |
36759
+ /** Emitted by the client for every binary frame. */
36760
+ {
36761
+ type: 'audio';
36762
+ data: ArrayBuffer;
36763
+ } |
36764
+ /** Emitted by the client itself when the socket closes (always the last event). */
36765
+ {
36766
+ type: 'close';
36767
+ code: number;
36768
+ reason: string;
36769
+ };
36770
+ export interface JamConnectOptions {
36771
+ /** Ephemeral token (scope `realtime` or `live`) — sent as the `bearer.<token>` subprotocol. Required in browsers. */
36772
+ token?: string;
36773
+ /** API key — sent as `Authorization: Bearer` (needs a ctor that supports headers). */
36774
+ apiKey?: string;
36775
+ /** Conversation id recorded on the usage row (`?session_id=`). */
36776
+ sessionId?: string;
36777
+ /** Injectable WebSocket constructor (tests, `ws` on older Node). Defaults to `globalThis.WebSocket`. */
36778
+ WebSocket?: RealtimeSocketCtor;
36779
+ /** Override the gateway base URL (default: the client's `baseUrl`). */
36780
+ baseUrl?: string;
36781
+ }
36782
+ type Listener<T extends JamEvent['type']> = (ev: Extract<JamEvent, {
36783
+ type: T;
36784
+ }>) => void;
36785
+ type AnyListener = (ev: JamEvent) => void;
36786
+ /** A live jam session: `on()` listeners for status / audio / errors and typed senders. */
36787
+ export declare class JamSession {
36788
+ readonly socket: RealtimeSocket;
36789
+ private readonly listeners;
36790
+ private readonly outbox;
36791
+ private closed;
36792
+ /** Resolves when the socket is open (rejects if it closes first). */
36793
+ readonly ready: Promise<void>;
36794
+ constructor(socket: RealtimeSocket);
36795
+ /** Listen for one event type (`'*'` = every event). Returns an unsubscribe function. */
36796
+ on<T extends JamEvent['type']>(type: T, fn: Listener<T>): () => void;
36797
+ on(type: '*', fn: AnyListener): () => void;
36798
+ /** Send one client message (JSON). Queued until the socket opens. */
36799
+ send(msg: JamClientMessage): void;
36800
+ prompts(prompts: JamPrompt[]): void;
36801
+ config(config: JamConfig): void;
36802
+ play(): void;
36803
+ pause(): void;
36804
+ stop(): void;
36805
+ reset(): void;
36806
+ close(code?: number, reason?: string): void;
36807
+ private emit;
36808
+ }
36809
+ /** Build the `wss://…/v1/studio/jam` URL (exported for tests and custom transports). */
36810
+ export declare function jamUrl(baseUrl: string, opts?: Pick<JamConnectOptions, 'sessionId'>): string;
36811
+ export declare class Jam {
36812
+ private readonly defaults;
36813
+ constructor(defaults: {
36814
+ baseUrl: string;
36815
+ apiKey?: string;
36816
+ });
36817
+ /** Open a live jam. Returns immediately; `await session.ready` to wait for the socket. */
36818
+ connect(opts?: JamConnectOptions): JamSession;
36819
+ }
36820
+ //#endregion
35512
36821
  //#region src/resources/batches.d.ts
35513
36822
  export type StudioBatchStatus = Schema<'StudioBatchStatus'>;
35514
36823
  export type StudioBatchRowStatus = Schema<'StudioBatchRowStatus'>;
@@ -35930,146 +37239,6 @@ export declare class Projects {
35930
37239
  delete(projectId: string, opts?: CallOpts$19): Promise<Reply<'deleteProject'>>;
35931
37240
  }
35932
37241
  //#endregion
35933
- //#region src/resources/realtime.d.ts
35934
- /**
35935
- * `wss://…/v1/realtime` — dependency-free realtime client (live transcription and the OpenAI
35936
- * Realtime protocol lanes). Not an OpenAPI operation (OpenAPI cannot describe WebSockets), so it is
35937
- * outside the `OPERATION_METHODS` parity table.
35938
- *
35939
- * const live = codai.realtime.connect({ model: 'codai-transcribe-live', language: 'ro', token });
35940
- * live.appendAudio(pcm16At24kHz); // Int16Array | ArrayBuffer | Uint8Array
35941
- * for await (const ev of live) {
35942
- * if (ev.type === 'conversation.item.input_audio_transcription.delta') draw(ev.delta);
35943
- * }
35944
- *
35945
- * Uses the global `WebSocket` (browsers, Node ≥ 22, Deno, Bun) or an injected constructor.
35946
- * - Browser path: pass an ephemeral `token` (scope `realtime` or `live`); it travels as `?key=`.
35947
- * Raw `codai_` keys in the query string are refused by the gateway (close 4401).
35948
- * - Server path: pass `apiKey` (or a token) with a WebSocket constructor that accepts headers
35949
- * (e.g. `ws`); it is sent as `Authorization: Bearer` on the upgrade.
35950
- */
35951
- /** Minimal WebSocket surface (browser `WebSocket`, Node 22 global, or the `ws` package). */
35952
- export interface RealtimeSocket {
35953
- readonly readyState: number;
35954
- binaryType?: string;
35955
- send(data: string | ArrayBuffer | ArrayBufferView): void;
35956
- close(code?: number, reason?: string): void;
35957
- onopen: ((ev: unknown) => void) | null;
35958
- onmessage: ((ev: {
35959
- data: unknown;
35960
- }) => void) | null;
35961
- onclose: ((ev: {
35962
- code: number;
35963
- reason: string;
35964
- }) => void) | null;
35965
- onerror: ((ev: unknown) => void) | null;
35966
- }
35967
- /** `new (url, protocols?, options?)` — the third argument is used for headers by `ws`. */
35968
- export type RealtimeSocketCtor = new (url: string, protocols?: string | string[], options?: {
35969
- headers?: Record<string, string>;
35970
- }) => RealtimeSocket;
35971
- export type RealtimeModel = 'codai-transcribe-live' | 'codai-realtime' | 'codai-voice' | (string & Record<never, never>);
35972
- export interface RealtimeConnectOptions {
35973
- /** Default `codai-transcribe-live`. */
35974
- model?: RealtimeModel;
35975
- /** Language hint (`ro`, `en`, …). `ro` uses the Deepgram Nova-3 lane when the gateway has it. */
35976
- language?: string;
35977
- /** Ephemeral token (scope `realtime` or `live`) — sent as `?key=`. Required in browsers. */
35978
- token?: string;
35979
- /** Raw API key — sent as `Authorization: Bearer` (needs a ctor that supports headers). */
35980
- apiKey?: string;
35981
- /** Conversation id recorded on the usage row (`?session_id=`). */
35982
- sessionId?: string;
35983
- /**
35984
- * First frame sent on open. Default for `codai-transcribe-live`: a transcription
35985
- * `session.update` (PCM 24 kHz, `language` when set). Pass `null` to send nothing.
35986
- */
35987
- sessionUpdate?: Record<string, unknown> | null;
35988
- /** Injectable WebSocket constructor (tests, `ws` on older Node). Defaults to `globalThis.WebSocket`. */
35989
- WebSocket?: RealtimeSocketCtor;
35990
- /** Override the gateway base URL (default: the client's `baseUrl`). */
35991
- baseUrl?: string;
35992
- }
35993
- /** Typed subset of server events; anything else arrives as `RealtimeUnknownEvent`. */
35994
- export type RealtimeEvent = {
35995
- type: 'session.created' | 'session.updated';
35996
- session?: Record<string, unknown>;
35997
- event_id?: string;
35998
- } | {
35999
- type: 'conversation.item.input_audio_transcription.delta';
36000
- item_id: string;
36001
- content_index?: number;
36002
- delta: string;
36003
- event_id?: string;
36004
- } | {
36005
- type: 'conversation.item.input_audio_transcription.completed';
36006
- item_id: string;
36007
- content_index?: number;
36008
- transcript: string;
36009
- event_id?: string;
36010
- } | {
36011
- type: 'input_audio_buffer.committed';
36012
- item_id?: string;
36013
- previous_item_id?: string | null;
36014
- } | {
36015
- type: 'input_audio_buffer.cleared';
36016
- } | {
36017
- type: 'error';
36018
- error: {
36019
- type?: string;
36020
- code?: string;
36021
- message?: string;
36022
- };
36023
- } |
36024
- /** Emitted by the client itself when the socket closes (always the last event). */
36025
- {
36026
- type: 'close';
36027
- code: number;
36028
- reason: string;
36029
- };
36030
- export type RealtimeUnknownEvent = {
36031
- type: string;
36032
- [k: string]: unknown;
36033
- };
36034
- export type RealtimeAnyEvent = RealtimeEvent | RealtimeUnknownEvent;
36035
- type Listener = (ev: RealtimeAnyEvent) => void;
36036
- /** A live realtime session: async-iterable of events + `on()` listeners. */
36037
- export declare class RealtimeSession implements AsyncIterable<RealtimeAnyEvent> {
36038
- readonly socket: RealtimeSocket;
36039
- private readonly listeners;
36040
- private readonly queue;
36041
- private readonly waiters;
36042
- private readonly outbox;
36043
- private closed;
36044
- /** Resolves when the socket is open (rejects if it closes first). */
36045
- readonly ready: Promise<void>;
36046
- constructor(socket: RealtimeSocket, firstFrame: Record<string, unknown> | null);
36047
- /** Listen for one event type (`'*'` = every event). Returns an unsubscribe function. */
36048
- on(type: string, fn: Listener): () => void;
36049
- /** Send any client event (JSON). Queued until the socket opens. */
36050
- send(event: Record<string, unknown>): void;
36051
- /** Append PCM16 little-endian mono audio (24 kHz for `codai-transcribe-live`). */
36052
- appendAudio(audio: Int16Array | ArrayBuffer | Uint8Array): void;
36053
- /** Close the current utterance: the server answers with one `...transcription.completed`. */
36054
- commit(): void;
36055
- /** Drop audio the server holds for the current utterance. */
36056
- clear(): void;
36057
- close(code?: number, reason?: string): void;
36058
- [Symbol.asyncIterator](): AsyncIterator<RealtimeAnyEvent>;
36059
- private emit;
36060
- }
36061
- /** Build the `wss://…/v1/realtime?…` URL (exported for tests and custom transports). */
36062
- export declare function realtimeUrl(baseUrl: string, opts: RealtimeConnectOptions): string;
36063
- export declare class Realtime {
36064
- private readonly defaults;
36065
- constructor(defaults: {
36066
- baseUrl: string;
36067
- apiKey?: string;
36068
- });
36069
- /** Open a realtime session. Returns immediately; `await session.ready` to wait for the socket. */
36070
- connect(opts?: RealtimeConnectOptions): RealtimeSession;
36071
- }
36072
- //#endregion
36073
37242
  //#region src/resources/referrals.d.ts
36074
37243
  export type ReferralsView = Reply<'getReferrals'>;
36075
37244
  export type ReferralRow = Schema<'ReferralRow'>;
@@ -38459,6 +39628,11 @@ export interface AppKeyMintInput {
38459
39628
  maxOutputTokens?: number;
38460
39629
  /** ISO 8601 with offset, in the future. Omit = never expires. */
38461
39630
  expiresAt?: string;
39631
+ /**
39632
+ * The end user confirmed being 18 or older in your app. Stored on the codai user when it is
39633
+ * CREATED by this call (`users.adult_confirmed_at`, version `host:<app slug>`).
39634
+ */
39635
+ adultConfirmed?: boolean;
38462
39636
  }
38463
39637
  export interface AppKeyMinted {
38464
39638
  id: string;
@@ -38601,6 +39775,8 @@ export interface AppSubscriptionSyncInput {
38601
39775
  object?: unknown;
38602
39776
  };
38603
39777
  };
39778
+ /** The end user confirmed being 18 or older (stored when the codai user is created by this sync). */
39779
+ adultConfirmed?: boolean;
38604
39780
  }
38605
39781
  export interface AppKeyValidation {
38606
39782
  ok: boolean;
@@ -38776,6 +39952,12 @@ export declare class Codai {
38776
39952
  readonly templates: Templates;
38777
39953
  /** codai Studio productions (`productions.run({ brief, language: 'ro' })` → a finished promo video + editable creative). */
38778
39954
  readonly productions: Productions;
39955
+ /** codai Studio media operations (`mediaOps.run('audio.separate_stems', { assetIds })` → job; `mediaOps.wait(id)`). */
39956
+ readonly mediaOps: MediaOps;
39957
+ /** codai Studio lyrics (`lyrics.write({ brief, language: 'ro' })`, `lyrics.align({ creative_id, clip_id, lyrics_text })`). */
39958
+ readonly lyrics: LyricsResource;
39959
+ /** codai Studio live jam over WebSocket (`jam.connect({ token })` → PCM16 48 kHz stereo; `prompts`, `config`, `play`). */
39960
+ readonly jam: Jam;
38779
39961
  /** codai Studio FCPXML exports (`creatives.exportFcpxml(id)` queues one; `exports.wait(id)` polls until the zip is ready). */
38780
39962
  readonly exports: Exports;
38781
39963
  /** codai Studio batches (`batches.create({ source: { template_id }, csv })` → one creative per row; `batches.wait(id)`). */