POST /execute

POST /execute | Auth: Required

Parse and execute a natural language command. The server interprets the command and performs the corresponding action -- such as fetching a price, checking a balance, or executing a swap.

Request

Body Parameters

Field
Type
Required
Description

command

string

Yes

Natural language instruction (max 500 characters)

wallet_address

string

No

Wallet address to use for the command. Defaults to your managed wallet if omitted.

Example Request Body

{
  "command": "swap 0.5 ETH to USDC on base",
  "wallet_address": "0x742d35Cc6634C0532925a3b844Bc9e7595f2bD18"
}

Supported Commands

Command Pattern
Description

"swap 0.5 ETH to USDC on base"

Execute a token swap on a specific chain

"price ETH"

Get the current price of a token

"price ETH SOL"

Get prices for multiple tokens

"balance 0x742d..."

Check the token balances of a wallet address

Response

The response structure varies depending on the type of command executed.

Common Fields

Field
Type
Description

success

boolean

Whether the request succeeded

Swap Command Response

Price Command Response

Balance Command Response

Errors

Status
Error
Cause

400

"command is required"

Missing command in request body

400

"Command exceeds 500 character limit"

The command string is too long

400

"Unable to parse command"

The command could not be interpreted

401

"Unauthorized"

Missing or invalid API key

404

"No managed wallet found"

No wallet available and none specified in wallet_address

500

"Execution failed"

Internal error while processing the command

Code Examples

curl

Python

TypeScript

Last updated