@clear-street/clearstreet 0.99.0 → 0.101.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.
Files changed (98) hide show
  1. package/CHANGELOG.md +23 -0
  2. package/package.json +1 -1
  3. package/resources/v1/index.d.mts +3 -3
  4. package/resources/v1/index.d.mts.map +1 -1
  5. package/resources/v1/index.d.ts +3 -3
  6. package/resources/v1/index.d.ts.map +1 -1
  7. package/resources/v1/index.js.map +1 -1
  8. package/resources/v1/index.mjs.map +1 -1
  9. package/resources/v1/instrument-data/market-data.d.mts +90 -20
  10. package/resources/v1/instrument-data/market-data.d.mts.map +1 -1
  11. package/resources/v1/instrument-data/market-data.d.ts +90 -20
  12. package/resources/v1/instrument-data/market-data.d.ts.map +1 -1
  13. package/resources/v1/instrument-data/market-data.js +5 -7
  14. package/resources/v1/instrument-data/market-data.js.map +1 -1
  15. package/resources/v1/instrument-data/market-data.mjs +5 -7
  16. package/resources/v1/instrument-data/market-data.mjs.map +1 -1
  17. package/resources/v1/instruments.d.mts +45 -3
  18. package/resources/v1/instruments.d.mts.map +1 -1
  19. package/resources/v1/instruments.d.ts +45 -3
  20. package/resources/v1/instruments.d.ts.map +1 -1
  21. package/resources/v1/omni-ai/index.d.mts +1 -1
  22. package/resources/v1/omni-ai/index.d.mts.map +1 -1
  23. package/resources/v1/omni-ai/index.d.ts +1 -1
  24. package/resources/v1/omni-ai/index.d.ts.map +1 -1
  25. package/resources/v1/omni-ai/index.js.map +1 -1
  26. package/resources/v1/omni-ai/index.mjs.map +1 -1
  27. package/resources/v1/omni-ai/messages.d.mts +17 -17
  28. package/resources/v1/omni-ai/messages.d.mts.map +1 -1
  29. package/resources/v1/omni-ai/messages.d.ts +17 -17
  30. package/resources/v1/omni-ai/messages.d.ts.map +1 -1
  31. package/resources/v1/omni-ai/messages.js +9 -11
  32. package/resources/v1/omni-ai/messages.js.map +1 -1
  33. package/resources/v1/omni-ai/messages.mjs +9 -11
  34. package/resources/v1/omni-ai/messages.mjs.map +1 -1
  35. package/resources/v1/omni-ai/omni-ai.d.mts +9 -3
  36. package/resources/v1/omni-ai/omni-ai.d.mts.map +1 -1
  37. package/resources/v1/omni-ai/omni-ai.d.ts +9 -3
  38. package/resources/v1/omni-ai/omni-ai.d.ts.map +1 -1
  39. package/resources/v1/omni-ai/omni-ai.js.map +1 -1
  40. package/resources/v1/omni-ai/omni-ai.mjs.map +1 -1
  41. package/resources/v1/omni-ai/responses.d.mts +21 -21
  42. package/resources/v1/omni-ai/responses.d.mts.map +1 -1
  43. package/resources/v1/omni-ai/responses.d.ts +21 -21
  44. package/resources/v1/omni-ai/responses.d.ts.map +1 -1
  45. package/resources/v1/omni-ai/responses.js +14 -18
  46. package/resources/v1/omni-ai/responses.js.map +1 -1
  47. package/resources/v1/omni-ai/responses.mjs +14 -18
  48. package/resources/v1/omni-ai/responses.mjs.map +1 -1
  49. package/resources/v1/omni-ai/threads.d.mts +124 -64
  50. package/resources/v1/omni-ai/threads.d.mts.map +1 -1
  51. package/resources/v1/omni-ai/threads.d.ts +124 -64
  52. package/resources/v1/omni-ai/threads.d.ts.map +1 -1
  53. package/resources/v1/omni-ai/threads.js +41 -51
  54. package/resources/v1/omni-ai/threads.js.map +1 -1
  55. package/resources/v1/omni-ai/threads.mjs +41 -51
  56. package/resources/v1/omni-ai/threads.mjs.map +1 -1
  57. package/resources/v1/orders.d.mts +107 -8
  58. package/resources/v1/orders.d.mts.map +1 -1
  59. package/resources/v1/orders.d.ts +107 -8
  60. package/resources/v1/orders.d.ts.map +1 -1
  61. package/resources/v1/positions.d.mts +52 -1
  62. package/resources/v1/positions.d.mts.map +1 -1
  63. package/resources/v1/positions.d.ts +52 -1
  64. package/resources/v1/positions.d.ts.map +1 -1
  65. package/resources/v1/screener.d.mts +3 -3
  66. package/resources/v1/screener.d.ts +3 -3
  67. package/resources/v1/screener.js +2 -2
  68. package/resources/v1/screener.mjs +2 -2
  69. package/resources/v1/v1.d.mts +7 -7
  70. package/resources/v1/v1.d.mts.map +1 -1
  71. package/resources/v1/v1.d.ts +7 -7
  72. package/resources/v1/v1.d.ts.map +1 -1
  73. package/resources/v1/v1.js.map +1 -1
  74. package/resources/v1/v1.mjs.map +1 -1
  75. package/resources/v1/watchlist.d.mts +3 -3
  76. package/resources/v1/watchlist.d.ts +3 -3
  77. package/src/resources/v1/index.ts +3 -0
  78. package/src/resources/v1/instrument-data/market-data.ts +98 -20
  79. package/src/resources/v1/instruments.ts +51 -2
  80. package/src/resources/v1/omni-ai/index.ts +2 -0
  81. package/src/resources/v1/omni-ai/messages.ts +17 -17
  82. package/src/resources/v1/omni-ai/omni-ai.ts +12 -1
  83. package/src/resources/v1/omni-ai/responses.ts +22 -22
  84. package/src/resources/v1/omni-ai/threads.ts +136 -65
  85. package/src/resources/v1/orders.ts +123 -7
  86. package/src/resources/v1/positions.ts +55 -0
  87. package/src/resources/v1/screener.ts +3 -3
  88. package/src/resources/v1/v1.ts +7 -1
  89. package/src/resources/v1/watchlist.ts +3 -3
  90. package/src/version.ts +1 -1
  91. package/version.d.mts +1 -1
  92. package/version.d.mts.map +1 -1
  93. package/version.d.ts +1 -1
  94. package/version.d.ts.map +1 -1
  95. package/version.js +1 -1
  96. package/version.js.map +1 -1
  97. package/version.mjs +1 -1
  98. package/version.mjs.map +1 -1
