Open ai-plugin/manifest.json (or wherever your manifest lives) and add the corresponding spec for your endpoint
Since this is a next js project the route path will correspond to the folder
'/api/send-sui': {
post: {
summary: 'Send a Sui tokens',
description: 'Accept the args and return a valid sui transaction in bytes to send tokens to an address',
operationId: 'generateSuiTx',
requestBody: {
required: true,
content: {
'application/json': {
schema: {
type: 'object',
properties: {
senderAddress: {
type: 'string',
description: 'Address sending SUI',
},
recipientAddress: {
type: 'string',
description: 'Address receiving SUI',
},
amountInSui: {
type: 'number',
description: 'Amount of SUI to send',
},
network: {
type: 'string',
enum: ['mainnet', 'testnet', 'devnet'],
default: 'mainnet',
description: 'Which Sui network to use',
},
},
required: ['senderAddress', 'recipientAddress', 'amountInSui'],
},
},
},
},
responses: {
'200': {
description: 'Successful response',
content: {
'application/json': {
schema: {
type: 'object',
properties: {
success: {
type: 'boolean',
description: 'Whether the transaction was successfully built or validated',
},
data: {
type: 'object',
description: 'Additional result data',
},
},
},
},
},
},
'500': {
description: 'Error response',
content: {
'application/json': {
schema: {
type: 'object',
properties: {
error: {
type: 'string',
description: 'Error message',
},
},
},
},
},
},
},
},
},
5. Add generate-sui-tx to the Tools Array
To enable the review transaction component in the frontend, add the generate-sui-tx primitive to the tools array in your configuration file:
This update ensures that the frontend can display the transaction review component appropriately.
6. Define Behaviour
To control how your agent behaves, customize its instructions—this is the equivalent of setting the system prompt. Use this to tailor the agent’s behavior to your tool’s needs. For example, you might instruct it to confirm addresses or amounts, adopt a specific tone or personality, or behave deterministically in certain scenarios.
If the transaction review screen isn’t appearing as expected, you can explicitly instruct the agent to show it after your tool call.
7. Run Locally & Test
pnpm dev
The console UI opens your chat sandbox.
Ask the agent to build the transaction related to your tool
The agent will call your tool and then call generate-sui-tx to display the transaction signing component so you can try sending your transaction
7. Deploy Your Agent
Push to GitHub.
Deploy to vercel or any provider
Update your URL env or hard code it in the spec
BITTE_AGENT_URL="https://my-sui-agent.vercel.app"
Run:
make-agent deploy
This validates your key, registers your plugin URL, and you’re live!