# Omni AI ## Domain Types ### Action Button - `type ActionButton struct{…}` Button metadata shared by chart and suggested-actions payloads. - `ButtonID string` Stable button identifier within the content part. - `Label string` User-visible label. - `Prompt PromptButtonAction` Follow-up prompt to submit as the next user message. - `Prompt string` Prompt text to submit as the next user turn. - `StructuredAction StructuredActionButtonAction` Structured action in the same message to execute on click. - `ActionID string` UUID of a `structured_action` content part in the same message. ### Chart Payload - `type ChartPayload struct{…}` Typed chart payload rendered inline in assistant content. - `ChartID string` Stable chart identifier scoped to the content part. - `ActionButtons []ActionButton` Buttons associated with this chart. - `ButtonID string` Stable button identifier within the content part. - `Label string` User-visible label. - `Prompt PromptButtonAction` Follow-up prompt to submit as the next user message. - `Prompt string` Prompt text to submit as the next user turn. - `StructuredAction StructuredActionButtonAction` Structured action in the same message to execute on click. - `ActionID string` UUID of a `structured_action` content part in the same message. - `DataChart DataChart` Explicit series-driven chart definition. - `Series []ChartSeries` - `Name string` - `Points []ChartPoint` - `X string` - `Y float64` - `SymbolChart SymbolChart` Symbol-driven chart definition. - `Symbol string` - `Timeframe string` ### Chart Point - `type ChartPoint struct{…}` Single chart coordinate. - `X string` - `Y float64` ### Chart Series - `type ChartSeries struct{…}` Named data series within a chart. - `Name string` - `Points []ChartPoint` - `X string` - `Y float64` ### Content Part Chart Payload - `type ContentPartChartPayload struct{…}` Chart payload content part. - `Payload ChartPayload` Typed chart payload rendered inline in assistant content. - `ChartID string` Stable chart identifier scoped to the content part. - `ActionButtons []ActionButton` Buttons associated with this chart. - `ButtonID string` Stable button identifier within the content part. - `Label string` User-visible label. - `Prompt PromptButtonAction` Follow-up prompt to submit as the next user message. - `Prompt string` Prompt text to submit as the next user turn. - `StructuredAction StructuredActionButtonAction` Structured action in the same message to execute on click. - `ActionID string` UUID of a `structured_action` content part in the same message. - `DataChart DataChart` Explicit series-driven chart definition. - `Series []ChartSeries` - `Name string` - `Points []ChartPoint` - `X string` - `Y float64` - `SymbolChart SymbolChart` Symbol-driven chart definition. - `Symbol string` - `Timeframe string` ### Content Part Custom Payload - `type ContentPartCustomPayload struct{…}` Escape-hatch custom payload content part. - `Payload any` ### Content Part Structured Action Payload - `type ContentPartStructuredActionPayload struct{…}` Structured action content part. - `Action StructuredActionUnion` Structured actions that Omni AI can return to clients. These actions provide machine-readable instructions for the client to execute, such as prefilling an order ticket, opening a chart, or navigating to a route. - `type StructuredActionPrefillOrder struct{…}` Prefill an order ticket for user confirmation - `PrefillOrder PrefillOrderActionUnion` Prefill an order ticket for user confirmation - `type PrefillOrderActionPrefillNewOrderAction struct{…}` Create one or more new orders. - `ActionType string` - `const PrefillOrderActionPrefillNewOrderActionActionTypeNew PrefillOrderActionPrefillNewOrderActionActionType = "NEW"` - `type PrefillOrderActionPrefillCancelOrderAction struct{…}` Cancel one or more existing orders. - `ActionType string` - `const PrefillOrderActionPrefillCancelOrderActionActionTypeCancel PrefillOrderActionPrefillCancelOrderActionActionType = "CANCEL"` - `type StructuredActionOpenChart struct{…}` Open a chart for a symbol - `OpenChart OpenChartAction` Open a chart for a symbol - `Symbol string` Trading symbol to chart - `Extras any` Additional chart configuration (indicators, overlays, etc.) - `Timeframe string` Chart timeframe (e.g., "1D", "1W", "1M", "3M", "1Y", "5Y") - `type StructuredActionOpenScreener struct{…}` Open a stock screener with filters - `OpenScreener OpenScreenerAction` Open a stock screener with filters - `Filters []ScreenerFilter` Filter criteria for the screener - `Field string` Field to filter on (e.g., "market_cap", "sector", "price") - `Operator string` Comparison operator (e.g., "eq", "gte", "lte", "in") - `Value any` Filter value - `FieldFilter []string` Optional field/column selection for screener results. - `PageSize int64` Optional page size. - `SortBy string` Optional sort field for screener rows. - `SortDirection string` Optional sort direction (`ASC` or `DESC`). - `type StructuredActionOpenEntitlementConsent struct{…}` Open entitlement consent flow - `OpenEntitlementConsent OpenEntitlementConsentAction` Open entitlement consent flow - `AgreementKey EntitlementAgreementKey` Stable entitlement agreement family key. - `const EntitlementAgreementKeyOmniAccountDataAccess EntitlementAgreementKey = "omni_account_data_access"` - `Reason string` - `RequestedEntitlementCodes []EntitlementCode` - `const EntitlementCodeOmniAccountData EntitlementCode = "omni.account_data"` - `TradingAccountIDs []int64` - `ActionID string` ### Content Part Suggested Actions Payload - `type ContentPartSuggestedActionsPayload struct{…}` Suggested actions payload content part. - `Payload SuggestedActionsPayload` Suggested follow-up buttons rendered at the end of an assistant message. - `ActionButtons []ActionButton` Ordered message-level buttons. - `ButtonID string` Stable button identifier within the content part. - `Label string` User-visible label. - `Prompt PromptButtonAction` Follow-up prompt to submit as the next user message. - `Prompt string` Prompt text to submit as the next user turn. - `StructuredAction StructuredActionButtonAction` Structured action in the same message to execute on click. - `ActionID string` UUID of a `structured_action` content part in the same message. ### Content Part Text Payload - `type ContentPartTextPayload struct{…}` Text content part. - `Text string` ### Content Part Thinking Payload - `type ContentPartThinkingPayload struct{…}` Thinking content part shown on dynamic response polling. - `Thoughts []string` ### Data Chart - `type DataChart struct{…}` Chart represented by explicit data series. - `Series []ChartSeries` - `Name string` - `Points []ChartPoint` - `X string` - `Y float64` ### Open Chart Action - `type OpenChartAction struct{…}` Action to open a chart for a symbol. - `Symbol string` Trading symbol to chart - `Extras any` Additional chart configuration (indicators, overlays, etc.) - `Timeframe string` Chart timeframe (e.g., "1D", "1W", "1M", "3M", "1Y", "5Y") ### Open Entitlement Consent Action - `type OpenEntitlementConsentAction struct{…}` Action to open entitlement consent flow for one or more accounts. - `AgreementKey EntitlementAgreementKey` Stable entitlement agreement family key. - `const EntitlementAgreementKeyOmniAccountDataAccess EntitlementAgreementKey = "omni_account_data_access"` - `Reason string` - `RequestedEntitlementCodes []EntitlementCode` - `const EntitlementCodeOmniAccountData EntitlementCode = "omni.account_data"` - `TradingAccountIDs []int64` ### Open Screener Action - `type OpenScreenerAction struct{…}` Action to open a stock screener with filters. - `Filters []ScreenerFilter` Filter criteria for the screener - `Field string` Field to filter on (e.g., "market_cap", "sector", "price") - `Operator string` Comparison operator (e.g., "eq", "gte", "lte", "in") - `Value any` Filter value - `FieldFilter []string` Optional field/column selection for screener results. - `PageSize int64` Optional page size. - `SortBy string` Optional sort field for screener rows. - `SortDirection string` Optional sort direction (`ASC` or `DESC`). ### Prefill Cancel Order Action - `type PrefillCancelOrderAction struct{…}` Cancel-order prefill action. - `Orders []CancelOrderRequest` Orders to cancel using the same identifiers required by the cancel-order API. - `AccountID int64` Account ID (from path parameter) - `OrderID string` Order ID to cancel (from path parameter) ### Prefill New Order Action - `type PrefillNewOrderAction struct{…}` New-order prefill action. - `Orders []NewOrderRequest` Orders to prefill using the same shape accepted by the orders API. - `InstrumentType SecurityType` Type of security - `const SecurityTypeCommonStock SecurityType = "COMMON_STOCK"` - `const SecurityTypePreferredStock SecurityType = "PREFERRED_STOCK"` - `const SecurityTypeOption SecurityType = "OPTION"` - `const SecurityTypeCash SecurityType = "CASH"` - `const SecurityTypeOther SecurityType = "OTHER"` - `OrderType RequestOrderType` Type of order - `const RequestOrderTypeMarket RequestOrderType = "MARKET"` - `const RequestOrderTypeLimit RequestOrderType = "LIMIT"` - `const RequestOrderTypeStop RequestOrderType = "STOP"` - `const RequestOrderTypeStopLimit RequestOrderType = "STOP_LIMIT"` - `const RequestOrderTypeTrailingStop RequestOrderType = "TRAILING_STOP"` - `const RequestOrderTypeTrailingStopLimit RequestOrderType = "TRAILING_STOP_LIMIT"` - `Quantity string` Quantity to trade. For COMMON_STOCK: shares (may be fractional if supported). For OPTION (single-leg): contracts (must be an integer) - `Side Side` Side of the order - `const SideBuy Side = "BUY"` - `const SideSell Side = "SELL"` - `const SideSellShort Side = "SELL_SHORT"` - `const SideOther Side = "OTHER"` - `TimeInForce RequestTimeInForce` Time in force - `const RequestTimeInForceDay RequestTimeInForce = "DAY"` - `const RequestTimeInForceGoodTillCancel RequestTimeInForce = "GOOD_TILL_CANCEL"` - `const RequestTimeInForceImmediateOrCancel RequestTimeInForce = "IMMEDIATE_OR_CANCEL"` - `const RequestTimeInForceFillOrKill RequestTimeInForce = "FILL_OR_KILL"` - `const RequestTimeInForceGoodTillDate RequestTimeInForce = "GOOD_TILL_DATE"` - `const RequestTimeInForceAtTheOpening RequestTimeInForce = "AT_THE_OPENING"` - `const RequestTimeInForceAtTheClose RequestTimeInForce = "AT_THE_CLOSE"` - `const RequestTimeInForceGoodTillCrossing RequestTimeInForce = "GOOD_TILL_CROSSING"` - `const RequestTimeInForceGoodThroughCrossing RequestTimeInForce = "GOOD_THROUGH_CROSSING"` - `const RequestTimeInForceAtCrossing RequestTimeInForce = "AT_CROSSING"` - `ID string` Optional client-provided unique ID (idempotency). Required to be unique per account. - `ExpiresAt Time` The timestamp when the order should expire (UTC). Required when time_in_force is GOOD_TILL_DATE. - `ExtendedHours bool` Allow trading outside regular trading hours. Some brokers disallow options outside RTH. - `InstrumentID InstrumentIDOrSymbol` OEMS instrument UUID - `LimitOffset string` Limit offset for trailing stop-limit orders (signed) - `LimitPrice string` Limit price (required for LIMIT and STOP_LIMIT orders) - `PositionEffect PositionEffect` Required when instrument_type is OPTION. Specifies whether the order opens or closes a position. - `const PositionEffectOpen PositionEffect = "OPEN"` - `const PositionEffectClose PositionEffect = "CLOSE"` - `StopPrice string` Stop price (required for STOP and STOP_LIMIT orders) - `Symbol string` Trading symbol. For equities, use the ticker symbol (e.g., "AAPL"). For options, use the OSI symbol (e.g., "AAPL 250117C00190000"). Either `symbol` or `instrument_id` must be provided. - `TrailingOffset string` Trailing offset amount (required for trailing orders) - `TrailingOffsetType TrailingOffsetType` Trailing offset type (PRICE or PERCENT_BPS) - `const TrailingOffsetTypePrice TrailingOffsetType = "PRICE"` - `const TrailingOffsetTypeBps TrailingOffsetType = "BPS"` ### Prefill Order Action - `type PrefillOrderActionUnion interface{…}` Action to prefill order details for user confirmation. The user must review and authorize the order before submission to the trading API. This action provides parsed order data that can be used to prefill an order ticket UI or submitted directly via the orders API after user confirmation. - `type PrefillOrderActionPrefillNewOrderAction struct{…}` Create one or more new orders. - `ActionType string` - `const PrefillOrderActionPrefillNewOrderActionActionTypeNew PrefillOrderActionPrefillNewOrderActionActionType = "NEW"` - `type PrefillOrderActionPrefillCancelOrderAction struct{…}` Cancel one or more existing orders. - `ActionType string` - `const PrefillOrderActionPrefillCancelOrderActionActionTypeCancel PrefillOrderActionPrefillCancelOrderActionActionType = "CANCEL"` ### Prompt Button Action - `type PromptButtonAction struct{…}` Prompt-style button behavior. - `Prompt string` Prompt text to submit as the next user turn. ### Screener Filter - `type ScreenerFilter struct{…}` A single filter criterion for the screener. - `Field string` Field to filter on (e.g., "market_cap", "sector", "price") - `Operator string` Comparison operator (e.g., "eq", "gte", "lte", "in") - `Value any` Filter value ### Structured Action - `type StructuredActionUnion interface{…}` Structured actions that Omni AI can return to clients. These actions provide machine-readable instructions for the client to execute, such as prefilling an order ticket, opening a chart, or navigating to a route. - `type StructuredActionPrefillOrder struct{…}` Prefill an order ticket for user confirmation - `PrefillOrder PrefillOrderActionUnion` Prefill an order ticket for user confirmation - `type PrefillOrderActionPrefillNewOrderAction struct{…}` Create one or more new orders. - `ActionType string` - `const PrefillOrderActionPrefillNewOrderActionActionTypeNew PrefillOrderActionPrefillNewOrderActionActionType = "NEW"` - `type PrefillOrderActionPrefillCancelOrderAction struct{…}` Cancel one or more existing orders. - `ActionType string` - `const PrefillOrderActionPrefillCancelOrderActionActionTypeCancel PrefillOrderActionPrefillCancelOrderActionActionType = "CANCEL"` - `type StructuredActionOpenChart struct{…}` Open a chart for a symbol - `OpenChart OpenChartAction` Open a chart for a symbol - `Symbol string` Trading symbol to chart - `Extras any` Additional chart configuration (indicators, overlays, etc.) - `Timeframe string` Chart timeframe (e.g., "1D", "1W", "1M", "3M", "1Y", "5Y") - `type StructuredActionOpenScreener struct{…}` Open a stock screener with filters - `OpenScreener OpenScreenerAction` Open a stock screener with filters - `Filters []ScreenerFilter` Filter criteria for the screener - `Field string` Field to filter on (e.g., "market_cap", "sector", "price") - `Operator string` Comparison operator (e.g., "eq", "gte", "lte", "in") - `Value any` Filter value - `FieldFilter []string` Optional field/column selection for screener results. - `PageSize int64` Optional page size. - `SortBy string` Optional sort field for screener rows. - `SortDirection string` Optional sort direction (`ASC` or `DESC`). - `type StructuredActionOpenEntitlementConsent struct{…}` Open entitlement consent flow - `OpenEntitlementConsent OpenEntitlementConsentAction` Open entitlement consent flow - `AgreementKey EntitlementAgreementKey` Stable entitlement agreement family key. - `const EntitlementAgreementKeyOmniAccountDataAccess EntitlementAgreementKey = "omni_account_data_access"` - `Reason string` - `RequestedEntitlementCodes []EntitlementCode` - `const EntitlementCodeOmniAccountData EntitlementCode = "omni.account_data"` - `TradingAccountIDs []int64` ### Structured Action Button Action - `type StructuredActionButtonAction struct{…}` Structured-action button behavior. - `ActionID string` UUID of a `structured_action` content part in the same message. ### Suggested Actions Payload - `type SuggestedActionsPayload struct{…}` Suggested follow-up buttons rendered at the end of an assistant message. - `ActionButtons []ActionButton` Ordered message-level buttons. - `ButtonID string` Stable button identifier within the content part. - `Label string` User-visible label. - `Prompt PromptButtonAction` Follow-up prompt to submit as the next user message. - `Prompt string` Prompt text to submit as the next user turn. - `StructuredAction StructuredActionButtonAction` Structured action in the same message to execute on click. - `ActionID string` UUID of a `structured_action` content part in the same message. ### Symbol Chart - `type SymbolChart struct{…}` Chart for a single symbol and timeframe. - `Symbol string` - `Timeframe string` # Entitlements ## Get Entitlements `client.V1.OmniAI.Entitlements.GetEntitlements(ctx, query) (*V1OmniAIEntitlementGetEntitlementsResponse, error)` **get** `/v1/omni-ai/entitlements` List caller's active entitlement grants. ### Parameters - `query V1OmniAIEntitlementGetEntitlementsParams` - `TradingAccountID param.Field[int64]` ### Returns - `type V1OmniAIEntitlementGetEntitlementsResponse struct{…}` - `Data EntitlementResourceList` - `AgreementID string` - `EntitlementCode EntitlementCode` Stable entitlement code granted by an agreement. - `const EntitlementCodeOmniAccountData EntitlementCode = "omni.account_data"` - `EntitlementID string` - `GrantedAt string` - `TradingAccountID int64` ### Example ```go package main import ( "context" "fmt" "github.com/clear-street/clear-street-go" "github.com/clear-street/clear-street-go/option" ) func main() { client := clearstreet.NewClient( option.WithAPIKey("My API Key"), ) response, err := client.V1.OmniAI.Entitlements.GetEntitlements(context.TODO(), clearstreet.V1OmniAIEntitlementGetEntitlementsParams{ }) if err != nil { panic(err.Error()) } fmt.Printf("%+v\n", response) } ``` #### Response ```json { "metadata": { "request_id": "request_id", "next_page_token": "U3RhaW5sZXNzIHJvY2tz", "page_number": 0, "previous_page_token": "U3RhaW5sZXNzIHJvY2tz", "total_items": 0, "total_pages": 0 }, "error": { "code": 400, "message": "Order quantity must be greater than zero", "details": [ { "foo": "bar" } ] }, "data": [ { "agreement_id": "agreement_id", "entitlement_code": "omni.account_data", "entitlement_id": "entitlement_id", "granted_at": "granted_at", "trading_account_id": 0 } ] } ``` ## Create Entitlements `client.V1.OmniAI.Entitlements.NewEntitlements(ctx, body) (*V1OmniAIEntitlementNewEntitlementsResponse, error)` **post** `/v1/omni-ai/entitlements` Record consent and upsert one-or-more active grants. ### Parameters - `body V1OmniAIEntitlementNewEntitlementsParams` - `AgreementID param.Field[string]` - `RequestedEntitlementCodes param.Field[[]EntitlementCode]` - `const EntitlementCodeOmniAccountData EntitlementCode = "omni.account_data"` - `TradingAccountIDs param.Field[[]int64]` ### Returns - `type V1OmniAIEntitlementNewEntitlementsResponse struct{…}` - `Data EntitlementResourceList` - `AgreementID string` - `EntitlementCode EntitlementCode` Stable entitlement code granted by an agreement. - `const EntitlementCodeOmniAccountData EntitlementCode = "omni.account_data"` - `EntitlementID string` - `GrantedAt string` - `TradingAccountID int64` ### Example ```go package main import ( "context" "fmt" "github.com/clear-street/clear-street-go" "github.com/clear-street/clear-street-go/option" ) func main() { client := clearstreet.NewClient( option.WithAPIKey("My API Key"), ) response, err := client.V1.OmniAI.Entitlements.NewEntitlements(context.TODO(), clearstreet.V1OmniAIEntitlementNewEntitlementsParams{ AgreementID: "01JZ0000000000000000000000", RequestedEntitlementCodes: []clearstreet.EntitlementCode{clearstreet.EntitlementCodeOmniAccountData}, TradingAccountIDs: []int64{100019, 100021}, }) if err != nil { panic(err.Error()) } fmt.Printf("%+v\n", response) } ``` #### Response ```json { "metadata": { "request_id": "request_id", "next_page_token": "U3RhaW5sZXNzIHJvY2tz", "page_number": 0, "previous_page_token": "U3RhaW5sZXNzIHJvY2tz", "total_items": 0, "total_pages": 0 }, "error": { "code": 400, "message": "Order quantity must be greater than zero", "details": [ { "foo": "bar" } ] }, "data": [ { "agreement_id": "agreement_id", "entitlement_code": "omni.account_data", "entitlement_id": "entitlement_id", "granted_at": "granted_at", "trading_account_id": 0 } ] } ``` ## Delete Entitlement `client.V1.OmniAI.Entitlements.DeleteEntitlement(ctx, entitlementID) (*V1OmniAIEntitlementDeleteEntitlementResponse, error)` **delete** `/v1/omni-ai/entitlements/{entitlement_id}` Revoke one entitlement grant by id. ### Parameters - `entitlementID string` ### Returns - `type V1OmniAIEntitlementDeleteEntitlementResponse struct{…}` - `Data DeleteEntitlementResponse` - `EntitlementID string` - `Revoked bool` ### Example ```go package main import ( "context" "fmt" "github.com/clear-street/clear-street-go" "github.com/clear-street/clear-street-go/option" ) func main() { client := clearstreet.NewClient( option.WithAPIKey("My API Key"), ) response, err := client.V1.OmniAI.Entitlements.DeleteEntitlement(context.TODO(), "entitlement_id") if err != nil { panic(err.Error()) } fmt.Printf("%+v\n", response) } ``` #### Response ```json { "metadata": { "request_id": "request_id", "next_page_token": "U3RhaW5sZXNzIHJvY2tz", "page_number": 0, "previous_page_token": "U3RhaW5sZXNzIHJvY2tz", "total_items": 0, "total_pages": 0 }, "error": { "code": 400, "message": "Order quantity must be greater than zero", "details": [ { "foo": "bar" } ] }, "data": { "entitlement_id": "entitlement_id", "revoked": true } } ``` ## Get Entitlement Agreements `client.V1.OmniAI.Entitlements.GetEntitlementAgreements(ctx) (*V1OmniAIEntitlementGetEntitlementAgreementsResponse, error)` **get** `/v1/omni-ai/entitlement-agreements` List current signable entitlement agreements for consent UX. ### Returns - `type V1OmniAIEntitlementGetEntitlementAgreementsResponse struct{…}` - `Data EntitlementAgreementResourceList` - `AgreementID string` - `AgreementKey EntitlementAgreementKey` Stable entitlement agreement family key. - `const EntitlementAgreementKeyOmniAccountDataAccess EntitlementAgreementKey = "omni_account_data_access"` - `DocumentContent string` - `DocumentSha256 string` - `EntitlementCodes []EntitlementCode` - `const EntitlementCodeOmniAccountData EntitlementCode = "omni.account_data"` - `Title string` - `Version int64` ### Example ```go package main import ( "context" "fmt" "github.com/clear-street/clear-street-go" "github.com/clear-street/clear-street-go/option" ) func main() { client := clearstreet.NewClient( option.WithAPIKey("My API Key"), ) response, err := client.V1.OmniAI.Entitlements.GetEntitlementAgreements(context.TODO()) if err != nil { panic(err.Error()) } fmt.Printf("%+v\n", response) } ``` #### Response ```json { "metadata": { "request_id": "request_id", "next_page_token": "U3RhaW5sZXNzIHJvY2tz", "page_number": 0, "previous_page_token": "U3RhaW5sZXNzIHJvY2tz", "total_items": 0, "total_pages": 0 }, "error": { "code": 400, "message": "Order quantity must be greater than zero", "details": [ { "foo": "bar" } ] }, "data": [ { "agreement_id": "agreement_id", "agreement_key": "omni_account_data_access", "document_content": "document_content", "document_sha256": "document_sha256", "entitlement_codes": [ "omni.account_data" ], "title": "title", "version": 0 } ] } ``` ## Domain Types ### Delete Entitlement Response - `type DeleteEntitlementResponse struct{…}` - `EntitlementID string` - `Revoked bool` ### Entitlement Agreement Key - `type EntitlementAgreementKey string` Stable entitlement agreement family key. - `const EntitlementAgreementKeyOmniAccountDataAccess EntitlementAgreementKey = "omni_account_data_access"` ### Entitlement Agreement Resource - `type EntitlementAgreementResource struct{…}` - `AgreementID string` - `AgreementKey EntitlementAgreementKey` Stable entitlement agreement family key. - `const EntitlementAgreementKeyOmniAccountDataAccess EntitlementAgreementKey = "omni_account_data_access"` - `DocumentContent string` - `DocumentSha256 string` - `EntitlementCodes []EntitlementCode` - `const EntitlementCodeOmniAccountData EntitlementCode = "omni.account_data"` - `Title string` - `Version int64` ### Entitlement Agreement Resource List - `type EntitlementAgreementResourceList []EntitlementAgreementResource` - `AgreementID string` - `AgreementKey EntitlementAgreementKey` Stable entitlement agreement family key. - `const EntitlementAgreementKeyOmniAccountDataAccess EntitlementAgreementKey = "omni_account_data_access"` - `DocumentContent string` - `DocumentSha256 string` - `EntitlementCodes []EntitlementCode` - `const EntitlementCodeOmniAccountData EntitlementCode = "omni.account_data"` - `Title string` - `Version int64` ### Entitlement Code - `type EntitlementCode string` Stable entitlement code granted by an agreement. - `const EntitlementCodeOmniAccountData EntitlementCode = "omni.account_data"` ### Entitlement Resource - `type EntitlementResource struct{…}` - `AgreementID string` - `EntitlementCode EntitlementCode` Stable entitlement code granted by an agreement. - `const EntitlementCodeOmniAccountData EntitlementCode = "omni.account_data"` - `EntitlementID string` - `GrantedAt string` - `TradingAccountID int64` ### Entitlement Resource List - `type EntitlementResourceList []EntitlementResource` - `AgreementID string` - `EntitlementCode EntitlementCode` Stable entitlement code granted by an agreement. - `const EntitlementCodeOmniAccountData EntitlementCode = "omni.account_data"` - `EntitlementID string` - `GrantedAt string` - `TradingAccountID int64` # Messages ## Get Message By ID `client.V1.OmniAI.Messages.GetMessageByID(ctx, messageID, query) (*V1OmniAIMessageGetMessageByIDResponse, error)` **get** `/v1/omni-ai/messages/{message_id}` Get a finalized message by ID. Returns a single finalized message. Returns **404** if the message belongs to an in-progress assistant turn (use the response endpoint for live output). Once the turn completes, the message becomes available here. ### Parameters - `messageID string` - `query V1OmniAIMessageGetMessageByIDParams` - `AccountID param.Field[int64]` Account ID for the request ### Returns - `type V1OmniAIMessageGetMessageByIDResponse struct{…}` - `Data Message` Final immutable message. - `ID string` - `Content MessageContent` Finalized immutable message content container. Never includes thinking parts. - `Parts []MessageContentPartUnion` - `type MessageContentPartObject struct{…}` Text content part. - `Type string` - `const MessageContentPartObjectTypeText MessageContentPartObjectType = "text"` - `type MessageContentPartObject2 struct{…}` Structured action content part. - `Type string` - `const MessageContentPartObject2TypeStructuredAction MessageContentPartObject2Type = "structured_action"` - `type MessageContentPartObject3 struct{…}` Chart payload content part. - `Type string` - `const MessageContentPartObject3TypeChart MessageContentPartObject3Type = "chart"` - `type MessageContentPartObject4 struct{…}` Suggested actions payload content part. - `Type string` - `const MessageContentPartObject4TypeSuggestedActions MessageContentPartObject4Type = "suggested_actions"` - `type MessageContentPartObject5 struct{…}` Escape-hatch custom payload content part. - `Type string` - `const MessageContentPartObject5TypeCustom MessageContentPartObject5Type = "custom"` - `CreatedAt string` - `Outcome MessageOutcome` Immutable terminal outcome for a finalized assistant message. - `const MessageOutcomeCompleted MessageOutcome = "completed"` - `const MessageOutcomeErrored MessageOutcome = "errored"` - `const MessageOutcomeCanceled MessageOutcome = "canceled"` - `Role MessageRole` Finalized message role in the public contract. - `const MessageRoleUser MessageRole = "USER"` - `const MessageRoleAssistant MessageRole = "ASSISTANT"` - `Seq int64` - `ThreadID string` - `Error ErrorStatus` Shared sanitized error payload. - `Code string` - `Message string` - `Details any` ### Example ```go package main import ( "context" "fmt" "github.com/clear-street/clear-street-go" "github.com/clear-street/clear-street-go/option" ) func main() { client := clearstreet.NewClient( option.WithAPIKey("My API Key"), ) response, err := client.V1.OmniAI.Messages.GetMessageByID( context.TODO(), "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", clearstreet.V1OmniAIMessageGetMessageByIDParams{ AccountID: 0, }, ) if err != nil { panic(err.Error()) } fmt.Printf("%+v\n", response) } ``` #### Response ```json { "data": { "content": { "parts": [ { "text": "**Pre-market as of 7:30 AM ET**\n\n ...", "type": "text" }, { "payload": { "actionButtons": [ { "buttonId": "btn_followup_0", "label": "Check my positions", "prompt": { "prompt": "What are my current positions?" } } ] }, "type": "suggested_actions" } ] }, "created_at": "2026-04-16T09:20:17.309212+00:00", "id": "019d9597-599c-7132-a7de-e5c21eaaab77", "outcome": "completed", "role": "ASSISTANT", "seq": 2, "thread_id": "019d9597-597c-7571-a0c9-a49c0e51f6eb" }, "metadata": { "request_id": "0f991501-757d-4051-bf00-6d7f452d6fcf" } } ``` ## Submit Feedback `client.V1.OmniAI.Messages.SubmitFeedback(ctx, messageID, body) (*V1OmniAIMessageSubmitFeedbackResponse, error)` **post** `/v1/omni-ai/messages/{message_id}/feedback` Submit feedback on a finalized assistant message. Attaches a score and optional comment to a finalized assistant message. Feedback is only valid for messages with role `ASSISTANT` that have reached a terminal outcome. ### Parameters - `messageID string` - `body V1OmniAIMessageSubmitFeedbackParams` - `AccountID param.Field[int64]` Account ID for the request - `Score param.Field[int64]` Feedback score (-1, 0, +1 or 1-5) - `Comment param.Field[string]` Optional feedback comment - `Metadata param.Field[any]` Optional metadata ### Returns - `type V1OmniAIMessageSubmitFeedbackResponse struct{…}` - `Data CreateFeedbackResponse` - `CreatedAt string` - `FeedbackID string` ### Example ```go package main import ( "context" "fmt" "github.com/clear-street/clear-street-go" "github.com/clear-street/clear-street-go/option" ) func main() { client := clearstreet.NewClient( option.WithAPIKey("My API Key"), ) response, err := client.V1.OmniAI.Messages.SubmitFeedback( context.TODO(), "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", clearstreet.V1OmniAIMessageSubmitFeedbackParams{ AccountID: 0, Score: 0, }, ) if err != nil { panic(err.Error()) } fmt.Printf("%+v\n", response) } ``` #### Response ```json { "data": { "created_at": "2026-04-23T16:09:51.746912+00:00", "feedback_id": "019dbb1a-d782-7f42-8dd8-a1a7ca5d48e3" }, "metadata": { "request_id": "372a359a-fd4f-4c69-8f11-d80831aa5f23" } } ``` ## Domain Types ### Create Feedback Response - `type CreateFeedbackResponse struct{…}` - `CreatedAt string` - `FeedbackID string` # Responses ## Get Response By ID `client.V1.OmniAI.Responses.GetResponseByID(ctx, responseID, query) (*V1OmniAIResponseGetResponseByIDResponse, error)` **get** `/v1/omni-ai/responses/{response_id}` Poll a response for assistant output. Returns the current snapshot of an in-progress or completed response. While the status is `queued` or `running`, the content may be partial and may include `thinking` parts. Poll this endpoint periodically until the status reaches a terminal value (`succeeded`, `failed`, or `canceled`). Once terminal, the finalized assistant message is available in thread history via `GET /omni-ai/threads/{thread_id}/messages`. ### Parameters - `responseID string` - `query V1OmniAIResponseGetResponseByIDParams` - `AccountID param.Field[int64]` Account ID for the request ### Returns - `type V1OmniAIResponseGetResponseByIDResponse struct{…}` - `Data Response` Dynamic pollable response. - `ID string` - `Status ResponseStatus` Dynamic lifecycle status for a pollable response. - `const ResponseStatusQueued ResponseStatus = "queued"` - `const ResponseStatusRunning ResponseStatus = "running"` - `const ResponseStatusSucceeded ResponseStatus = "succeeded"` - `const ResponseStatusFailed ResponseStatus = "failed"` - `const ResponseStatusCanceled ResponseStatus = "canceled"` - `ThreadID string` - `UserMessageID string` - `Content ResponseContent` Dynamic response content container. May include thinking parts. - `Parts []ResponseContentPartUnion` - `type ResponseContentPartObject struct{…}` Text content part. - `Type string` - `const ResponseContentPartObjectTypeText ResponseContentPartObjectType = "text"` - `type ResponseContentPartObject2 struct{…}` Thinking content part shown on dynamic response polling. - `Type string` - `const ResponseContentPartObject2TypeThinking ResponseContentPartObject2Type = "thinking"` - `type ResponseContentPartObject3 struct{…}` Structured action content part. - `Type string` - `const ResponseContentPartObject3TypeStructuredAction ResponseContentPartObject3Type = "structured_action"` - `type ResponseContentPartObject4 struct{…}` Chart payload content part. - `Type string` - `const ResponseContentPartObject4TypeChart ResponseContentPartObject4Type = "chart"` - `type ResponseContentPartObject5 struct{…}` Suggested actions payload content part. - `Type string` - `const ResponseContentPartObject5TypeSuggestedActions ResponseContentPartObject5Type = "suggested_actions"` - `type ResponseContentPartObject6 struct{…}` Escape-hatch custom payload content part. - `Type string` - `const ResponseContentPartObject6TypeCustom ResponseContentPartObject6Type = "custom"` - `Error ErrorStatus` Shared sanitized error payload. - `Code string` - `Message string` - `Details any` - `OutputMessageID string` ### Example ```go package main import ( "context" "fmt" "github.com/clear-street/clear-street-go" "github.com/clear-street/clear-street-go/option" ) func main() { client := clearstreet.NewClient( option.WithAPIKey("My API Key"), ) response, err := client.V1.OmniAI.Responses.GetResponseByID( context.TODO(), "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", clearstreet.V1OmniAIResponseGetResponseByIDParams{ AccountID: 0, }, ) if err != nil { panic(err.Error()) } fmt.Printf("%+v\n", response) } ``` #### Response ```json { "data": { "content": { "parts": [ { "text": "AAPL is currently trading at ...", "type": "text" }, { "thoughts": [ "Fetching current market data for AAPL..." ], "type": "thinking" } ] }, "id": "019dbafd-db54-7523-a412-ec9195cc5d99", "output_message_id": "019dbafd-db61-73a0-8bd9-d4034d132f81", "status": "succeeded", "thread_id": "019dbafd-db54-7523-a412-ec8a292246ad", "user_message_id": "019dbafd-db56-78a2-8a91-d54a39f44174" }, "metadata": { "request_id": "abc16101-2cbc-475a-84ef-98c8c588dcbb" } } ``` ## Cancel Response `client.V1.OmniAI.Responses.CancelResponse(ctx, responseID, body) (*V1OmniAIResponseCancelResponseResponse, error)` **delete** `/v1/omni-ai/responses/{response_id}` Cancel a response. Requests cancellation of a queued or running response. If the response has already reached a terminal status, this is an idempotent success. A canceled turn still produces a final assistant message with outcome `canceled` in the thread history. ### Parameters - `responseID string` - `body V1OmniAIResponseCancelResponseParams` - `AccountID param.Field[int64]` Account ID for the request ### Returns - `type V1OmniAIResponseCancelResponseResponse struct{…}` - `Data CancelResponsePayload` - `Canceled bool` ### Example ```go package main import ( "context" "fmt" "github.com/clear-street/clear-street-go" "github.com/clear-street/clear-street-go/option" ) func main() { client := clearstreet.NewClient( option.WithAPIKey("My API Key"), ) response, err := client.V1.OmniAI.Responses.CancelResponse( context.TODO(), "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", clearstreet.V1OmniAIResponseCancelResponseParams{ AccountID: 0, }, ) if err != nil { panic(err.Error()) } fmt.Printf("%+v\n", response) } ``` #### Response ```json { "data": { "canceled": false }, "metadata": { "request_id": "fa26a786-f5d3-48b0-80eb-778e17af4964" } } ``` ## Domain Types ### Cancel Response Payload - `type CancelResponsePayload struct{…}` - `Canceled bool` ### Error Status - `type ErrorStatus struct{…}` Shared sanitized error payload. - `Code string` - `Message string` - `Details any` ### Response - `type Response struct{…}` Dynamic pollable response. - `ID string` - `Status ResponseStatus` Dynamic lifecycle status for a pollable response. - `const ResponseStatusQueued ResponseStatus = "queued"` - `const ResponseStatusRunning ResponseStatus = "running"` - `const ResponseStatusSucceeded ResponseStatus = "succeeded"` - `const ResponseStatusFailed ResponseStatus = "failed"` - `const ResponseStatusCanceled ResponseStatus = "canceled"` - `ThreadID string` - `UserMessageID string` - `Content ResponseContent` Dynamic response content container. May include thinking parts. - `Parts []ResponseContentPartUnion` - `type ResponseContentPartObject struct{…}` Text content part. - `Type string` - `const ResponseContentPartObjectTypeText ResponseContentPartObjectType = "text"` - `type ResponseContentPartObject2 struct{…}` Thinking content part shown on dynamic response polling. - `Type string` - `const ResponseContentPartObject2TypeThinking ResponseContentPartObject2Type = "thinking"` - `type ResponseContentPartObject3 struct{…}` Structured action content part. - `Type string` - `const ResponseContentPartObject3TypeStructuredAction ResponseContentPartObject3Type = "structured_action"` - `type ResponseContentPartObject4 struct{…}` Chart payload content part. - `Type string` - `const ResponseContentPartObject4TypeChart ResponseContentPartObject4Type = "chart"` - `type ResponseContentPartObject5 struct{…}` Suggested actions payload content part. - `Type string` - `const ResponseContentPartObject5TypeSuggestedActions ResponseContentPartObject5Type = "suggested_actions"` - `type ResponseContentPartObject6 struct{…}` Escape-hatch custom payload content part. - `Type string` - `const ResponseContentPartObject6TypeCustom ResponseContentPartObject6Type = "custom"` - `Error ErrorStatus` Shared sanitized error payload. - `Code string` - `Message string` - `Details any` - `OutputMessageID string` ### Response Content - `type ResponseContent struct{…}` Dynamic response content container. May include thinking parts. - `Parts []ResponseContentPartUnion` - `type ResponseContentPartObject struct{…}` Text content part. - `Type string` - `const ResponseContentPartObjectTypeText ResponseContentPartObjectType = "text"` - `type ResponseContentPartObject2 struct{…}` Thinking content part shown on dynamic response polling. - `Type string` - `const ResponseContentPartObject2TypeThinking ResponseContentPartObject2Type = "thinking"` - `type ResponseContentPartObject3 struct{…}` Structured action content part. - `Type string` - `const ResponseContentPartObject3TypeStructuredAction ResponseContentPartObject3Type = "structured_action"` - `type ResponseContentPartObject4 struct{…}` Chart payload content part. - `Type string` - `const ResponseContentPartObject4TypeChart ResponseContentPartObject4Type = "chart"` - `type ResponseContentPartObject5 struct{…}` Suggested actions payload content part. - `Type string` - `const ResponseContentPartObject5TypeSuggestedActions ResponseContentPartObject5Type = "suggested_actions"` - `type ResponseContentPartObject6 struct{…}` Escape-hatch custom payload content part. - `Type string` - `const ResponseContentPartObject6TypeCustom ResponseContentPartObject6Type = "custom"` ### Response Content Part - `type ResponseContentPartUnion interface{…}` Dynamic content part visible on a pollable response. - `type ResponseContentPartObject struct{…}` Text content part. - `Type string` - `const ResponseContentPartObjectTypeText ResponseContentPartObjectType = "text"` - `type ResponseContentPartObject2 struct{…}` Thinking content part shown on dynamic response polling. - `Type string` - `const ResponseContentPartObject2TypeThinking ResponseContentPartObject2Type = "thinking"` - `type ResponseContentPartObject3 struct{…}` Structured action content part. - `Type string` - `const ResponseContentPartObject3TypeStructuredAction ResponseContentPartObject3Type = "structured_action"` - `type ResponseContentPartObject4 struct{…}` Chart payload content part. - `Type string` - `const ResponseContentPartObject4TypeChart ResponseContentPartObject4Type = "chart"` - `type ResponseContentPartObject5 struct{…}` Suggested actions payload content part. - `Type string` - `const ResponseContentPartObject5TypeSuggestedActions ResponseContentPartObject5Type = "suggested_actions"` - `type ResponseContentPartObject6 struct{…}` Escape-hatch custom payload content part. - `Type string` - `const ResponseContentPartObject6TypeCustom ResponseContentPartObject6Type = "custom"` ### Response Status - `type ResponseStatus string` Dynamic lifecycle status for a pollable response. - `const ResponseStatusQueued ResponseStatus = "queued"` - `const ResponseStatusRunning ResponseStatus = "running"` - `const ResponseStatusSucceeded ResponseStatus = "succeeded"` - `const ResponseStatusFailed ResponseStatus = "failed"` - `const ResponseStatusCanceled ResponseStatus = "canceled"` # Threads ## Get Threads `client.V1.OmniAI.Threads.GetThreads(ctx, query) (*V1OmniAIThreadGetThreadsResponse, error)` **get** `/v1/omni-ai/threads` List conversation threads. Returns thread metadata ordered by most recently created first. Use `page_size` and `page_token` for pagination. Thread objects contain only metadata (title, timestamps) — use the messages endpoint for conversation history. ### Parameters - `query V1OmniAIThreadGetThreadsParams` - `AccountID param.Field[int64]` Account ID for the request - `PageSize param.Field[int64]` The number of items to return per page. Only used when page_token is not provided. - `PageToken param.Field[string]` Token for retrieving the next or previous page of results. Contains encoded pagination state; when provided, page_size is ignored. ### Returns - `type V1OmniAIThreadGetThreadsResponse struct{…}` - `Data ThreadList` - `ID string` - `CreatedAt string` - `Title string` - `UpdatedAt string` ### Example ```go package main import ( "context" "fmt" "github.com/clear-street/clear-street-go" "github.com/clear-street/clear-street-go/option" ) func main() { client := clearstreet.NewClient( option.WithAPIKey("My API Key"), ) response, err := client.V1.OmniAI.Threads.GetThreads(context.TODO(), clearstreet.V1OmniAIThreadGetThreadsParams{ AccountID: 0, }) if err != nil { panic(err.Error()) } fmt.Printf("%+v\n", response) } ``` #### Response ```json { "data": [ { "created_at": "2026-04-23T15:15:54.929830+00:00", "id": "019dbae9-73b3-7fe0-bd14-25fe57e91475", "title": "What is current price of AAPL?", "updated_at": "2026-04-23T15:15:54.929830+00:00" } ], "metadata": { "request_id": "eb95e1b8-d245-41b1-bbd0-cc1073e68bfd" } } ``` ## Get Thread By ID `client.V1.OmniAI.Threads.GetThreadByID(ctx, threadID, query) (*V1OmniAIThreadGetThreadByIDResponse, error)` **get** `/v1/omni-ai/threads/{thread_id}` Get a specific thread. Returns metadata (title, timestamps) for a single thread. Does not include messages — use `GET /omni-ai/threads/{thread_id}/messages` for conversation history. ### Parameters - `threadID string` - `query V1OmniAIThreadGetThreadByIDParams` - `AccountID param.Field[int64]` Account ID for the request ### Returns - `type V1OmniAIThreadGetThreadByIDResponse struct{…}` - `Data Thread` Thread metadata returned by list/get thread endpoints. - `ID string` - `CreatedAt string` - `Title string` - `UpdatedAt string` ### Example ```go package main import ( "context" "fmt" "github.com/clear-street/clear-street-go" "github.com/clear-street/clear-street-go/option" ) func main() { client := clearstreet.NewClient( option.WithAPIKey("My API Key"), ) response, err := client.V1.OmniAI.Threads.GetThreadByID( context.TODO(), "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", clearstreet.V1OmniAIThreadGetThreadByIDParams{ AccountID: 0, }, ) if err != nil { panic(err.Error()) } fmt.Printf("%+v\n", response) } ``` #### Response ```json { "data": { "created_at": "2026-04-23T15:15:54.929830+00:00", "id": "019dbae9-73b3-7fe0-bd14-25fe57e91475", "title": "What is current price of AAPL?", "updated_at": "2026-04-23T15:15:54.929830+00:00" }, "metadata": { "request_id": "5683a394-6dd1-4843-8591-f102ced2e636" } } ``` ## Create Thread `client.V1.OmniAI.Threads.NewThread(ctx, body) (*V1OmniAIThreadNewThreadResponse, error)` **post** `/v1/omni-ai/threads` Create a new conversation thread. Atomically creates a new thread and submits the first user turn. The response contains a `response_id` that should be polled via `GET /omni-ai/responses/{response_id}` for assistant output. Two creation modes are supported: - **instant** — provide `text` with a natural-language prompt. - **deep\_insights** — provide a `target` ticker and optional `thesis` for long-form research. ### Parameters - `body V1OmniAIThreadNewThreadParams` - `AccountID param.Field[int64]` - `Type param.Field[V1OmniAIThreadNewThreadParamsType]` Thread creation mode. - `const V1OmniAIThreadNewThreadParamsTypeInstant V1OmniAIThreadNewThreadParamsType = "instant"` - `const V1OmniAIThreadNewThreadParamsTypeDeepInsights V1OmniAIThreadNewThreadParamsType = "deep_insights"` - `Capabilities param.Field[[]string]` - `const V1OmniAIThreadNewThreadParamsCapabilityPrefillOrder V1OmniAIThreadNewThreadParamsCapability = "PREFILL_ORDER"` - `const V1OmniAIThreadNewThreadParamsCapabilityOpenChart V1OmniAIThreadNewThreadParamsCapability = "OPEN_CHART"` - `const V1OmniAIThreadNewThreadParamsCapabilityOpenScreener V1OmniAIThreadNewThreadParamsCapability = "OPEN_SCREENER"` - `const V1OmniAIThreadNewThreadParamsCapabilityOpenEntitlementConsent V1OmniAIThreadNewThreadParamsCapability = "OPEN_ENTITLEMENT_CONSENT"` - `Target param.Field[V1OmniAIThreadNewThreadParamsTarget]` Deep-insights target payload. - `Ticker string` - `Type string` Deep-insights target type. Launch supports ticker-only. - `const V1OmniAIThreadNewThreadParamsTargetTypeTicker V1OmniAIThreadNewThreadParamsTargetType = "ticker"` - `Text param.Field[string]` - `Thesis param.Field[string]` ### Returns - `type V1OmniAIThreadNewThreadResponse struct{…}` - `Data CreateThreadResponse` Response payload for thread creation. - `ResponseID string` - `ThreadID string` - `UserMessageID string` ### Example ```go package main import ( "context" "fmt" "github.com/clear-street/clear-street-go" "github.com/clear-street/clear-street-go/option" ) func main() { client := clearstreet.NewClient( option.WithAPIKey("My API Key"), ) response, err := client.V1.OmniAI.Threads.NewThread(context.TODO(), clearstreet.V1OmniAIThreadNewThreadParams{ AccountID: 19816, Type: clearstreet.V1OmniAIThreadNewThreadParamsTypeInstant, }) if err != nil { panic(err.Error()) } fmt.Printf("%+v\n", response) } ``` #### Response ```json { "data": { "response_id": "019dbae9-73b4-7760-a947-8b4bcab57c49", "thread_id": "019dbae9-73b3-7fe0-bd14-25fe57e91475", "user_message_id": "019dbae9-73b8-75b2-9c06-ac348927696d" }, "metadata": { "request_id": "f7a9ad4d-753a-403e-aa0e-ca151f991a81" } } ``` ## Get Thread Response `client.V1.OmniAI.Threads.GetThreadResponse(ctx, threadID, query) (*V1OmniAIThreadGetThreadResponseResponse, error)` **get** `/v1/omni-ai/threads/{thread_id}/response` Get the active response for a thread. Convenience endpoint to look up the currently active response for a thread without knowing the `response_id`. Useful when reloading a thread whose last finalized message is a `USER` message — this indicates an assistant turn is likely in progress. Returns **404** if no active response exists (the thread is idle). ### Parameters - `threadID string` - `query V1OmniAIThreadGetThreadResponseParams` - `AccountID param.Field[int64]` Account ID for the request ### Returns - `type V1OmniAIThreadGetThreadResponseResponse struct{…}` - `Data Response` Dynamic pollable response. - `ID string` - `Status ResponseStatus` Dynamic lifecycle status for a pollable response. - `const ResponseStatusQueued ResponseStatus = "queued"` - `const ResponseStatusRunning ResponseStatus = "running"` - `const ResponseStatusSucceeded ResponseStatus = "succeeded"` - `const ResponseStatusFailed ResponseStatus = "failed"` - `const ResponseStatusCanceled ResponseStatus = "canceled"` - `ThreadID string` - `UserMessageID string` - `Content ResponseContent` Dynamic response content container. May include thinking parts. - `Parts []ResponseContentPartUnion` - `type ResponseContentPartObject struct{…}` Text content part. - `Type string` - `const ResponseContentPartObjectTypeText ResponseContentPartObjectType = "text"` - `type ResponseContentPartObject2 struct{…}` Thinking content part shown on dynamic response polling. - `Type string` - `const ResponseContentPartObject2TypeThinking ResponseContentPartObject2Type = "thinking"` - `type ResponseContentPartObject3 struct{…}` Structured action content part. - `Type string` - `const ResponseContentPartObject3TypeStructuredAction ResponseContentPartObject3Type = "structured_action"` - `type ResponseContentPartObject4 struct{…}` Chart payload content part. - `Type string` - `const ResponseContentPartObject4TypeChart ResponseContentPartObject4Type = "chart"` - `type ResponseContentPartObject5 struct{…}` Suggested actions payload content part. - `Type string` - `const ResponseContentPartObject5TypeSuggestedActions ResponseContentPartObject5Type = "suggested_actions"` - `type ResponseContentPartObject6 struct{…}` Escape-hatch custom payload content part. - `Type string` - `const ResponseContentPartObject6TypeCustom ResponseContentPartObject6Type = "custom"` - `Error ErrorStatus` Shared sanitized error payload. - `Code string` - `Message string` - `Details any` - `OutputMessageID string` ### Example ```go package main import ( "context" "fmt" "github.com/clear-street/clear-street-go" "github.com/clear-street/clear-street-go/option" ) func main() { client := clearstreet.NewClient( option.WithAPIKey("My API Key"), ) response, err := client.V1.OmniAI.Threads.GetThreadResponse( context.TODO(), "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", clearstreet.V1OmniAIThreadGetThreadResponseParams{ AccountID: 0, }, ) if err != nil { panic(err.Error()) } fmt.Printf("%+v\n", response) } ``` #### Response ```json { "data": { "content": { "parts": [ { "text": "", "type": "text" }, { "thoughts": [ "[1/4] Running parallel analysis on AAPL -- fundamentals, technicals, sentiment, and macro..." ], "type": "thinking" } ] }, "id": "019dbb03-cf23-74e1-9c31-ef0136ff7fed", "output_message_id": "019dbb03-cf32-74d1-906b-a148d4be3da9", "status": "running", "thread_id": "019dbb03-cf22-7da0-a663-f51c756efa07", "user_message_id": "019dbb03-cf24-7b03-8286-5bfc2411b052" }, "metadata": { "request_id": "927a85a6-b11b-4cc5-a2cd-3f46ae64e85d" } } ``` ## Get Messages `client.V1.OmniAI.Threads.GetMessages(ctx, threadID, query) (*V1OmniAIThreadGetMessagesResponse, error)` **get** `/v1/omni-ai/threads/{thread_id}/messages` List finalized messages in a thread. Returns **finalized** messages in chronological order. Messages from in-progress assistant turns are excluded — use `GET /omni-ai/threads/{thread_id}/response` or `GET /omni-ai/responses/{response_id}` for live output. If the last finalized message has role `USER`, an active response likely exists and should be polled separately. ### Parameters - `threadID string` - `query V1OmniAIThreadGetMessagesParams` - `AccountID param.Field[int64]` Account ID for the request - `PageSize param.Field[int64]` The number of items to return per page. Only used when page_token is not provided. - `PageToken param.Field[string]` Token for retrieving the next or previous page of results. Contains encoded pagination state; when provided, page_size is ignored. ### Returns - `type V1OmniAIThreadGetMessagesResponse struct{…}` - `Data MessageList` - `ID string` - `Content MessageContent` Finalized immutable message content container. Never includes thinking parts. - `Parts []MessageContentPartUnion` - `type MessageContentPartObject struct{…}` Text content part. - `Type string` - `const MessageContentPartObjectTypeText MessageContentPartObjectType = "text"` - `type MessageContentPartObject2 struct{…}` Structured action content part. - `Type string` - `const MessageContentPartObject2TypeStructuredAction MessageContentPartObject2Type = "structured_action"` - `type MessageContentPartObject3 struct{…}` Chart payload content part. - `Type string` - `const MessageContentPartObject3TypeChart MessageContentPartObject3Type = "chart"` - `type MessageContentPartObject4 struct{…}` Suggested actions payload content part. - `Type string` - `const MessageContentPartObject4TypeSuggestedActions MessageContentPartObject4Type = "suggested_actions"` - `type MessageContentPartObject5 struct{…}` Escape-hatch custom payload content part. - `Type string` - `const MessageContentPartObject5TypeCustom MessageContentPartObject5Type = "custom"` - `CreatedAt string` - `Outcome MessageOutcome` Immutable terminal outcome for a finalized assistant message. - `const MessageOutcomeCompleted MessageOutcome = "completed"` - `const MessageOutcomeErrored MessageOutcome = "errored"` - `const MessageOutcomeCanceled MessageOutcome = "canceled"` - `Role MessageRole` Finalized message role in the public contract. - `const MessageRoleUser MessageRole = "USER"` - `const MessageRoleAssistant MessageRole = "ASSISTANT"` - `Seq int64` - `ThreadID string` - `Error ErrorStatus` Shared sanitized error payload. - `Code string` - `Message string` - `Details any` ### Example ```go package main import ( "context" "fmt" "github.com/clear-street/clear-street-go" "github.com/clear-street/clear-street-go/option" ) func main() { client := clearstreet.NewClient( option.WithAPIKey("My API Key"), ) response, err := client.V1.OmniAI.Threads.GetMessages( context.TODO(), "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", clearstreet.V1OmniAIThreadGetMessagesParams{ AccountID: 0, }, ) if err != nil { panic(err.Error()) } fmt.Printf("%+v\n", response) } ``` #### Response ```json { "data": [ { "content": { "parts": [ { "text": "How are the markets doing today?", "type": "text" } ] }, "created_at": "2026-04-16T09:20:17.274943+00:00", "id": "019d9597-5983-7691-8281-7ce264127740", "outcome": "completed", "role": "USER", "seq": 1, "thread_id": "019d9597-597c-7571-a0c9-a49c0e51f6eb" }, { "content": { "parts": [ { "text": "**Pre-market as of 7:30 AM ET**\n\n ...", "type": "text" }, { "payload": { "actionButtons": [ { "buttonId": "btn_followup_0", "label": "Check my positions", "prompt": { "prompt": "What are my current positions?" } } ] }, "type": "suggested_actions" } ] }, "created_at": "2026-04-16T09:20:17.309212+00:00", "id": "019d9597-599c-7132-a7de-e5c21eaaab77", "outcome": "completed", "role": "ASSISTANT", "seq": 2, "thread_id": "019d9597-597c-7571-a0c9-a49c0e51f6eb" } ], "metadata": { "request_id": "664c0f85-cdab-4fac-afe3-8ecc0148cd4a" } } ``` ## Create Message `client.V1.OmniAI.Threads.NewMessage(ctx, threadID, body) (*V1OmniAIThreadNewMessageResponse, error)` **post** `/v1/omni-ai/threads/{thread_id}/messages` Continue an existing conversation thread. Appends a new user message to the thread and starts an assistant response. Only one response may be active per thread at a time — if the previous turn is still in progress, this endpoint returns **409 Conflict**. Wait for the active response to reach a terminal status before submitting the next turn. Poll the returned `response_id` via `GET /omni-ai/responses/{response_id}` for assistant output. ### Parameters - `threadID string` - `body V1OmniAIThreadNewMessageParams` - `AccountID param.Field[int64]` - `Text param.Field[string]` - `Capabilities param.Field[[]string]` - `const V1OmniAIThreadNewMessageParamsCapabilityPrefillOrder V1OmniAIThreadNewMessageParamsCapability = "PREFILL_ORDER"` - `const V1OmniAIThreadNewMessageParamsCapabilityOpenChart V1OmniAIThreadNewMessageParamsCapability = "OPEN_CHART"` - `const V1OmniAIThreadNewMessageParamsCapabilityOpenScreener V1OmniAIThreadNewMessageParamsCapability = "OPEN_SCREENER"` - `const V1OmniAIThreadNewMessageParamsCapabilityOpenEntitlementConsent V1OmniAIThreadNewMessageParamsCapability = "OPEN_ENTITLEMENT_CONSENT"` ### Returns - `type V1OmniAIThreadNewMessageResponse struct{…}` - `Data CreateMessageResponse` Response payload for continuing a thread with a new message. - `ResponseID string` - `ThreadID string` - `UserMessageID string` ### Example ```go package main import ( "context" "fmt" "github.com/clear-street/clear-street-go" "github.com/clear-street/clear-street-go/option" ) func main() { client := clearstreet.NewClient( option.WithAPIKey("My API Key"), ) response, err := client.V1.OmniAI.Threads.NewMessage( context.TODO(), "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", clearstreet.V1OmniAIThreadNewMessageParams{ AccountID: 19816, Text: "Compare that to AMD.", }, ) if err != nil { panic(err.Error()) } fmt.Printf("%+v\n", response) } ``` #### Response ```json { "data": { "response_id": "019dbaec-8dd3-7fa3-89d0-5303609f125f", "thread_id": "019dbae9-73b3-7fe0-bd14-25fe57e91475", "user_message_id": "019dbaec-8dd4-7f91-bce2-3ec8fba79eb7" }, "metadata": { "request_id": "48775400-61f4-4c6c-bc6d-8f4996c571c7" } } ``` ## Domain Types ### Create Message Response - `type CreateMessageResponse struct{…}` Response payload for continuing a thread with a new message. - `ResponseID string` - `ThreadID string` - `UserMessageID string` ### Create Thread Response - `type CreateThreadResponse struct{…}` Response payload for thread creation. - `ResponseID string` - `ThreadID string` - `UserMessageID string` ### Message - `type Message struct{…}` Final immutable message. - `ID string` - `Content MessageContent` Finalized immutable message content container. Never includes thinking parts. - `Parts []MessageContentPartUnion` - `type MessageContentPartObject struct{…}` Text content part. - `Type string` - `const MessageContentPartObjectTypeText MessageContentPartObjectType = "text"` - `type MessageContentPartObject2 struct{…}` Structured action content part. - `Type string` - `const MessageContentPartObject2TypeStructuredAction MessageContentPartObject2Type = "structured_action"` - `type MessageContentPartObject3 struct{…}` Chart payload content part. - `Type string` - `const MessageContentPartObject3TypeChart MessageContentPartObject3Type = "chart"` - `type MessageContentPartObject4 struct{…}` Suggested actions payload content part. - `Type string` - `const MessageContentPartObject4TypeSuggestedActions MessageContentPartObject4Type = "suggested_actions"` - `type MessageContentPartObject5 struct{…}` Escape-hatch custom payload content part. - `Type string` - `const MessageContentPartObject5TypeCustom MessageContentPartObject5Type = "custom"` - `CreatedAt string` - `Outcome MessageOutcome` Immutable terminal outcome for a finalized assistant message. - `const MessageOutcomeCompleted MessageOutcome = "completed"` - `const MessageOutcomeErrored MessageOutcome = "errored"` - `const MessageOutcomeCanceled MessageOutcome = "canceled"` - `Role MessageRole` Finalized message role in the public contract. - `const MessageRoleUser MessageRole = "USER"` - `const MessageRoleAssistant MessageRole = "ASSISTANT"` - `Seq int64` - `ThreadID string` - `Error ErrorStatus` Shared sanitized error payload. - `Code string` - `Message string` - `Details any` ### Message Content - `type MessageContent struct{…}` Finalized immutable message content container. Never includes thinking parts. - `Parts []MessageContentPartUnion` - `type MessageContentPartObject struct{…}` Text content part. - `Type string` - `const MessageContentPartObjectTypeText MessageContentPartObjectType = "text"` - `type MessageContentPartObject2 struct{…}` Structured action content part. - `Type string` - `const MessageContentPartObject2TypeStructuredAction MessageContentPartObject2Type = "structured_action"` - `type MessageContentPartObject3 struct{…}` Chart payload content part. - `Type string` - `const MessageContentPartObject3TypeChart MessageContentPartObject3Type = "chart"` - `type MessageContentPartObject4 struct{…}` Suggested actions payload content part. - `Type string` - `const MessageContentPartObject4TypeSuggestedActions MessageContentPartObject4Type = "suggested_actions"` - `type MessageContentPartObject5 struct{…}` Escape-hatch custom payload content part. - `Type string` - `const MessageContentPartObject5TypeCustom MessageContentPartObject5Type = "custom"` ### Message Content Part - `type MessageContentPartUnion interface{…}` Final immutable content part visible on persisted messages. - `type MessageContentPartObject struct{…}` Text content part. - `Type string` - `const MessageContentPartObjectTypeText MessageContentPartObjectType = "text"` - `type MessageContentPartObject2 struct{…}` Structured action content part. - `Type string` - `const MessageContentPartObject2TypeStructuredAction MessageContentPartObject2Type = "structured_action"` - `type MessageContentPartObject3 struct{…}` Chart payload content part. - `Type string` - `const MessageContentPartObject3TypeChart MessageContentPartObject3Type = "chart"` - `type MessageContentPartObject4 struct{…}` Suggested actions payload content part. - `Type string` - `const MessageContentPartObject4TypeSuggestedActions MessageContentPartObject4Type = "suggested_actions"` - `type MessageContentPartObject5 struct{…}` Escape-hatch custom payload content part. - `Type string` - `const MessageContentPartObject5TypeCustom MessageContentPartObject5Type = "custom"` ### Message List - `type MessageList []Message` - `ID string` - `Content MessageContent` Finalized immutable message content container. Never includes thinking parts. - `Parts []MessageContentPartUnion` - `type MessageContentPartObject struct{…}` Text content part. - `Type string` - `const MessageContentPartObjectTypeText MessageContentPartObjectType = "text"` - `type MessageContentPartObject2 struct{…}` Structured action content part. - `Type string` - `const MessageContentPartObject2TypeStructuredAction MessageContentPartObject2Type = "structured_action"` - `type MessageContentPartObject3 struct{…}` Chart payload content part. - `Type string` - `const MessageContentPartObject3TypeChart MessageContentPartObject3Type = "chart"` - `type MessageContentPartObject4 struct{…}` Suggested actions payload content part. - `Type string` - `const MessageContentPartObject4TypeSuggestedActions MessageContentPartObject4Type = "suggested_actions"` - `type MessageContentPartObject5 struct{…}` Escape-hatch custom payload content part. - `Type string` - `const MessageContentPartObject5TypeCustom MessageContentPartObject5Type = "custom"` - `CreatedAt string` - `Outcome MessageOutcome` Immutable terminal outcome for a finalized assistant message. - `const MessageOutcomeCompleted MessageOutcome = "completed"` - `const MessageOutcomeErrored MessageOutcome = "errored"` - `const MessageOutcomeCanceled MessageOutcome = "canceled"` - `Role MessageRole` Finalized message role in the public contract. - `const MessageRoleUser MessageRole = "USER"` - `const MessageRoleAssistant MessageRole = "ASSISTANT"` - `Seq int64` - `ThreadID string` - `Error ErrorStatus` Shared sanitized error payload. - `Code string` - `Message string` - `Details any` ### Message Outcome - `type MessageOutcome string` Immutable terminal outcome for a finalized assistant message. - `const MessageOutcomeCompleted MessageOutcome = "completed"` - `const MessageOutcomeErrored MessageOutcome = "errored"` - `const MessageOutcomeCanceled MessageOutcome = "canceled"` ### Message Role - `type MessageRole string` Finalized message role in the public contract. - `const MessageRoleUser MessageRole = "USER"` - `const MessageRoleAssistant MessageRole = "ASSISTANT"` ### Thread - `type Thread struct{…}` Thread metadata returned by list/get thread endpoints. - `ID string` - `CreatedAt string` - `Title string` - `UpdatedAt string` ### Thread List - `type ThreadList []Thread` - `ID string` - `CreatedAt string` - `Title string` - `UpdatedAt string`