# Omni AI ## Domain Types ### Action Button - `class ActionButton:` Button metadata shared by chart and suggested-actions payloads. - `String buttonId` Stable button identifier within the content part. - `String label` User-visible label. - `Optional prompt` Follow-up prompt to submit as the next user message. - `String prompt` Prompt text to submit as the next user turn. - `Optional structuredAction` Structured action in the same message to execute on click. - `Optional actionId` UUID of a `structured_action` content part in the same message. ### Chart Payload - `class ChartPayload:` Typed chart payload rendered inline in assistant content. - `String chartId` Stable chart identifier scoped to the content part. - `Optional> actionButtons` Buttons associated with this chart. - `String buttonId` Stable button identifier within the content part. - `String label` User-visible label. - `Optional prompt` Follow-up prompt to submit as the next user message. - `String prompt` Prompt text to submit as the next user turn. - `Optional structuredAction` Structured action in the same message to execute on click. - `Optional actionId` UUID of a `structured_action` content part in the same message. - `Optional dataChart` Explicit series-driven chart definition. - `Optional> series` - `String name` - `Optional> points` - `String x` - `double y` - `Optional symbolChart` Symbol-driven chart definition. - `String symbol` - `Optional timeframe` ### Chart Point - `class ChartPoint:` Single chart coordinate. - `String x` - `double y` ### Chart Series - `class ChartSeries:` Named data series within a chart. - `String name` - `Optional> points` - `String x` - `double y` ### Content Part Chart Payload - `class ContentPartChartPayload:` Chart payload content part. - `ChartPayload payload` Typed chart payload rendered inline in assistant content. - `String chartId` Stable chart identifier scoped to the content part. - `Optional> actionButtons` Buttons associated with this chart. - `String buttonId` Stable button identifier within the content part. - `String label` User-visible label. - `Optional prompt` Follow-up prompt to submit as the next user message. - `String prompt` Prompt text to submit as the next user turn. - `Optional structuredAction` Structured action in the same message to execute on click. - `Optional actionId` UUID of a `structured_action` content part in the same message. - `Optional dataChart` Explicit series-driven chart definition. - `Optional> series` - `String name` - `Optional> points` - `String x` - `double y` - `Optional symbolChart` Symbol-driven chart definition. - `String symbol` - `Optional timeframe` ### Content Part Custom Payload - `class ContentPartCustomPayload:` Escape-hatch custom payload content part. - `JsonValue payload` ### Content Part Structured Action Payload - `class ContentPartStructuredActionPayload:` Structured action content part. - `StructuredAction action` 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. - `PrefillOrder` - `PrefillOrderAction prefillOrder` Prefill an order ticket for user confirmation - `PrefillNewOrderAction` - `ActionType actionType` - `NEW("NEW")` - `PrefillCancelOrderAction` - `ActionType actionType` - `CANCEL("CANCEL")` - `OpenChart` - `OpenChartAction openChart` Open a chart for a symbol - `String symbol` Trading symbol to chart - `Optional extras` Additional chart configuration (indicators, overlays, etc.) - `Optional timeframe` Chart timeframe (e.g., "1D", "1W", "1M", "3M", "1Y", "5Y") - `OpenScreener` - `OpenScreenerAction openScreener` Open a stock screener with filters - `List filters` Filter criteria for the screener - `String field` Field to filter on (e.g., "market_cap", "sector", "price") - `String operator` Comparison operator (e.g., "eq", "gte", "lte", "in") - `JsonValue value` Filter value - `Optional> fieldFilter` Optional field/column selection for screener results. - `Optional pageSize` Optional page size. - `Optional sortBy` Optional sort field for screener rows. - `Optional sortDirection` Optional sort direction (`ASC` or `DESC`). - `OpenEntitlementConsent` - `OpenEntitlementConsentAction openEntitlementConsent` Open entitlement consent flow - `EntitlementAgreementKey agreementKey` Stable entitlement agreement family key. - `OMNI_ACCOUNT_DATA_ACCESS("omni_account_data_access")` - `String reason` - `List requestedEntitlementCodes` - `OMNI_ACCOUNT_DATA("omni.account_data")` - `List tradingAccountIds` - `String actionId` ### Content Part Suggested Actions Payload - `class ContentPartSuggestedActionsPayload:` Suggested actions payload content part. - `SuggestedActionsPayload payload` Suggested follow-up buttons rendered at the end of an assistant message. - `Optional> actionButtons` Ordered message-level buttons. - `String buttonId` Stable button identifier within the content part. - `String label` User-visible label. - `Optional prompt` Follow-up prompt to submit as the next user message. - `String prompt` Prompt text to submit as the next user turn. - `Optional structuredAction` Structured action in the same message to execute on click. - `Optional actionId` UUID of a `structured_action` content part in the same message. ### Content Part Text Payload - `class ContentPartTextPayload:` Text content part. - `String text` ### Content Part Thinking Payload - `class ContentPartThinkingPayload:` Thinking content part shown on dynamic response polling. - `List thoughts` ### Data Chart - `class DataChart:` Chart represented by explicit data series. - `Optional> series` - `String name` - `Optional> points` - `String x` - `double y` ### Open Chart Action - `class OpenChartAction:` Action to open a chart for a symbol. - `String symbol` Trading symbol to chart - `Optional extras` Additional chart configuration (indicators, overlays, etc.) - `Optional timeframe` Chart timeframe (e.g., "1D", "1W", "1M", "3M", "1Y", "5Y") ### Open Entitlement Consent Action - `class OpenEntitlementConsentAction:` Action to open entitlement consent flow for one or more accounts. - `EntitlementAgreementKey agreementKey` Stable entitlement agreement family key. - `OMNI_ACCOUNT_DATA_ACCESS("omni_account_data_access")` - `String reason` - `List requestedEntitlementCodes` - `OMNI_ACCOUNT_DATA("omni.account_data")` - `List tradingAccountIds` ### Open Screener Action - `class OpenScreenerAction:` Action to open a stock screener with filters. - `List filters` Filter criteria for the screener - `String field` Field to filter on (e.g., "market_cap", "sector", "price") - `String operator` Comparison operator (e.g., "eq", "gte", "lte", "in") - `JsonValue value` Filter value - `Optional> fieldFilter` Optional field/column selection for screener results. - `Optional pageSize` Optional page size. - `Optional sortBy` Optional sort field for screener rows. - `Optional sortDirection` Optional sort direction (`ASC` or `DESC`). ### Prefill Cancel Order Action - `class PrefillCancelOrderAction:` Cancel-order prefill action. - `List orders` Orders to cancel using the same identifiers required by the cancel-order API. - `long accountId` Account ID (from path parameter) - `String orderId` Order ID to cancel (from path parameter) ### Prefill New Order Action - `class PrefillNewOrderAction:` New-order prefill action. - `List orders` Orders to prefill using the same shape accepted by the orders API. - `SecurityType instrumentType` Type of security - `COMMON_STOCK("COMMON_STOCK")` - `PREFERRED_STOCK("PREFERRED_STOCK")` - `OPTION("OPTION")` - `CASH("CASH")` - `OTHER("OTHER")` - `RequestOrderType orderType` Type of order - `MARKET("MARKET")` - `LIMIT("LIMIT")` - `STOP("STOP")` - `STOP_LIMIT("STOP_LIMIT")` - `TRAILING_STOP("TRAILING_STOP")` - `TRAILING_STOP_LIMIT("TRAILING_STOP_LIMIT")` - `String quantity` 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 - `BUY("BUY")` - `SELL("SELL")` - `SELL_SHORT("SELL_SHORT")` - `OTHER("OTHER")` - `RequestTimeInForce timeInForce` Time in force - `DAY("DAY")` - `GOOD_TILL_CANCEL("GOOD_TILL_CANCEL")` - `IMMEDIATE_OR_CANCEL("IMMEDIATE_OR_CANCEL")` - `FILL_OR_KILL("FILL_OR_KILL")` - `GOOD_TILL_DATE("GOOD_TILL_DATE")` - `AT_THE_OPENING("AT_THE_OPENING")` - `AT_THE_CLOSE("AT_THE_CLOSE")` - `GOOD_TILL_CROSSING("GOOD_TILL_CROSSING")` - `GOOD_THROUGH_CROSSING("GOOD_THROUGH_CROSSING")` - `AT_CROSSING("AT_CROSSING")` - `Optional id` Optional client-provided unique ID (idempotency). Required to be unique per account. - `Optional expiresAt` The timestamp when the order should expire (UTC). Required when time_in_force is GOOD_TILL_DATE. - `Optional extendedHours` Allow trading outside regular trading hours. Some brokers disallow options outside RTH. - `Optional instrumentId` OEMS instrument UUID - `Optional limitOffset` Limit offset for trailing stop-limit orders (signed) - `Optional limitPrice` Limit price (required for LIMIT and STOP_LIMIT orders) - `Optional positionEffect` Required when instrument_type is OPTION. Specifies whether the order opens or closes a position. - `OPEN("OPEN")` - `CLOSE("CLOSE")` - `Optional stopPrice` Stop price (required for STOP and STOP_LIMIT orders) - `Optional symbol` 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. - `Optional trailingOffset` Trailing offset amount (required for trailing orders) - `Optional trailingOffsetType` Trailing offset type (PRICE or PERCENT_BPS) - `PRICE("PRICE")` - `BPS("BPS")` ### Prefill Order Action - `class PrefillOrderAction: A class that can be one of several variants.union` 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. - `PrefillNewOrderAction` - `ActionType actionType` - `NEW("NEW")` - `PrefillCancelOrderAction` - `ActionType actionType` - `CANCEL("CANCEL")` ### Prompt Button Action - `class PromptButtonAction:` Prompt-style button behavior. - `String prompt` Prompt text to submit as the next user turn. ### Screener Filter - `class ScreenerFilter:` A single filter criterion for the screener. - `String field` Field to filter on (e.g., "market_cap", "sector", "price") - `String operator` Comparison operator (e.g., "eq", "gte", "lte", "in") - `JsonValue value` Filter value ### Structured Action - `class StructuredAction: A class that can be one of several variants.union` 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. - `PrefillOrder` - `PrefillOrderAction prefillOrder` Prefill an order ticket for user confirmation - `PrefillNewOrderAction` - `ActionType actionType` - `NEW("NEW")` - `PrefillCancelOrderAction` - `ActionType actionType` - `CANCEL("CANCEL")` - `OpenChart` - `OpenChartAction openChart` Open a chart for a symbol - `String symbol` Trading symbol to chart - `Optional extras` Additional chart configuration (indicators, overlays, etc.) - `Optional timeframe` Chart timeframe (e.g., "1D", "1W", "1M", "3M", "1Y", "5Y") - `OpenScreener` - `OpenScreenerAction openScreener` Open a stock screener with filters - `List filters` Filter criteria for the screener - `String field` Field to filter on (e.g., "market_cap", "sector", "price") - `String operator` Comparison operator (e.g., "eq", "gte", "lte", "in") - `JsonValue value` Filter value - `Optional> fieldFilter` Optional field/column selection for screener results. - `Optional pageSize` Optional page size. - `Optional sortBy` Optional sort field for screener rows. - `Optional sortDirection` Optional sort direction (`ASC` or `DESC`). - `OpenEntitlementConsent` - `OpenEntitlementConsentAction openEntitlementConsent` Open entitlement consent flow - `EntitlementAgreementKey agreementKey` Stable entitlement agreement family key. - `OMNI_ACCOUNT_DATA_ACCESS("omni_account_data_access")` - `String reason` - `List requestedEntitlementCodes` - `OMNI_ACCOUNT_DATA("omni.account_data")` - `List tradingAccountIds` ### Structured Action Button Action - `class StructuredActionButtonAction:` Structured-action button behavior. - `Optional actionId` UUID of a `structured_action` content part in the same message. ### Suggested Actions Payload - `class SuggestedActionsPayload:` Suggested follow-up buttons rendered at the end of an assistant message. - `Optional> actionButtons` Ordered message-level buttons. - `String buttonId` Stable button identifier within the content part. - `String label` User-visible label. - `Optional prompt` Follow-up prompt to submit as the next user message. - `String prompt` Prompt text to submit as the next user turn. - `Optional structuredAction` Structured action in the same message to execute on click. - `Optional actionId` UUID of a `structured_action` content part in the same message. ### Symbol Chart - `class SymbolChart:` Chart for a single symbol and timeframe. - `String symbol` - `Optional timeframe` # Entitlements ## Get Entitlements `EntitlementGetEntitlementsResponse v1().omniAi().entitlements().getEntitlements(EntitlementGetEntitlementsParamsparams = EntitlementGetEntitlementsParams.none(), RequestOptionsrequestOptions = RequestOptions.none())` **get** `/v1/omni-ai/entitlements` List caller's active entitlement grants. ### Parameters - `EntitlementGetEntitlementsParams params` - `Optional tradingAccountId` ### Returns - `class EntitlementGetEntitlementsResponse:` - `List data` - `String agreementId` - `EntitlementCode entitlementCode` Stable entitlement code granted by an agreement. - `OMNI_ACCOUNT_DATA("omni.account_data")` - `String entitlementId` - `String grantedAt` - `long tradingAccountId` ### Example ```java package com.clear_street.api.example; import com.clear_street.api.client.ClearStreetClient; import com.clear_street.api.client.okhttp.ClearStreetOkHttpClient; import com.clear_street.api.models.v1.omniai.entitlements.EntitlementGetEntitlementsParams; import com.clear_street.api.models.v1.omniai.entitlements.EntitlementGetEntitlementsResponse; public final class Main { private Main() {} public static void main(String[] args) { ClearStreetClient client = ClearStreetOkHttpClient.builder() .fromEnv() .apiKey("My API Key") .build(); EntitlementGetEntitlementsResponse response = client.v1().omniAi().entitlements().getEntitlements(); } } ``` #### 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 `EntitlementCreateEntitlementsResponse v1().omniAi().entitlements().createEntitlements(EntitlementCreateEntitlementsParamsparams, RequestOptionsrequestOptions = RequestOptions.none())` **post** `/v1/omni-ai/entitlements` Record consent and upsert one-or-more active grants. ### Parameters - `EntitlementCreateEntitlementsParams params` - `String agreementId` - `List requestedEntitlementCodes` - `OMNI_ACCOUNT_DATA("omni.account_data")` - `List tradingAccountIds` ### Returns - `class EntitlementCreateEntitlementsResponse:` - `List data` - `String agreementId` - `EntitlementCode entitlementCode` Stable entitlement code granted by an agreement. - `OMNI_ACCOUNT_DATA("omni.account_data")` - `String entitlementId` - `String grantedAt` - `long tradingAccountId` ### Example ```java package com.clear_street.api.example; import com.clear_street.api.client.ClearStreetClient; import com.clear_street.api.client.okhttp.ClearStreetOkHttpClient; import com.clear_street.api.models.v1.omniai.entitlements.EntitlementCode; import com.clear_street.api.models.v1.omniai.entitlements.EntitlementCreateEntitlementsParams; import com.clear_street.api.models.v1.omniai.entitlements.EntitlementCreateEntitlementsResponse; public final class Main { private Main() {} public static void main(String[] args) { ClearStreetClient client = ClearStreetOkHttpClient.builder() .fromEnv() .apiKey("My API Key") .build(); EntitlementCreateEntitlementsParams params = EntitlementCreateEntitlementsParams.builder() .agreementId("01JZ0000000000000000000000") .addRequestedEntitlementCode(EntitlementCode.OMNI_ACCOUNT_DATA) .addTradingAccountId(100019L) .addTradingAccountId(100021L) .build(); EntitlementCreateEntitlementsResponse response = client.v1().omniAi().entitlements().createEntitlements(params); } } ``` #### 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 `EntitlementDeleteEntitlementResponse v1().omniAi().entitlements().deleteEntitlement(EntitlementDeleteEntitlementParamsparams = EntitlementDeleteEntitlementParams.none(), RequestOptionsrequestOptions = RequestOptions.none())` **delete** `/v1/omni-ai/entitlements/{entitlement_id}` Revoke one entitlement grant by id. ### Parameters - `EntitlementDeleteEntitlementParams params` - `Optional entitlementId` ### Returns - `class EntitlementDeleteEntitlementResponse:` - `DeleteEntitlementResponse data` - `String entitlementId` - `boolean revoked` ### Example ```java package com.clear_street.api.example; import com.clear_street.api.client.ClearStreetClient; import com.clear_street.api.client.okhttp.ClearStreetOkHttpClient; import com.clear_street.api.models.v1.omniai.entitlements.EntitlementDeleteEntitlementParams; import com.clear_street.api.models.v1.omniai.entitlements.EntitlementDeleteEntitlementResponse; public final class Main { private Main() {} public static void main(String[] args) { ClearStreetClient client = ClearStreetOkHttpClient.builder() .fromEnv() .apiKey("My API Key") .build(); EntitlementDeleteEntitlementResponse response = client.v1().omniAi().entitlements().deleteEntitlement("entitlement_id"); } } ``` #### 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 `EntitlementGetEntitlementAgreementsResponse v1().omniAi().entitlements().getEntitlementAgreements(EntitlementGetEntitlementAgreementsParamsparams = EntitlementGetEntitlementAgreementsParams.none(), RequestOptionsrequestOptions = RequestOptions.none())` **get** `/v1/omni-ai/entitlement-agreements` List current signable entitlement agreements for consent UX. ### Parameters - `EntitlementGetEntitlementAgreementsParams params` ### Returns - `class EntitlementGetEntitlementAgreementsResponse:` - `List data` - `String agreementId` - `EntitlementAgreementKey agreementKey` Stable entitlement agreement family key. - `OMNI_ACCOUNT_DATA_ACCESS("omni_account_data_access")` - `String documentContent` - `String documentSha256` - `List entitlementCodes` - `OMNI_ACCOUNT_DATA("omni.account_data")` - `String title` - `long version` ### Example ```java package com.clear_street.api.example; import com.clear_street.api.client.ClearStreetClient; import com.clear_street.api.client.okhttp.ClearStreetOkHttpClient; import com.clear_street.api.models.v1.omniai.entitlements.EntitlementGetEntitlementAgreementsParams; import com.clear_street.api.models.v1.omniai.entitlements.EntitlementGetEntitlementAgreementsResponse; public final class Main { private Main() {} public static void main(String[] args) { ClearStreetClient client = ClearStreetOkHttpClient.builder() .fromEnv() .apiKey("My API Key") .build(); EntitlementGetEntitlementAgreementsResponse response = client.v1().omniAi().entitlements().getEntitlementAgreements(); } } ``` #### 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 - `class DeleteEntitlementResponse:` - `String entitlementId` - `boolean revoked` ### Entitlement Agreement Key - `enum EntitlementAgreementKey:` Stable entitlement agreement family key. - `OMNI_ACCOUNT_DATA_ACCESS("omni_account_data_access")` ### Entitlement Agreement Resource - `class EntitlementAgreementResource:` - `String agreementId` - `EntitlementAgreementKey agreementKey` Stable entitlement agreement family key. - `OMNI_ACCOUNT_DATA_ACCESS("omni_account_data_access")` - `String documentContent` - `String documentSha256` - `List entitlementCodes` - `OMNI_ACCOUNT_DATA("omni.account_data")` - `String title` - `long version` ### Entitlement Code - `enum EntitlementCode:` Stable entitlement code granted by an agreement. - `OMNI_ACCOUNT_DATA("omni.account_data")` ### Entitlement Resource - `class EntitlementResource:` - `String agreementId` - `EntitlementCode entitlementCode` Stable entitlement code granted by an agreement. - `OMNI_ACCOUNT_DATA("omni.account_data")` - `String entitlementId` - `String grantedAt` - `long tradingAccountId` # Messages ## Get Message By ID `MessageGetMessageByIdResponse v1().omniAi().messages().getMessageById(MessageGetMessageByIdParamsparams, RequestOptionsrequestOptions = RequestOptions.none())` **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 - `MessageGetMessageByIdParams params` - `Optional messageId` - `long accountId` Account ID for the request ### Returns - `class MessageGetMessageByIdResponse:` - `Message data` Final immutable message. - `String id` - `MessageContent content` Finalized immutable message content container. Never includes thinking parts. - `List parts` - `UnionMember0` - `Type type` - `TEXT("text")` - `UnionMember1` - `Type type` - `STRUCTURED_ACTION("structured_action")` - `UnionMember2` - `Type type` - `CHART("chart")` - `UnionMember3` - `Type type` - `SUGGESTED_ACTIONS("suggested_actions")` - `UnionMember4` - `Type type` - `CUSTOM("custom")` - `String createdAt` - `MessageOutcome outcome` Immutable terminal outcome for a finalized assistant message. - `COMPLETED("completed")` - `ERRORED("errored")` - `CANCELED("canceled")` - `MessageRole role` Finalized message role in the public contract. - `USER("USER")` - `ASSISTANT("ASSISTANT")` - `long seq` - `String threadId` - `Optional error` Shared sanitized error payload. - `String code` - `String message` - `Optional details` ### Example ```java package com.clear_street.api.example; import com.clear_street.api.client.ClearStreetClient; import com.clear_street.api.client.okhttp.ClearStreetOkHttpClient; import com.clear_street.api.models.v1.omniai.messages.MessageGetMessageByIdParams; import com.clear_street.api.models.v1.omniai.messages.MessageGetMessageByIdResponse; public final class Main { private Main() {} public static void main(String[] args) { ClearStreetClient client = ClearStreetOkHttpClient.builder() .fromEnv() .apiKey("My API Key") .build(); MessageGetMessageByIdParams params = MessageGetMessageByIdParams.builder() .messageId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .accountId(0L) .build(); MessageGetMessageByIdResponse response = client.v1().omniAi().messages().getMessageById(params); } } ``` #### 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 `MessageSubmitFeedbackResponse v1().omniAi().messages().submitFeedback(MessageSubmitFeedbackParamsparams, RequestOptionsrequestOptions = RequestOptions.none())` **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 - `MessageSubmitFeedbackParams params` - `Optional messageId` - `long accountId` Account ID for the request - `long score` Feedback score (-1, 0, +1 or 1-5) - `Optional comment` Optional feedback comment - `Optional metadata` Optional metadata ### Returns - `class MessageSubmitFeedbackResponse:` - `CreateFeedbackResponse data` - `String createdAt` - `Optional feedbackId` ### Example ```java package com.clear_street.api.example; import com.clear_street.api.client.ClearStreetClient; import com.clear_street.api.client.okhttp.ClearStreetOkHttpClient; import com.clear_street.api.models.v1.omniai.messages.MessageSubmitFeedbackParams; import com.clear_street.api.models.v1.omniai.messages.MessageSubmitFeedbackResponse; public final class Main { private Main() {} public static void main(String[] args) { ClearStreetClient client = ClearStreetOkHttpClient.builder() .fromEnv() .apiKey("My API Key") .build(); MessageSubmitFeedbackParams params = MessageSubmitFeedbackParams.builder() .messageId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .accountId(0L) .score(0) .build(); MessageSubmitFeedbackResponse response = client.v1().omniAi().messages().submitFeedback(params); } } ``` #### 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 - `class CreateFeedbackResponse:` - `String createdAt` - `Optional feedbackId` # Responses ## Get Response By ID `ResponseGetResponseByIdResponse v1().omniAi().responses().getResponseById(ResponseGetResponseByIdParamsparams, RequestOptionsrequestOptions = RequestOptions.none())` **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 - `ResponseGetResponseByIdParams params` - `Optional responseId` - `long accountId` Account ID for the request ### Returns - `class ResponseGetResponseByIdResponse:` - `Response data` Dynamic pollable response. - `String id` - `ResponseStatus status` Dynamic lifecycle status for a pollable response. - `QUEUED("queued")` - `RUNNING("running")` - `SUCCEEDED("succeeded")` - `FAILED("failed")` - `CANCELED("canceled")` - `String threadId` - `String userMessageId` - `Optional content` Dynamic response content container. May include thinking parts. - `List parts` - `UnionMember0` - `Type type` - `TEXT("text")` - `UnionMember1` - `Type type` - `THINKING("thinking")` - `UnionMember2` - `Type type` - `STRUCTURED_ACTION("structured_action")` - `UnionMember3` - `Type type` - `CHART("chart")` - `UnionMember4` - `Type type` - `SUGGESTED_ACTIONS("suggested_actions")` - `UnionMember5` - `Type type` - `CUSTOM("custom")` - `Optional error` Shared sanitized error payload. - `String code` - `String message` - `Optional details` - `Optional outputMessageId` ### Example ```java package com.clear_street.api.example; import com.clear_street.api.client.ClearStreetClient; import com.clear_street.api.client.okhttp.ClearStreetOkHttpClient; import com.clear_street.api.models.v1.omniai.responses.ResponseGetResponseByIdParams; import com.clear_street.api.models.v1.omniai.responses.ResponseGetResponseByIdResponse; public final class Main { private Main() {} public static void main(String[] args) { ClearStreetClient client = ClearStreetOkHttpClient.builder() .fromEnv() .apiKey("My API Key") .build(); ResponseGetResponseByIdParams params = ResponseGetResponseByIdParams.builder() .responseId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .accountId(0L) .build(); ResponseGetResponseByIdResponse response = client.v1().omniAi().responses().getResponseById(params); } } ``` #### 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 `ResponseCancelResponseResponse v1().omniAi().responses().cancelResponse(ResponseCancelResponseParamsparams, RequestOptionsrequestOptions = RequestOptions.none())` **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 - `ResponseCancelResponseParams params` - `Optional responseId` - `long accountId` Account ID for the request ### Returns - `class ResponseCancelResponseResponse:` - `CancelResponsePayload data` - `boolean canceled` ### Example ```java package com.clear_street.api.example; import com.clear_street.api.client.ClearStreetClient; import com.clear_street.api.client.okhttp.ClearStreetOkHttpClient; import com.clear_street.api.models.v1.omniai.responses.ResponseCancelResponseParams; import com.clear_street.api.models.v1.omniai.responses.ResponseCancelResponseResponse; public final class Main { private Main() {} public static void main(String[] args) { ClearStreetClient client = ClearStreetOkHttpClient.builder() .fromEnv() .apiKey("My API Key") .build(); ResponseCancelResponseParams params = ResponseCancelResponseParams.builder() .responseId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .accountId(0L) .build(); ResponseCancelResponseResponse response = client.v1().omniAi().responses().cancelResponse(params); } } ``` #### Response ```json { "data": { "canceled": false }, "metadata": { "request_id": "fa26a786-f5d3-48b0-80eb-778e17af4964" } } ``` ## Domain Types ### Cancel Response Payload - `class CancelResponsePayload:` - `boolean canceled` ### Error Status - `class ErrorStatus:` Shared sanitized error payload. - `String code` - `String message` - `Optional details` ### Response - `class Response:` Dynamic pollable response. - `String id` - `ResponseStatus status` Dynamic lifecycle status for a pollable response. - `QUEUED("queued")` - `RUNNING("running")` - `SUCCEEDED("succeeded")` - `FAILED("failed")` - `CANCELED("canceled")` - `String threadId` - `String userMessageId` - `Optional content` Dynamic response content container. May include thinking parts. - `List parts` - `UnionMember0` - `Type type` - `TEXT("text")` - `UnionMember1` - `Type type` - `THINKING("thinking")` - `UnionMember2` - `Type type` - `STRUCTURED_ACTION("structured_action")` - `UnionMember3` - `Type type` - `CHART("chart")` - `UnionMember4` - `Type type` - `SUGGESTED_ACTIONS("suggested_actions")` - `UnionMember5` - `Type type` - `CUSTOM("custom")` - `Optional error` Shared sanitized error payload. - `String code` - `String message` - `Optional details` - `Optional outputMessageId` ### Response Content - `class ResponseContent:` Dynamic response content container. May include thinking parts. - `List parts` - `UnionMember0` - `Type type` - `TEXT("text")` - `UnionMember1` - `Type type` - `THINKING("thinking")` - `UnionMember2` - `Type type` - `STRUCTURED_ACTION("structured_action")` - `UnionMember3` - `Type type` - `CHART("chart")` - `UnionMember4` - `Type type` - `SUGGESTED_ACTIONS("suggested_actions")` - `UnionMember5` - `Type type` - `CUSTOM("custom")` ### Response Content Part - `class ResponseContentPart: A class that can be one of several variants.union` Dynamic content part visible on a pollable response. - `UnionMember0` - `Type type` - `TEXT("text")` - `UnionMember1` - `Type type` - `THINKING("thinking")` - `UnionMember2` - `Type type` - `STRUCTURED_ACTION("structured_action")` - `UnionMember3` - `Type type` - `CHART("chart")` - `UnionMember4` - `Type type` - `SUGGESTED_ACTIONS("suggested_actions")` - `UnionMember5` - `Type type` - `CUSTOM("custom")` ### Response Status - `enum ResponseStatus:` Dynamic lifecycle status for a pollable response. - `QUEUED("queued")` - `RUNNING("running")` - `SUCCEEDED("succeeded")` - `FAILED("failed")` - `CANCELED("canceled")` # Threads ## Get Threads `ThreadGetThreadsResponse v1().omniAi().threads().getThreads(ThreadGetThreadsParamsparams, RequestOptionsrequestOptions = RequestOptions.none())` **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 - `ThreadGetThreadsParams params` - `long accountId` Account ID for the request - `Optional pageSize` The number of items to return per page. Only used when page_token is not provided. - `Optional pageToken` Token for retrieving the next or previous page of results. Contains encoded pagination state; when provided, page_size is ignored. ### Returns - `class ThreadGetThreadsResponse:` - `List data` - `String id` - `String createdAt` - `String title` - `String updatedAt` ### Example ```java package com.clear_street.api.example; import com.clear_street.api.client.ClearStreetClient; import com.clear_street.api.client.okhttp.ClearStreetOkHttpClient; import com.clear_street.api.models.v1.omniai.threads.ThreadGetThreadsParams; import com.clear_street.api.models.v1.omniai.threads.ThreadGetThreadsResponse; public final class Main { private Main() {} public static void main(String[] args) { ClearStreetClient client = ClearStreetOkHttpClient.builder() .fromEnv() .apiKey("My API Key") .build(); ThreadGetThreadsParams params = ThreadGetThreadsParams.builder() .accountId(0L) .build(); ThreadGetThreadsResponse response = client.v1().omniAi().threads().getThreads(params); } } ``` #### 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 `ThreadGetThreadByIdResponse v1().omniAi().threads().getThreadById(ThreadGetThreadByIdParamsparams, RequestOptionsrequestOptions = RequestOptions.none())` **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 - `ThreadGetThreadByIdParams params` - `Optional threadId` - `long accountId` Account ID for the request ### Returns - `class ThreadGetThreadByIdResponse:` - `Thread data` Thread metadata returned by list/get thread endpoints. - `String id` - `String createdAt` - `String title` - `String updatedAt` ### Example ```java package com.clear_street.api.example; import com.clear_street.api.client.ClearStreetClient; import com.clear_street.api.client.okhttp.ClearStreetOkHttpClient; import com.clear_street.api.models.v1.omniai.threads.ThreadGetThreadByIdParams; import com.clear_street.api.models.v1.omniai.threads.ThreadGetThreadByIdResponse; public final class Main { private Main() {} public static void main(String[] args) { ClearStreetClient client = ClearStreetOkHttpClient.builder() .fromEnv() .apiKey("My API Key") .build(); ThreadGetThreadByIdParams params = ThreadGetThreadByIdParams.builder() .threadId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .accountId(0L) .build(); ThreadGetThreadByIdResponse response = client.v1().omniAi().threads().getThreadById(params); } } ``` #### 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 `ThreadCreateThreadResponse v1().omniAi().threads().createThread(ThreadCreateThreadParamsparams, RequestOptionsrequestOptions = RequestOptions.none())` **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 - `ThreadCreateThreadParams params` - `long accountId` - `Type type` Thread creation mode. - `INSTANT("instant")` - `DEEP_INSIGHTS("deep_insights")` - `Optional> capabilities` - `PREFILL_ORDER("PREFILL_ORDER")` - `OPEN_CHART("OPEN_CHART")` - `OPEN_SCREENER("OPEN_SCREENER")` - `OPEN_ENTITLEMENT_CONSENT("OPEN_ENTITLEMENT_CONSENT")` - `Optional target` Deep-insights target payload. - `String ticker` - `Type type` Deep-insights target type. Launch supports ticker-only. - `TICKER("ticker")` - `Optional text` - `Optional thesis` ### Returns - `class ThreadCreateThreadResponse:` - `CreateThreadResponse data` Response payload for thread creation. - `String responseId` - `String threadId` - `String userMessageId` ### Example ```java package com.clear_street.api.example; import com.clear_street.api.client.ClearStreetClient; import com.clear_street.api.client.okhttp.ClearStreetOkHttpClient; import com.clear_street.api.models.v1.omniai.threads.ThreadCreateThreadParams; import com.clear_street.api.models.v1.omniai.threads.ThreadCreateThreadResponse; public final class Main { private Main() {} public static void main(String[] args) { ClearStreetClient client = ClearStreetOkHttpClient.builder() .fromEnv() .apiKey("My API Key") .build(); ThreadCreateThreadParams params = ThreadCreateThreadParams.builder() .accountId(19816L) .type(ThreadCreateThreadParams.Type.INSTANT) .build(); ThreadCreateThreadResponse response = client.v1().omniAi().threads().createThread(params); } } ``` #### 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 `ThreadGetThreadResponseResponse v1().omniAi().threads().getThreadResponse(ThreadGetThreadResponseParamsparams, RequestOptionsrequestOptions = RequestOptions.none())` **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 - `ThreadGetThreadResponseParams params` - `Optional threadId` - `long accountId` Account ID for the request ### Returns - `class ThreadGetThreadResponseResponse:` - `Response data` Dynamic pollable response. - `String id` - `ResponseStatus status` Dynamic lifecycle status for a pollable response. - `QUEUED("queued")` - `RUNNING("running")` - `SUCCEEDED("succeeded")` - `FAILED("failed")` - `CANCELED("canceled")` - `String threadId` - `String userMessageId` - `Optional content` Dynamic response content container. May include thinking parts. - `List parts` - `UnionMember0` - `Type type` - `TEXT("text")` - `UnionMember1` - `Type type` - `THINKING("thinking")` - `UnionMember2` - `Type type` - `STRUCTURED_ACTION("structured_action")` - `UnionMember3` - `Type type` - `CHART("chart")` - `UnionMember4` - `Type type` - `SUGGESTED_ACTIONS("suggested_actions")` - `UnionMember5` - `Type type` - `CUSTOM("custom")` - `Optional error` Shared sanitized error payload. - `String code` - `String message` - `Optional details` - `Optional outputMessageId` ### Example ```java package com.clear_street.api.example; import com.clear_street.api.client.ClearStreetClient; import com.clear_street.api.client.okhttp.ClearStreetOkHttpClient; import com.clear_street.api.models.v1.omniai.threads.ThreadGetThreadResponseParams; import com.clear_street.api.models.v1.omniai.threads.ThreadGetThreadResponseResponse; public final class Main { private Main() {} public static void main(String[] args) { ClearStreetClient client = ClearStreetOkHttpClient.builder() .fromEnv() .apiKey("My API Key") .build(); ThreadGetThreadResponseParams params = ThreadGetThreadResponseParams.builder() .threadId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .accountId(0L) .build(); ThreadGetThreadResponseResponse response = client.v1().omniAi().threads().getThreadResponse(params); } } ``` #### 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 `ThreadGetMessagesResponse v1().omniAi().threads().getMessages(ThreadGetMessagesParamsparams, RequestOptionsrequestOptions = RequestOptions.none())` **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 - `ThreadGetMessagesParams params` - `Optional threadId` - `long accountId` Account ID for the request - `Optional pageSize` The number of items to return per page. Only used when page_token is not provided. - `Optional pageToken` Token for retrieving the next or previous page of results. Contains encoded pagination state; when provided, page_size is ignored. ### Returns - `class ThreadGetMessagesResponse:` - `List data` - `String id` - `MessageContent content` Finalized immutable message content container. Never includes thinking parts. - `List parts` - `UnionMember0` - `Type type` - `TEXT("text")` - `UnionMember1` - `Type type` - `STRUCTURED_ACTION("structured_action")` - `UnionMember2` - `Type type` - `CHART("chart")` - `UnionMember3` - `Type type` - `SUGGESTED_ACTIONS("suggested_actions")` - `UnionMember4` - `Type type` - `CUSTOM("custom")` - `String createdAt` - `MessageOutcome outcome` Immutable terminal outcome for a finalized assistant message. - `COMPLETED("completed")` - `ERRORED("errored")` - `CANCELED("canceled")` - `MessageRole role` Finalized message role in the public contract. - `USER("USER")` - `ASSISTANT("ASSISTANT")` - `long seq` - `String threadId` - `Optional error` Shared sanitized error payload. - `String code` - `String message` - `Optional details` ### Example ```java package com.clear_street.api.example; import com.clear_street.api.client.ClearStreetClient; import com.clear_street.api.client.okhttp.ClearStreetOkHttpClient; import com.clear_street.api.models.v1.omniai.threads.ThreadGetMessagesParams; import com.clear_street.api.models.v1.omniai.threads.ThreadGetMessagesResponse; public final class Main { private Main() {} public static void main(String[] args) { ClearStreetClient client = ClearStreetOkHttpClient.builder() .fromEnv() .apiKey("My API Key") .build(); ThreadGetMessagesParams params = ThreadGetMessagesParams.builder() .threadId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .accountId(0L) .build(); ThreadGetMessagesResponse response = client.v1().omniAi().threads().getMessages(params); } } ``` #### 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 `ThreadCreateMessageResponse v1().omniAi().threads().createMessage(ThreadCreateMessageParamsparams, RequestOptionsrequestOptions = RequestOptions.none())` **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 - `ThreadCreateMessageParams params` - `Optional threadId` - `long accountId` - `String text` - `Optional> capabilities` - `PREFILL_ORDER("PREFILL_ORDER")` - `OPEN_CHART("OPEN_CHART")` - `OPEN_SCREENER("OPEN_SCREENER")` - `OPEN_ENTITLEMENT_CONSENT("OPEN_ENTITLEMENT_CONSENT")` ### Returns - `class ThreadCreateMessageResponse:` - `CreateMessageResponse data` Response payload for continuing a thread with a new message. - `String responseId` - `String threadId` - `String userMessageId` ### Example ```java package com.clear_street.api.example; import com.clear_street.api.client.ClearStreetClient; import com.clear_street.api.client.okhttp.ClearStreetOkHttpClient; import com.clear_street.api.models.v1.omniai.threads.ThreadCreateMessageParams; import com.clear_street.api.models.v1.omniai.threads.ThreadCreateMessageResponse; public final class Main { private Main() {} public static void main(String[] args) { ClearStreetClient client = ClearStreetOkHttpClient.builder() .fromEnv() .apiKey("My API Key") .build(); ThreadCreateMessageParams params = ThreadCreateMessageParams.builder() .threadId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .accountId(19816L) .text("Compare that to AMD.") .build(); ThreadCreateMessageResponse response = client.v1().omniAi().threads().createMessage(params); } } ``` #### 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 - `class CreateMessageResponse:` Response payload for continuing a thread with a new message. - `String responseId` - `String threadId` - `String userMessageId` ### Create Thread Response - `class CreateThreadResponse:` Response payload for thread creation. - `String responseId` - `String threadId` - `String userMessageId` ### Message - `class Message:` Final immutable message. - `String id` - `MessageContent content` Finalized immutable message content container. Never includes thinking parts. - `List parts` - `UnionMember0` - `Type type` - `TEXT("text")` - `UnionMember1` - `Type type` - `STRUCTURED_ACTION("structured_action")` - `UnionMember2` - `Type type` - `CHART("chart")` - `UnionMember3` - `Type type` - `SUGGESTED_ACTIONS("suggested_actions")` - `UnionMember4` - `Type type` - `CUSTOM("custom")` - `String createdAt` - `MessageOutcome outcome` Immutable terminal outcome for a finalized assistant message. - `COMPLETED("completed")` - `ERRORED("errored")` - `CANCELED("canceled")` - `MessageRole role` Finalized message role in the public contract. - `USER("USER")` - `ASSISTANT("ASSISTANT")` - `long seq` - `String threadId` - `Optional error` Shared sanitized error payload. - `String code` - `String message` - `Optional details` ### Message Content - `class MessageContent:` Finalized immutable message content container. Never includes thinking parts. - `List parts` - `UnionMember0` - `Type type` - `TEXT("text")` - `UnionMember1` - `Type type` - `STRUCTURED_ACTION("structured_action")` - `UnionMember2` - `Type type` - `CHART("chart")` - `UnionMember3` - `Type type` - `SUGGESTED_ACTIONS("suggested_actions")` - `UnionMember4` - `Type type` - `CUSTOM("custom")` ### Message Content Part - `class MessageContentPart: A class that can be one of several variants.union` Final immutable content part visible on persisted messages. - `UnionMember0` - `Type type` - `TEXT("text")` - `UnionMember1` - `Type type` - `STRUCTURED_ACTION("structured_action")` - `UnionMember2` - `Type type` - `CHART("chart")` - `UnionMember3` - `Type type` - `SUGGESTED_ACTIONS("suggested_actions")` - `UnionMember4` - `Type type` - `CUSTOM("custom")` ### Message Outcome - `enum MessageOutcome:` Immutable terminal outcome for a finalized assistant message. - `COMPLETED("completed")` - `ERRORED("errored")` - `CANCELED("canceled")` ### Message Role - `enum MessageRole:` Finalized message role in the public contract. - `USER("USER")` - `ASSISTANT("ASSISTANT")` ### Thread - `class Thread:` Thread metadata returned by list/get thread endpoints. - `String id` - `String createdAt` - `String title` - `String updatedAt`