Skip to main content
This page gets you from install to first real request with the current @dzapio/ai runtime.

1) Install

npm install @dzapio/ai
If your environment maps @dzapio to a private registry, use:
npm install @dzapio/ai --@dzapio:registry=https://registry.npmjs.org

2) Set required environment variables

export OPENAI_API_KEY=sk-...
OPENAI_API_KEY is the only variable required to run the model. Optional provider keys (Tavily, CoinStats, Moralis, etc.) enable individual tools.

3) SDK example (DZapSDK)

import { DZapSDK } from "@dzapio/ai";

const sdk = new DZapSDK();

await sdk.initialize({
  initializeRetrieval: true,
  syncProviders: false,
});

const result = await sdk.ask({
  userQuery: "Show my balances",
  metadata: {
    accountInfo: [{ blockchain: "evm", chain: "1", user_account: "0xabc..." }],
  },
  transactionConfirmationMode: "on",
});

console.log(result.sessionId);
console.log(result.finalText);

4) CLI example

dzap
Aliases also supported: dzapai, DzapAI. The interactive flow prompts for:
  1. Wallet profile (wallet, chain, blockchain, private key)
  2. Chat input and slash commands

5) HTTP streaming example

The server exposes a single Server-Sent Events endpoint, POST /ask_stream:
curl -N -X POST "https://nlp-ai-439689868940.europe-north1.run.app/ask_stream" -H "Content-Type: application/json" -d "{\"user_query\":\"Price of USDC on Ethereum\",\"session_id\":\"demo-session\",\"metadata\":{\"accountInfo\":[{\"blockchain\":\"evm\",\"chain\":\"1\",\"user_account\":\"0xabc...\"}]}}"
The stream emits one step event per tool call, a final finalText event, then [DONE]:
data: {"chatId":"demo-session","response":{"type":"step","tool_name":"PriceTool","data":"...","session_id":"demo-session"}}
data: {"chatId":"demo-session","response":{"type":"finalText","data":"USDC is ...","session_id":"demo-session","chain_id":"1"}}
data: [DONE]

6) MCP endpoint example

{
  "mcpServers": {
    "DZapAI": {
      "command": "npx",
      "args": ["-y", "mcp-remote", "https://nlp-ai-439689868940.europe-north1.run.app/mcp"]
    }
  }
}

Next

SDK-AI

Full SDK API reference with more examples.

MCP Server

Stdio + streamable HTTP details.

Tool Categories

All 21 exposed tools.

CLI

Interactive shell command reference.
Last modified on June 18, 2026