@@ -92,11 +92,11 @@ export interface AddWatchlistItemData {
92
92
  */
93
93
  export interface WatchlistDetail {
94
94
  /**
95
- * Watchlist ID
95
+ * The unique identifier for the watchlist.
96
96
  */
97
97
  id: string;
98
98
  /**
99
- * Creation timestamp
99
+ * The timestamp when the watchlist was created.
100
100
  */
101
101
  created_at: string;
102
102
  /**
@@ -104,7 +104,7 @@ export interface WatchlistDetail {
104
104
  */
105
105
  items: Array<WatchlistItemEntry>;
106
106
  /**
107
- * Watchlist name
107
+ * The user-provided watchlist name.
108
108
  */
109
109
  name: string;
110
110
  }
@@ -92,11 +92,11 @@ export interface AddWatchlistItemData {
92
92
  */
93
93
  export interface WatchlistDetail {
94
94
  /**
95
- * Watchlist ID
95
+ * The unique identifier for the watchlist.
96
96
  */
97
97
  id: string;
98
98
  /**
99
- * Creation timestamp
99
+ * The timestamp when the watchlist was created.
100
100
  */
101
101
  created_at: string;
102
102
  /**
@@ -104,7 +104,7 @@ export interface WatchlistDetail {
104
104
  */
105
105
  items: Array<WatchlistItemEntry>;
106
106
  /**
107
- * Watchlist name
107
+ * The user-provided watchlist name.
108
108
  */
109
109
  name: string;
110
110
  }
@@ -97,6 +97,7 @@ export {
97
97
  type OptionExpiryDate,
98
98
  type OptionsContract,
99
99
  type OptionsContractList,
100
+ type TickRule,
100
101
  type InstrumentGetInstrumentByIDResponse,
101
102
  type InstrumentGetInstrumentsResponse,
102
103
  type InstrumentGetOptionContractsResponse,
@@ -156,6 +157,7 @@ export {
156
157
  type Order,
157
158
  type OrderList,
158
159
  type OrderStatus,
160
+ type OrderStrategy,
159
161
  type OrderType,
160
162
  type QueueState,
161
163
  type ReplaceOrderRequest,
@@ -185,6 +187,7 @@ export {
185
187
  type Position,
186
188
  type PositionInstruction,
187
189
  type PositionInstructionList,
190
+ type PositionInstructionRejection,
188
191
  type PositionInstructionStatus,
189
192
  type PositionInstructionType,
190
193
  type PositionList,
@@ -11,6 +11,10 @@ import { RequestOptions } from '../../../internal/request-options';
11
11
  */
12
12
  export class MarketData extends APIResource {
13
13
  /**
14
+ * **Deprecated**: use `GET /market-data/snapshot` instead, which now reports the
15
+ * same open/high/low/volume/open-interest fields under `session` and top-level
16
+ * `open_interest`.
17
+ *
14
18
  * Returns the most recent open, high, low, volume (OHLV) and current price for the
15
19
  * requested instruments.
16
20
  *
@@ -20,13 +24,7 @@ export class MarketData extends APIResource {
20
24
  * fail to resolve are omitted from `data` and reported in `error` instead (see the
21
25
  * 207/404 responses below).
22
26
  *
23
- * @example
24
- * ```ts
25
- * const response =
26
- * await client.v1.instrumentData.marketData.getDailySummaries(
27
- * { instrument_ids: 'instrument_ids' },
28
- * );
29
- * ```
27
+ * @deprecated
30
28
  */
31
29
  getDailySummaries(
32
30
  query: MarketDataGetDailySummariesParams,
@@ -137,15 +135,42 @@ export interface MarketDataSnapshot {
137
135
  */
138
136
  instrument_id: string;
139
137
 
138
+ /**
139
+ * Session-level pricing and OHLV metrics. Always present; each inner field is
140
+ * independently nullable.
141
+ */
142
+ session: SnapshotSession;
143
+
144
+ /**
145
+ * Whether the SEC Rule 201 short-sale price test is currently restricting short
146
+ * sales in this security, from the trading-status feed.
147
+ *
148
+ * `true` restricts non-exempt short sales at or below the national best bid.
149
+ * `null` means we have no answer, either because no trading status has been seen
150
+ * for this security yet or because Rule 201 does not cover this security type. A
151
+ * `null` is not a statement that short selling is unrestricted, and must not be
152
+ * treated as clear to short.
153
+ *
154
+ * This is the current market condition, not a statement about whether Clear Street
155
+ * will reject your order. It is also distinct from `is_short_prohibited` on the
156
+ * instrument endpoints, which is a standing property of the security rather than a
157
+ * live circuit breaker. When a null/undefined value is observed, it indicates that
158
+ * there is no available data.
159
+ */
160
+ short_sale_restricted: boolean | null;
161
+
140
162
  /**
141
163
  * Display symbol for the security.
142
164
  */
143
165
  symbol: string;
144
166
 
145
167
  /**
146
- * Cumulative traded volume reported on the most recent trade, in shares for
147
- * equities or contracts for options. Absent when no trade is available. When a
148
- * null/undefined value is observed, it indicates that there is no available data.
168
+ * @deprecated Cumulative traded volume reported on the most recent trade, in
169
+ * shares for equities or contracts for options. Absent when no trade is available.
170
+ *
171
+ * Deprecated: use `session.cumulative_volume`, the same value from the same
172
+ * source. When a null/undefined value is observed, it indicates that there is no
173
+ * available data.
149
174
  */
150
175
  cumulative_volume?: number | null;
151
176
 
@@ -177,11 +202,11 @@ export interface MarketDataSnapshot {
177
202
  name?: string | null;
178
203
 
179
204
  /**
180
- * Session metrics computed from previous close and last trade, if available. When
181
- * a null/undefined value is observed, it indicates that there is no available
182
- * data.
205
+ * Open interest (outstanding contracts) as of the most recent OPRA Refresh.
206
+ * Populated for options only; absent for equities and indices. When a
207
+ * null/undefined value is observed, it indicates that there is no available data.
183
208
  */
184
- session?: SnapshotSession | null;
209
+ open_interest?: number | null;
185
210
  }
186
211
 
187
212
  export type MarketDataSnapshotList = Array<MarketDataSnapshot>;
@@ -333,26 +358,78 @@ export interface SnapshotQuote {
333
358
  }
334
359
 
335
360
  /**
336
- * Session-level pricing metrics for a market data snapshot.
361
+ * Session-level pricing and OHLV metrics for a market data snapshot. Always
362
+ * present on the snapshot row; every field here is independently nullable except
363
+ * `ohlv_applicable`.
337
364
  */
338
365
  export interface SnapshotSession {
366
+ /**
367
+ * `false` only for instrument types with no OHLV by definition (e.g. an index
368
+ * instrument, whose price is a computed level rather than a traded security) --
369
+ * `open`/`high`/`low`/`ohlv_date`/`cumulative_volume` are then always absent.
370
+ * `true` otherwise, even when those fields simply haven't loaded yet. Always
371
+ * serialized.
372
+ */
373
+ ohlv_applicable: boolean;
374
+
339
375
  /**
340
376
  * Absolute change from previous close to the most recent last-sale-eligible trade.
377
+ * Absent when either side of the computation is unavailable. When a null/undefined
378
+ * value is observed, it indicates that there is no available data.
341
379
  */
342
- change: string;
380
+ change?: string | null;
343
381
 
344
382
  /**
345
383
  * Percent change from previous close to the most recent last-sale-eligible trade.
384
+ * Absent under the same conditions as `change`. When a null/undefined value is
385
+ * observed, it indicates that there is no available data.
346
386
  */
347
- change_percent: string;
387
+ change_percent?: string | null;
388
+
389
+ /**
390
+ * Cumulative traded volume for the current session, in shares for equities or
391
+ * contracts for options. Always reflects the current session, even when
392
+ * `ohlv_date` trails it. Absent when `ohlv_applicable` is `false`, or when no
393
+ * trade is available. When a null/undefined value is observed, it indicates that
394
+ * there is no available data.
395
+ */
396
+ cumulative_volume?: number | null;
397
+
398
+ /**
399
+ * Session high. When a null/undefined value is observed, it indicates that there
400
+ * is no available data.
401
+ */
402
+ high?: string | null;
403
+
404
+ /**
405
+ * Session low. When a null/undefined value is observed, it indicates that there is
406
+ * no available data.
407
+ */
408
+ low?: string | null;
409
+
410
+ /**
411
+ * Session date the open/high/low values represent, US/Eastern. May trail the
412
+ * current session until the upstream feed rolls. When a null/undefined value is
413
+ * observed, it indicates that there is no available data.
414
+ */
415
+ ohlv_date?: string | null;
416
+
417
+ /**
418
+ * Session opening price, from the day's OHLC bar. Absent when `ohlv_applicable` is
419
+ * `false`, or when the bar has not loaded yet. When a null/undefined value is
420
+ * observed, it indicates that there is no available data.
421
+ */
422
+ open?: string | null;
348
423
 
349
424
  /**
350
425
  * Previous session close price. Corporate-action-adjusted (stock dividends, cash
351
426
  * dividends, and forward/reverse splits) when an adjustment exists for the close
352
427
  * date; the raw close otherwise. An adjustment can carry the price beyond 2
353
- * decimal places.
428
+ * decimal places. Absent when no previous close is on record (e.g. an instrument's
429
+ * first session). When a null/undefined value is observed, it indicates that there
430
+ * is no available data.
354
431
  */
355
- previous_close: string;
432
+ previous_close?: string | null;
356
433
 
357
434
  /**
358
435
  * Unadjusted (raw) previous session close. Present only when a corporate-action
@@ -381,7 +458,8 @@ export interface MarketDataGetDailySummariesParams {
381
458
  export interface MarketDataGetSnapshotsParams {
382
459
  /**
383
460
  * Comma-separated instrument IDs (UUID) or symbols (equity tickers or OSI option
384
- * symbols).
461
+ * symbols). Required; accepts 1 to 100 IDs. Duplicate resolved ids collapse to a
462
+ * single row.
385
463
  */
386
464
  instrument_ids?: Array<OrdersAPI.InstrumentIDOrSymbol>;
387
465
  }
@@ -148,7 +148,9 @@ export interface Instrument {
148
148
  is_ptp: boolean;
149
149
 
150
150
  /**
151
- * Indicates if short selling is prohibited for the instrument
151
+ * Indicates if short selling is prohibited for the instrument. This is a standing
152
+ * property of the security. For the live Rule 201 circuit breaker, see
153
+ * `short_sale_restricted` on the market-data snapshot.
152
154
  */
153
155
  is_short_prohibited: boolean;
154
156
 
@@ -239,6 +241,13 @@ export interface Instrument {
239
241
  * null/undefined value is observed, it indicates that there is no available data.
240
242
  */
241
243
  short_margin_rate?: string | null;
244
+
245
+ /**
246
+ * Price bands this instrument quotes on, ascending. Absent when we have no
247
+ * schedule for it, which includes an option whose penny-program status our
248
+ * reference data never supplied.
249
+ */
250
+ tick_rules?: Array<TickRule>;
242
251
  }
243
252
 
244
253
  export interface InstrumentCore {
@@ -284,7 +293,9 @@ export interface InstrumentCore {
284
293
  is_ptp: boolean;
285
294
 
286
295
  /**
287
- * Indicates if short selling is prohibited for the instrument
296
+ * Indicates if short selling is prohibited for the instrument. This is a standing
297
+ * property of the security. For the live Rule 201 circuit breaker, see
298
+ * `short_sale_restricted` on the market-data snapshot.
288
299
  */
289
300
  is_short_prohibited: boolean;
290
301
 
@@ -357,6 +368,13 @@ export interface InstrumentCore {
357
368
  * null/undefined value is observed, it indicates that there is no available data.
358
369
  */
359
370
  short_margin_rate?: string | null;
371
+
372
+ /**
373
+ * Price bands this instrument quotes on, ascending. Absent when we have no
374
+ * schedule for it, which includes an option whose penny-program status our
375
+ * reference data never supplied.
376
+ */
377
+ tick_rules?: Array<TickRule>;
360
378
  }
361
379
 
362
380
  export type InstrumentCoreList = Array<InstrumentCore>;
@@ -479,6 +497,12 @@ export interface OptionsContract {
479
497
  */
480
498
  open_interest?: number | null;
481
499
 
500
+ /**
501
+ * Price bands this contract quotes on, ascending. Absent when our reference data
502
+ * never supplied the contract's penny-program status.
503
+ */
504
+ tick_rules?: Array<TickRule>;
505
+
482
506
  /**
483
507
  * Instrument ID of the underlying instrument, when available When a null/undefined
484
508
  * value is observed, it indicates that there is no available data.
@@ -488,6 +512,30 @@ export interface OptionsContract {
488
512
 
489
513
  export type OptionsContractList = Array<OptionsContract>;
490
514
 
515
+ /**
516
+ * One band of an instrument's tick schedule. A price in the band is valid only if
517
+ * it is a whole multiple of `tick_size`. Bands describe the instrument itself: on
518
+ * an equity they say nothing about that equity's option chain.
519
+ */
520
+ export interface TickRule {
521
+ /**
522
+ * Lowest price in the band, inclusive.
523
+ */
524
+ start_price: string;
525
+
526
+ /**
527
+ * Minimum price increment within the band.
528
+ */
529
+ tick_size: string;
530
+
531
+ /**
532
+ * Upper bound of the band, exclusive. Absent on the last band, which runs to
533
+ * infinity. When a null/undefined value is observed, it indicates it does not
534
+ * apply.
535
+ */
536
+ end_price?: string | null;
537
+ }
538
+
491
539
  export interface InstrumentGetInstrumentByIDResponse extends Shared.BaseResponse {
492
540
  /**
493
541
  * Represents a tradable financial instrument.
@@ -675,6 +723,7 @@ export declare namespace Instruments {
675
723
  type OptionExpiryDate as OptionExpiryDate,
676
724
  type OptionsContract as OptionsContract,
677
725
  type OptionsContractList as OptionsContractList,
726
+ type TickRule as TickRule,
678
727
  type InstrumentGetInstrumentByIDResponse as InstrumentGetInstrumentByIDResponse,
679
728
  type InstrumentGetInstrumentsResponse as InstrumentGetInstrumentsResponse,
680
729
  type InstrumentGetOptionContractsResponse as InstrumentGetOptionContractsResponse,
@@ -67,6 +67,7 @@ export {
67
67
  } from './responses';
68
68
  export {
69
69
  Threads,
70
+ type ContextItem,
70
71
  type CreateMessageResponse,
71
72
  type CreateThreadResponse,
72
73
  type Message,
@@ -77,6 +78,7 @@ export {
77
78
  type MessageRole,
78
79
  type Thread,
79
80
  type ThreadList,
81
+ type TurnContext,
80
82
  type ThreadCreateMessageResponse,
81
83
  type ThreadCreateThreadResponse,
82
84
  type ThreadGetMessagesResponse,
@@ -12,42 +12,40 @@ import { path } from '../../../internal/utils/path';
12
12
  */
13
13
  export class Messages extends APIResource {
14
14
  /**
15
- * Get a finalized message by ID.
16
- *
17
- * Returns a single finalized message. Returns **404** if the message belongs to an
18
- * in-progress assistant turn (use the response endpoint for live output). Once the
19
- * turn completes, the message becomes available here.
15
+ * Read a finalized message using its parent thread for ownership and
16
+ * linked-account authorization. In-progress assistant messages are not available
17
+ * here; use the response polling endpoint instead.
20
18
  *
21
19
  * @example
22
20
  * ```ts
23
21
  * const response =
24
22
  * await client.v1.omniAI.messages.getMessageByID(
25
23
  * '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
26
- * { account_id: 0 },
27
24
  * );
28
25
  * ```
29
26
  */
30
27
  getMessageByID(
31
28
  messageID: string,
32
- query: MessageGetMessageByIDParams,
29
+ query: MessageGetMessageByIDParams | null | undefined = {},
33
30
  options?: RequestOptions,
34
31
  ): APIPromise<MessageGetMessageByIDResponse> {
35
32
  return this._client.get(path`/v1/omni-ai/messages/${messageID}`, { query, ...options });
36
33
  }
37
34
 
38
35
  /**
39
- * Submit feedback on a finalized assistant message.
40
- *
41
- * Attaches a score and optional comment to a finalized assistant message. Feedback
36
+ * Attach a score and optional comment to a finalized assistant message. Feedback
42
37
  * is only valid for messages with role `ASSISTANT` that have reached a terminal
43
38
  * outcome.
44
39
  *
40
+ * The current thread account governs access even when the message predates its
41
+ * account link.
42
+ *
45
43
  * @example
46
44
  * ```ts
47
45
  * const response =
48
46
  * await client.v1.omniAI.messages.submitFeedback(
49
47
  * '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
50
- * { account_id: 0, score: 0 },
48
+ * { score: 0 },
51
49
  * );
52
50
  * ```
53
51
  */
@@ -83,21 +81,23 @@ export interface MessageSubmitFeedbackResponse extends Shared.BaseResponse {
83
81
 
84
82
  export interface MessageGetMessageByIDParams {
85
83
  /**
86
- * Account ID for the request
84
+ * Lists only conversations for this account, or unlinked conversations when
85
+ * omitted. Other reads authorize the resource's linked account. Omit when no
86
+ * account is selected; empty values and the string null are invalid.
87
87
  */
88
- account_id: number;
88
+ account_id?: number;
89
89
  }
90
90
 
91
91
  export interface MessageSubmitFeedbackParams {
92
92
  /**
93
- * Account ID for the request
93
+ * Feedback score (-1, 0, +1 or 1-5).
94
94
  */
95
- account_id: number;
95
+ score: number;
96
96
 
97
97
  /**
98
- * Feedback score (-1, 0, +1 or 1-5)
98
+ * Optional selection. Feedback always uses the thread's linked account.
99
99
  */
100
- score: number;
100
+ account_id?: number | null;
101
101
 
102
102
  /**
103
103
  * Optional feedback comment
@@ -44,6 +44,7 @@ import {
44
44
  } from './responses';
45
45
  import * as ThreadsAPI from './threads';
46
46
  import {
47
+ ContextItem,
47
48
  CreateMessageResponse,
48
49
  CreateThreadResponse,
49
50
  Message,
@@ -67,6 +68,7 @@ import {
67
68
  ThreadGetThreadsResponse,
68
69
  ThreadList,
69
70
  Threads,
71
+ TurnContext,
70
72
  } from './threads';
71
73
 
72
74
  export class OmniAI extends APIResource {
@@ -454,7 +456,7 @@ export interface PrefillNewOrderAction {
454
456
  }
455
457
 
456
458
  /**
457
- * Request to submit a new order (PlaceOrderRequest from spec)
459
+ * Request to submit a new order
458
460
  */
459
461
  export interface PrefillNewOrderRequest {
460
462
  /**
@@ -530,6 +532,13 @@ export interface PrefillNewOrderRequest {
530
532
  */
531
533
  stop_price?: string | null;
532
534
 
535
+ /**
536
+ * Optional execution strategy. Omit to use standard routing. One of `SOR`, `VWAP`,
537
+ * or `TWAP`. Supported only on `MARKET` and `LIMIT` orders with `DAY`
538
+ * time-in-force, and not supported on OTC common-stock orders.
539
+ */
540
+ strategy?: OrdersAPI.OrderStrategy | null;
541
+
533
542
  /**
534
543
  * Trading symbol. For equities, use the ticker symbol (e.g., "TSLA"). For options,
535
544
  * use the OSI symbol (e.g., "TSLA 250117C00190000"). Either `symbol` or
@@ -749,6 +758,7 @@ export declare namespace OmniAI {
749
758
 
750
759
  export {
751
760
  Threads as Threads,
761
+ type ContextItem as ContextItem,
752
762
  type CreateMessageResponse as CreateMessageResponse,
753
763
  type CreateThreadResponse as CreateThreadResponse,
754
764
  type Message as Message,
@@ -759,6 +769,7 @@ export declare namespace OmniAI {
759
769
  type MessageRole as MessageRole,
760
770
  type Thread as Thread,
761
771
  type ThreadList as ThreadList,
772
+ type TurnContext as TurnContext,
762
773
  type ThreadCreateMessageResponse as ThreadCreateMessageResponse,
763
774
  type ThreadCreateThreadResponse as ThreadCreateThreadResponse,
764
775
  type ThreadGetMessagesResponse as ThreadGetMessagesResponse,
@@ -12,28 +12,26 @@ import { path } from '../../../internal/utils/path';
12
12
  */
13
13
  export class Responses extends APIResource {
14
14
  /**
15
- * Cancel a response.
15
+ * Cancel a queued or running response. Cancellation is idempotent after the
16
+ * response becomes terminal. A canceled turn still produces a finalized assistant
17
+ * message with outcome `canceled` in the thread history.
16
18
  *
17
- * Requests cancellation of a queued or running response. If the response has
18
- * already reached a terminal status, this is an idempotent success. A canceled
19
- * turn still produces a final assistant message with outcome `canceled` in the
20
- * thread history.
19
+ * Authorization uses the linked account before any cancellation.
21
20
  *
22
21
  * @example
23
22
  * ```ts
24
23
  * const response =
25
24
  * await client.v1.omniAI.responses.cancelResponse(
26
25
  * '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
27
- * { account_id: 0 },
28
26
  * );
29
27
  * ```
30
28
  */
31
29
  cancelResponse(
32
30
  responseID: string,
33
- params: ResponseCancelResponseParams,
31
+ params: ResponseCancelResponseParams | null | undefined = {},
34
32
  options?: RequestOptions,
35
33
  ): APIPromise<ResponseCancelResponseResponse> {
36
- const { account_id } = params;
34
+ const { account_id } = params ?? {};
37
35
  return this._client.delete(path`/v1/omni-ai/responses/${responseID}`, {
38
36
  query: { account_id },
39
37
  ...options,
@@ -41,28 +39,26 @@ export class Responses extends APIResource {
41
39
  }
42
40
 
43
41
  /**
44
- * Poll a response for assistant output.
42
+ * Poll the current snapshot of an in-progress or completed assistant response.
43
+ * While its status is `queued` or `running`, content may be partial and include
44
+ * thinking parts. Continue polling until it becomes `succeeded`, `failed`, or
45
+ * `canceled`.
45
46
  *
46
- * Returns the current snapshot of an in-progress or completed response. While the
47
- * status is `queued` or `running`, the content may be partial and may include
48
- * `thinking` parts. Poll this endpoint periodically until the status reaches a
49
- * terminal value (`succeeded`, `failed`, or `canceled`).
50
- *
51
- * Once terminal, the finalized assistant message is available in thread history
52
- * via `GET /omni-ai/threads/{thread_id}/messages`.
47
+ * Once terminal, the finalized message is available through
48
+ * `GET /omni-ai/threads/{thread_id}/messages`. Authorization uses the current
49
+ * parent thread account, including for responses created before the account link.
53
50
  *
54
51
  * @example
55
52
  * ```ts
56
53
  * const response =
57
54
  * await client.v1.omniAI.responses.getResponseByID(
58
55
  * '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
59
- * { account_id: 0 },
60
56
  * );
61
57
  * ```
62
58
  */
63
59
  getResponseByID(
64
60
  responseID: string,
65
- query: ResponseGetResponseByIDParams,
61
+ query: ResponseGetResponseByIDParams | null | undefined = {},
66
62
  options?: RequestOptions,
67
63
  ): APIPromise<ResponseGetResponseByIDResponse> {
68
64
  return this._client.get(path`/v1/omni-ai/responses/${responseID}`, { query, ...options });
@@ -199,16 +195,20 @@ export interface ResponseGetResponseByIDResponse extends Shared.BaseResponse {
199
195
 
200
196
  export interface ResponseCancelResponseParams {
201
197
  /**
202
- * Account ID for the request
198
+ * Lists only conversations for this account, or unlinked conversations when
199
+ * omitted. Other reads authorize the resource's linked account. Omit when no
200
+ * account is selected; empty values and the string null are invalid.
203
201
  */
204
- account_id: number;
202
+ account_id?: number;
205
203
  }
206
204
 
207
205
  export interface ResponseGetResponseByIDParams {
208
206
  /**
209
- * Account ID for the request
207
+ * Lists only conversations for this account, or unlinked conversations when
208
+ * omitted. Other reads authorize the resource's linked account. Omit when no
209
+ * account is selected; empty values and the string null are invalid.
210
210
  */
211
- account_id: number;
211
+ account_id?: number;
212
212
  }
213
213
 
214
214
  export declare namespace Responses {