Request Body:
Request Parameters:
-
message
(required)- Type: string
- Description: The user's input message or command to be processed by Nebula
-
session_id
(optional)- Type: string
- Description: Identifier for maintaining conversation context
- Default: A new session will be created if omitted
-
stream
(optional)- Type: boolean
- Description: Controls whether the response is streamed or returned as a single response
- Default: false
-
context_filter
(optional)- Type: object
- Description: Controls which blockchain data sources are used for context
- Properties:
chain_ids
: Array of numbers representing blockchain network IDscontract_addresses
: Array of strings containing contract addresses to focus on
-
execute_config
(optional)-
Type: object
-
Description: Configuration for transaction execution
-
Properties:
mode
: String indicating execution mode (currently only "client" is supported)signer_wallet_address
: String containing the wallet address that will sign transactions
-
Chat messages are natural language responses from Nebula. They appear in the message
field of the response and provide formatted information, explanations, or answers to your queries. Messages can include formatted text, blockchain data, and technical details.
Example Response with Chat Message:
Response properties:
message
: A formatted string containing the response, which may include:- Markdown formatting for better readability
- Technical data (hashes, addresses, numbers)
- Structured information about blockchain state
actions
: Array of actions (empty when no transactions are needed)session_id
: Unique identifier for the current sessionrequest_id
: Unique identifier for the specific request
Chat actions represent blockchain transactions or operations that Nebula has prepared in response to your request. The response includes both a detailed explanation in the message
field and the actual transaction data in the actions
array.
Example Response with Chat Action:
Action Properties:
session_id
: Unique identifier for the current sessionrequest_id
: Unique identifier for the specific requesttype
: The type of action (e.g., "sign_transaction")source
: Origin of the action (e.g., "executor")data
: Transaction parameters including:chainId
: Network identifier (e.g., 11155111 for Sepolia)to
: Recipient's addressdata
: Transaction data (if any)value
: Amount to send in wei
When handling actions:
- Parse the
message
field for human-readable transaction details - Extract the transaction data from the
actions
array - Present transaction details to the user for review
- Use a local wallet to sign the transaction
- Broadcast the signed transaction to the network
Example Implementation with thirdweb SDK: