Billing
Record usage (public)
POST
/api/billing/public/projects/{projectId}/usageSDK setup
Create a client instance. No authentication is required for this endpoint.
import { Configuration, BillingApi } from 'mudbase-sdk';
const configuration = new Configuration({
basePath: 'https://cloud.mudbase.dev',
});
const billing = new BillingApi(configuration);import { Configuration, BillingApi } from 'mudbase-sdk';
const configuration = new Configuration({
basePath: 'https://cloud.mudbase.dev',
});
const billing = new BillingApi(configuration);Example request
Call this endpoint using the client from SDK setup. Use View HTTP for a raw cURL example.
const { data: result } = await billing.recordUsage(
"proj_hNxZdNoKQ8dr",
{
email: "crawford21@northwind.dev",
metric: "circuit transmit",
quantity: 329.35
}
);const { data: result } = await billing.recordUsage(
"proj_hNxZdNoKQ8dr",
{
email: "crawford21@northwind.dev",
metric: "circuit transmit",
quantity: 329.35
}
);Playground
liveTest this endpoint with your own credentials. Your requests will be sent to the live API.
No Request Yet
Send a request to see the full inspector
Authentication
Public — No Auth Required
Path Parameters
| Name | Type | Required | Description |
|---|---|---|---|
projectId | string | Yes | — |
Request Body
json
{
"email": "amari_koss69@northwind.dev",
"metric": "program quantify",
"quantity": 195.84
}{
"email": "amari_koss69@northwind.dev",
"metric": "program quantify",
"quantity": 195.84
}Responses
200Usage recorded
json
{
"message": "Usage recorded successfully"
}{
"message": "Usage recorded successfully"
}400—
Errors
| Code | Meaning |
|---|---|
400 | — |