Learn how to get set up and start using the Dialect AI API to interpret natural language and execute blockchain transactions—such as signing and sending a transfer—using smart, connected agents.
Prerequisites
Before you begin, ensure you have the following ready:
A Dialect AI account
A blockchain wallet (e.g., MetaMask) for signing and executing transactions
Node.js and either npm or yarn installed on your system
Step 1: Obtain API Credentials
Create a Project
Log in to your Dialect AI Dashboard and create a new project. Each project provides a Client ID and a Secret Key.
Save Your Keys
After your project is created, securely store your Secret Key—it will not be retrievable later.
Client ID vs Secret Key
Client ID
Public-facing identifier, safe to use on the frontend. It is restricted by the domain settings you configure in your API dashboard.
Secret Key
Used for backend scripts and server-side requests. Never expose your Secret Key in frontend code.
Step 2: Install the SDK
Install the Dialect AI TypeScript SDK using npm:
Step 3: Set Environment Variables
Add your Secret Key to your project’s environment configuration.
💡 Use a secure secrets manager like AWS Secrets Manager or Google Secret Manager for production deployments.
Step 4: Import SDK Functions
Import necessary utilities from the Dialect AI SDK:
Step 5: Handle API Response & Execute a Transaction
This function takes the response from the Dialect AI API and executes the parsed transaction using your wallet.
Step 6: Call the Dialect AI API
Send a natural language instruction to the API to generate a blockchain transaction:
Example API Response
✅ You’re All Set!
You've now successfully integrated the Dialect AI API and executed your first transaction using a natural language prompt. Next, explore how to create multi-step workflows, plug into LangChain, or build autonomous agents that reason about blockchain data.