@libertai/agentkit-plugin
v0.1.1
Published
Build autonomous agents that pay for their own compute and inference — powered by AgentKit, Aleph Cloud, and LibertAI
Readme
@libertai/agentkit-plugin
Build autonomous agents that pay for their own compute and inference — powered by Coinbase AgentKit, Aleph Cloud, and LibertAI.
Includes an OpenAI-compatible LLM client (paid via x402), Aleph credit management tools, and AgentKit-to-OpenAI tool-calling helpers.
Install
npm install @libertai/agentkit-plugin @coinbase/agentkit openai viemQuick start
import { AgentKit, walletActionProvider, erc20ActionProvider } from "@coinbase/agentkit";
import {
createLLMClient,
createAgentWallet,
createAlephActionProvider,
actionsToTools,
getBalances,
} from "@libertai/agentkit-plugin";
// 1. Create wallet
const wallet = await createAgentWallet(YOUR_PRIVATE_KEY, chain, rpcUrl);
// 2. Set up AgentKit with action providers
const agentkit = await AgentKit.from({
walletProvider: wallet.provider,
actionProviders: [
walletActionProvider(),
erc20ActionProvider(),
createAlephActionProvider(YOUR_PRIVATE_KEY),
],
});
// 3. Convert actions to OpenAI tools
const { tools, executeTool } = actionsToTools(agentkit.getActions());
// 4. Create x402-enabled LLM client with the LibertAI API
const openai = createLLMClient(YOUR_PRIVATE_KEY);
// 5. Use in a chat completions loop
const response = await openai.chat.completions.create({
model: "qwen3.5-35b-a3b",
messages,
tools,
});License
MIT
