Skip to content
Go To Dashboard

Quick Start

Sapiom provides a seamless payment and authorization layer for AI agents and API-driven applications. The Sapiom SDK handles payment flows, authorization, and transaction management automatically.

Sign in to the Sapiom dashboard and generate an API key.

Add your API key to your environment variables:

Terminal window
export SAPIOM_API_KEY="your_api_key_here"

Or in your .env file:

Terminal window
SAPIOM_API_KEY=your_api_key_here
Terminal window
npm install @sapiom/langchain langchain
import { createAgent } from "langchain";
import { createSapiomMiddleware } from "@sapiom/langchain";
const agent = createAgent({
model: "gpt-4",
tools: [getWeather, sendEmail],
middleware: [
createSapiomMiddleware({
apiKey: process.env.SAPIOM_API_KEY,
}),
],
});
// All operations automatically tracked
const response = await agent.invoke({
messages: [{ role: "user", content: "Hello!" }],
});

Once integrated, visit Sapiom dashboard to:

View real-time activity and spending
Set up spending and usage rules
Test agents in the Playground