2.1 Installing the SDK
Install the Valmi Value Python SDK:Python 3.8+ is required. Support for Node.js, Go, and other languages coming soon.
2.2 Send Your First Meter Event
2.3 Create Your First Agent
- Log in to the Valmi Value Control Plane
- Navigate to Agents → Create Agent
- Fill in the agent details:
- Name: My First Agent
- Type: LangGraph Agent
- Description: A simple agent for testing
- Click Create
You’ll receive an Agent Key that you’ll use in your SDK calls. Keep this secure!
2.4 Attach Metering to the Agent
- In the Agent details page, copy the Agent Key
- Update your code to use this key:
- Events will start appearing in the Live Data view within seconds
2.5 Set Up a Billing Plan
- Navigate to Products → Create Product
- Create a new product:
- Product Name: AI Agent API
- Description: Pay-per-use AI agent service
- Create a Rate Plan:
- Plan Name: Usage-Based Plan
- Pricing Model: Usage-Based
- Charge: $0.01 per 1,000 tokens
- Save the plan
2.6 Create an Account + Subscription
- Go to Accounts → Create Account
- Fill in account details:
- Account Name: Acme Corp
- Contact Email: billing@acme.com
- Click Create Subscription:
- Select your product and rate plan
- Set billing cycle (monthly)
- Assign the agent instance to this subscription
- Save the subscription
2.7 Generate First Invoice
- Navigate to Billing → Invoices
- Click Run Invoice for the current billing period
- The system will:
- Aggregate all usage for the period
- Apply pricing rules
- Calculate costs and revenue
- Generate the invoice
- View and download the invoice PDF
2.8 View Revenue & Margin
- Go to Profit & Loss dashboard
- You’ll see:
- Revenue: Total billed amount
- Costs: LLM and infrastructure costs
- Margin: Revenue - Costs
- Margin %: Profitability percentage
- Filter by agent, customer, or time period