Connect your bot. Make a payment.
Connect Grok or another bot to TempoKey, keep credentials private and make your first payment on Tempo Mainnet.
Connect your bot, keep the key private
Creating a TempoKey agent authorizes a payment key; it does not create a chatbot or connect a model automatically. Your bot needs a payment tool running in your application or a trusted server.
- Create an agent with a small per-token budget, an expiry and the recipients it may pay.
- Export that agent's key into your application's secret settings or private .env file as AGENT_PRIVATE_KEY. Set OWNER_ADDRESS to the public wallet address.
- Connect a payment function backed by the TempoKey SDK or authenticated REST API. Validate the service, recipient, token, price and network fee before signing. Enforce the task budget in code.
- Give the bot the task and maximum total cost in chat. The payment tool returns the service result and transaction hash. Confirmed outgoing transfers appear in the dashboard.
Using Grok
| Your setup | How to connect |
|---|---|
| Your app using the Grok API | Define a custom payment function. Grok requests the function call; your server validates it, executes the payment and sends the result back. |
| Grok chat with a custom connector | Use an authenticated MCP server exposing your payment tool. Store credentials on that server. TempoKey does not currently provide a hosted MCP connector. |
| Grok Bot or another hosted agent | Use its supported tool integration with your payment backend. If your runtime supports private secrets, configure them there; sending a key in chat is not a connection method. |
Use my TempoKey payment tool to buy one web search about Tempo agent limits. Spend at most $0.10 including network fees. Check the quote first and return the sources and transaction hash. If the tool is not connected, explain what is missing; do not ask for private keys.The dashboard's Connect bot tab provides SDK and HTTP examples. A chat instruction alone cannot install or authorize a tool. Paying a service through MPP also needs an MPP integration; the basic SDK payment method only sends a token transfer.
1. Prepare your wallet
Use Node.js 22.18 or newer for the commands below. Connect an injected EVM wallet in the dashboard and select Tempo Mainnet. Fund the owner address on that network with a supported token; this example pays in pathUSD.
- Create an agent in the dashboard.
- Choose a small budget, an expiry and your intended recipient allowlist.
- Approve the key-authorization transaction in your owner wallet.
- Open the agent and choose Export key, then Copy private key for your application's environment. Copy JSON includes the owner address and network. Settings also offers a backup of all agent keys.
2. Install the SDK
mkdir agent-demo
cd agent-demo
npm init -y
npm install https://www.tempokey.xyz/downloads/tempokey-sdk-0.3.0.tgz
npm ls @tempokey/sdkThe download installs the standard @tempokey/sdk package at version 0.3.0. Use this build for the examples here; older registry releases may target testnet by default.
AGENT_PRIVATE_KEY=0xYOUR_EXPORTED_P256_AGENT_KEY
OWNER_ADDRESS=0xYOUR_OWNER_WALLET_ADDRESS
RECIPIENT_ADDRESS=0xYOUR_ALLOWED_RECIPIENTReplace all three placeholders. Exclude .env from version control. AGENT_PRIVATE_KEY is the delegated P256 key exported from TempoKey, not your wallet's root key.
3. Send a bounded payment
import { TempoKey } from "@tempokey/sdk";
const { AGENT_PRIVATE_KEY, OWNER_ADDRESS, RECIPIENT_ADDRESS } = process.env;
if (!AGENT_PRIVATE_KEY || !OWNER_ADDRESS || !RECIPIENT_ADDRESS) {
throw new Error("Set the three variables in .env first");
}
const agent = new TempoKey({
network: "mainnet",
privateKey: AGENT_PRIVATE_KEY,
rootAddress: OWNER_ADDRESS,
});
const limit = await agent.getRemainingLimit("PathUSD");
console.log("Remaining pathUSD budget:", limit.formatted);
const payment = await agent.pay({
to: RECIPIENT_ADDRESS,
amount: 0.01,
token: "PathUSD",
});
console.log("Transaction:", payment.hash);node --env-file=.env pay.mjsCheck the returned transaction hash in the Tempo explorer. If a request times out, inspect its transaction status before retrying; a lost response does not prove that no payment was made.
4. Close the loop
Revoke the agent from the dashboard when the job is finished. Deleting a local key or closing your application does not revoke its on-chain authorization.