# OpenMeter MCP for AI Agents AI Agent Connect

> OpenMeter lets you handle usage-based billing and customer entitlements for AI and cloud services. It connects your agent to a high-performance metering pipeline so you can track token counts, API calls, and subscription statuses in real-time. Instead of manual tracking, your agent handles the heavy lifting of mapping customers to plans and managing their access limits.

## Overview
- **Category:** cloud-infrastructure
- **Price:** Free
- **Endpoint:** https://edge.vinkius.com/vk_preview_p0lNF3lg9UNUFHTVH6Gq1Yu25ac5iomRjqaxflSt/ai-agent-connect
- **Tags:** usage-metering, ai-billing, cloudevents, finops, saas-billing

## Description

You're likely trying to figure out how to charge your users for the actual amount of compute or tokens they consume. It's a mess of spreadsheets and manual calculations until you get a solid metering system in place. This Connector lets your agent take over that entire process. You can tell your agent to set up new billable customers, define what features they're allowed to use, and even trigger Stripe checkout sessions when it's time for them to pay. It handles the boring stuff like mapping internal keys to customer profiles and keeping track of usage limits so you don't have to. Since Vinkius makes it easy to plug this into your existing workflow, you can start moving from flat-rate pricing to actual usage-based models without building a custom backend for it. Your agent becomes the person who manages the billing lifecycle, making sure everyone stays on their plan and gets the access they paid for.

## Tools

### create_entitlement
Create an entitlement for a customer. Use this to give specific users access to certain features.

### create_feature
Create a new feature for metering. This defines what specific resources you want to track for billing.

### create_stripe_checkout
Create a Stripe checkout session. It triggers the actual payment process for your customers.

### create_subscription
Create a subscription. This links a customer to a specific plan and starts their billing cycle.

### delete_subject
Delete a subject by key. Use this to remove specific usage subjects from your metering data.

### get_customer
Get a customer by ID or Key. This lets your agent quickly pull up billing and profile details.

### ingest_event
Ingest a usage event into OpenMeter. Send token counts or API calls to your metering pipeline.

### upsert_subjects
Provide an array of subject objects to upsert subjects in OpenMeter. This handles bulk updates for usage subjects.

### create_customer
Create a new billable customer profile. This lets your agent set up new accounts for your users.

## Prompt Examples

**Prompt:** 
```
How much did customer 'acme-01' use this month?
```

**Response:** 
```
I've pulled the consumption data for **ACME Corp (acme-01)**. Here is the summary for the current billing cycle:

| Metric | Usage | Status |
| :--- | :--- | :--- |
| **Tokens** | 1,250,000 |
| **API Calls** | 45,200 |
| **Image Gen** | 1,200 units |

They are currently within their 'Enterprise' tier limits.
```

**Prompt:** 
```
Set up a new user called 'StartupX' on the basic plan.
```

**Response:** 
```
I've successfully set up the new account for **StartupX**. 

* **Customer Profile:** Created with internal key `cust_startup_x`.
* **Subscription:** Linked to the **Basic Plan**.
* **Entitlements:** Standard basic features enabled.

You can now tell them to start using the service.
```

**Prompt:** 
```
Create a new feature for 'Video Processing' with a limit of 500 units.
```

**Response:** 
```
I've created the new **Video Processing** feature.

* **Feature Key:** `video_proc_01`
* **Meter Slug:** `video_total_units`
* **Default Limit:** 500 units

You can now assign this entitlement to specific customers as they need it.
```

## Capabilities

### Track token and API usage
Send events to your metering pipeline to see exactly how much your users are consuming.

### Manage customer profiles
Create and update billable customer records with unique internal keys.

### Set usage limits
Define specific entitlements and access rights for different customer tiers.

### Link plans to customers
Map users to specific subscription plans and manage their lifecycle.

### Start payment sessions
Initiate Stripe checkouts to collect payments and start new subscriptions.

## Use Cases

### Onboarding an enterprise client
A founder asks the agent to create a customer, link them to a Pro plan, and set their usage limits.

### Tracking LLM costs
An engineer tells the agent to ingest a tokens event every time a user hits the API.

### Handling subscription upgrades
A customer wants more features; the agent checks their current status and creates a new subscription.

### Auditing usage
A FinOps lead asks the agent to list the consumption for a specific customer key to check for overages.

## Benefits

- Automate billing setup: Use create_customer and create_subscription to onboard users without manual data entry.
- Real-time usage tracking: Use ingest_event to feed your metering pipeline with live token counts and API calls.
- Dynamic access control: Manage what users can actually do by defining metered features with create_feature and create_entitlement.
- Faster payment collection: Trigger Stripe sessions with create_stripe_checkout to get paid faster.
- Data-driven FinOps: Use get_customer to query specific consumption data and manage high-usage accounts.

## How It Works

The bottom line is your agent handles the entire billing and entitlement lifecycle without you touching a dashboard.

1. Subscribe to the OpenMeter MCP and grab your API key from the OpenMeter dashboard.
2. Connect the Connector to your AI client and provide the credentials.
3. Ask your agent to manage customers, ingest usage events, or create subscriptions.

## Frequently Asked Questions

**Can OpenMeter help me charge users based on AI tokens?**
Yes, it tracks usage events like tokens so you can bill your customers accurately based on their actual consumption.

**Does OpenMeter work with Stripe?**
Yes, it can trigger Stripe checkout sessions for your subscriptions to automate the payment collection process.

**How do I manage customer limits with OpenMeter?**
You can ask your agent to define specific entitlements and limits for any customer, ensuring they stay within their plan boundaries.

**Can I use OpenMeter to track cloud costs?**
Yes, it is designed to ingest usage events for cloud and AI services to help you manage and bill for infrastructure costs.

**Is OpenMeter good for SaaS billing?**
It is an excellent choice for SaaS companies looking to move to usage-based pricing models or complex entitlement systems.

**Can my agent set up new subscriptions with OpenMeter?**
Yes, your agent can link customers to plans and manage their entire subscription lifecycle without manual dashboard entries.

**How do I record that a user just consumed 500 tokens in an AI prompt?**
Use the `ingest_event` tool. Provide the event type (e.g., 'prompt'), the subject (customer ID), and a JSON payload containing the count (e.g., `{"tokens": 500}`). OpenMeter will handle the aggregation automatically.

**Can I check the current status and metadata of a specific billable customer?**
Yes! Use the `get_customer` tool with the customer's ID or Key. It will return the customer's name, usage attribution settings, and internal identifiers.

**How do I set a usage limit or entitlement for a customer?**
Use the `create_entitlement` tool. You'll need the `customerId` and a JSON configuration defining the feature and the limit (e.g., a hard limit of 1000 units per month).