Execute

Execute specific blockchain commands or actions. This endpoint is designed for direct command execution without the conversational context of the chat endpoint.

POST /execute

Request Body:

{
"message": "send 0.0001 ETH on sepolia to vitalik.eth",
"user_id": "default-user",
"stream": false,
"execute_config": {
"mode": "client",
"signer_wallet_address": "0xc3F2b2a12Eba0f5989cD75B2964E31D56603a2cE"
}
}

Request Parameters:

  • message (required): The command to execute
  • user_id (optional): Identifier for the user making the request
  • stream (optional): Whether to stream the response
  • execute_config (optional): Configuration for transaction execution
    • mode: Execution mode (currently only "client" is supported)
    • signer_wallet_address: Address that will sign the transaction

Example Response:

{
"message": "The transaction to transfer 0.0001 ETH to the address resolved from the ENS name `vitalik.eth` (which is `0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045`) is set up successfully. The simulation indicates that the transaction is likely to succeed.\n\nPlease proceed by signing and confirming the transaction.",
"actions": [
{
"session_id": "437a0df7-d512-4ef4-95b5-6168ccbbe097",
"request_id": "c2b51ed6-da79-49ac-b411-206a42059509",
"type": "sign_transaction",
"source": "executor",
"data": "{\"chainId\": 11155111, \"to\": \"0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045\", \"data\": \"0x\", \"value\": \"0x5af3107a4000\"}"
}
],
"session_id": "437a0df7-d512-4ef4-95b5-6168ccbbe097",
"request_id": "c2b51ed6-da79-49ac-b411-206a42059509"
}

Example curl:

curl -X POST https://nebula-api.thirdweb.com/execute \
-H "Content-Type: application/json" \
-H "x-secret-key: YOUR_THIRDWEB_SECRET_KEY" \
-d '{
"message": "send 0.0001 ETH on sepolia to vitalik.eth",
"user_id": "default-user",
"stream": false,
"execute_config": {
"mode": "client",
"signer_wallet_address": "0xc3F2b2a12Eba0f5989cD75B2964E31D56603a2cE"
}
}'

Response Properties:

  • message: A human-readable description of the action to be taken
  • actions: Array of actions to be executed
    • session_id: Unique identifier for the session
    • request_id: Unique identifier for this request
    • type: The type of action (e.g., "sign_transaction")
    • source: Origin of the action
    • data: Transaction data in hexadecimal format including:
      • chainId: Network identifier
      • to: Recipient's address
      • data: Transaction data
      • value: Amount to send in hex
  • session_id: Session identifier for this execution
  • request_id: Unique identifier for this request