OpenMonetize API Gateway (0.1.0)

Download OpenAPI specification:

Open-source AI monetization infrastructure

Authentication

All API endpoints require authentication using Bearer token format:

Authorization: Bearer YOUR_API_KEY

Or using the X-API-Key header:

X-API-Key: YOUR_API_KEY


## How to get an API Key

You have two options to get started:

1. **Self-Hosted (Free & Private)**: Run the platform locally or on your own infrastructure. You are the admin and can generate keys for yourself.
2. **Sandbox (Quick Start)**: Use our hosted sandbox environment to try the API immediately without installation.

### Getting a Key (Sandbox)
1. Go to the [OpenMonetize Console](https://app.openmonetize.io).
2. Navigate to the **Sandbox** or **API Keys** section.
3. Generate a new API key.
4. Use this key in the "Authorize" button above.

## Rate Limiting

API requests are rate-limited to 100 requests per 1 minute per API key.

Health

System health and readiness checks

Customers

Customer account management

Register a new customer account

Register a new customer account

Authorizations:
bearerAuthApiKeyAuth
Request Body schema: application/json
required
name
required
string [ 1 .. 255 ] characters
email
required
string <email> ^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z...
tier
string
Default: "STARTER"
Enum: "STARTER" "GROWTH" "ENTERPRISE"

Responses

Request samples

Content type
application/json
{
  • "name": "string",
  • "email": "user@example.com",
  • "tier": "STARTER"
}

Response samples

Content type
application/json
{
  • "data": {
    }
}

Events

Usage event ingestion

Ingest a batch of usage events

Ingest a batch of usage events

Authorizations:
bearerAuthApiKeyAuth
Request Body schema: application/json
required
required
Array of objects [ 1 .. 1000 ] items

Responses

Request samples

Content type
application/json
{
  • "events": [
    ]
}

Response samples

Content type
application/json
{
  • "accepted": 0,
  • "rejected": 0,
  • "duplicates": 0,
  • "batch_id": "string",
  • "status": "string",
  • "message": "string"
}

Credits

Credit wallet management

Get credit balance for the authenticated customer

Get credit balance for the authenticated customer

Authorizations:
bearerAuth

Responses

Response samples

Content type
application/json
{
  • "data": {
    }
}

Get credit balance for a specific user

Get credit balance for a specific user

Authorizations:
bearerAuthApiKeyAuth
path Parameters
userId
required
string non-empty

Responses

Response samples

Content type
application/json
{
  • "data": {
    }
}

Purchase credits for a user (top-up)

Purchase credits for a user (top-up)

Authorizations:
bearerAuthApiKeyAuth
Request Body schema: application/json
required
userId
required
string non-empty
amount
required
number > 0
purchasePrice
required
number > 0
expiresAt
string <date-time> ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[...

Responses

Request samples

Content type
application/json
{
  • "userId": "string",
  • "amount": 0,
  • "purchasePrice": 0,
  • "expiresAt": "2019-08-24T14:15:22Z"
}

Response samples

Content type
application/json
{
  • "data": {
    }
}

Grant credits to a customer, user, or team (admin

Grant credits to a customer, user, or team (admin operation)

Authorizations:
bearerAuthApiKeyAuth
Request Body schema: application/json
required
userId
string non-empty
teamId
string non-empty
amount
required
number >= 1
reason
string
object
idempotencyKey
string
expiresAt
string <date-time> ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[...

Responses

Request samples

Content type
application/json
{
  • "userId": "string",
  • "teamId": "string",
  • "amount": 1,
  • "reason": "string",
  • "metadata": {
    },
  • "idempotencyKey": "string",
  • "expiresAt": "2019-08-24T14:15:22Z"
}

Response samples

Content type
application/json
{
  • "data": {
    }
}

Get credit transaction history for a user

Get credit transaction history for a user

Authorizations:
bearerAuthApiKeyAuth
path Parameters
userId
required
string non-empty
query Parameters
limit
integer [ 1 .. 100 ]
Default: 50
offset
integer [ 0 .. 9007199254740991 ]
Default: 0

Responses

Response samples

Content type
application/json
{
  • "data": [
    ],
  • "pagination": {
    }
}

Entitlements

Feature access control

Check if a user is entitled to perform an action (

Check if a user is entitled to perform an action (sub-10ms latency)

Authorizations:
bearerAuthApiKeyAuth
Request Body schema: application/json
required
userId
required
string non-empty
featureId
required
string
required
object

Responses

Request samples

Content type
application/json
{
  • "userId": "string",
  • "featureId": "string",
  • "action": {
    }
}

Response samples

Content type
application/json
{
  • "allowed": true,
  • "reason": "string",
  • "estimatedCostCredits": 0,
  • "estimatedCostUsd": 0,
  • "currentBalance": 0,
  • "actions": [
    ]
}

Create a new entitlement for a customer or user

Create a new entitlement for a customer or user

Authorizations:
bearerAuthApiKeyAuth
Request Body schema: application/json
required
userId
string non-empty
featureId
required
string
limitType
required
string
Enum: "HARD" "SOFT" "NONE"
limitValue
number or null
period
string or null
Enum: "DAILY" "MONTHLY" "TOTAL"
object

Responses

Request samples

Content type
application/json
{
  • "userId": "string",
  • "featureId": "string",
  • "limitType": "HARD",
  • "limitValue": 0,
  • "period": "DAILY",
  • "metadata": {
    }
}

Response samples

Content type
application/json
{
  • "data": {
    }
}

List all entitlements for the authenticated custom

List all entitlements for the authenticated customer

Authorizations:
bearerAuthApiKeyAuth

Responses

Response samples

Content type
application/json
{
  • "data": [
    ]
}

Update an existing entitlement

Update an existing entitlement

Authorizations:
bearerAuthApiKeyAuth
path Parameters
id
required
string <uuid> ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA...
Request Body schema: application/json
limitType
string
Enum: "HARD" "SOFT" "NONE"
limitValue
number or null
period
string or null
Enum: "DAILY" "MONTHLY" "TOTAL"
object

Responses

Request samples

Content type
application/json
{
  • "limitType": "HARD",
  • "limitValue": 0,
  • "period": "DAILY",
  • "metadata": {
    }
}

Response samples

Content type
application/json
{
  • "data": {
    }
}

Delete an entitlement

Delete an entitlement

Authorizations:
bearerAuthApiKeyAuth
path Parameters
id
required
string <uuid> ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA...

Responses

Response samples

Content type
application/json
null

Analytics

Usage analytics

Get cost breakdown by provider/model

Get cost breakdown by provider/model

Authorizations:
bearerAuthApiKeyAuth
query Parameters
startDate
string <date-time> ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[...
endDate
string <date-time> ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[...
groupBy
string
Default: "day"
Enum: "day" "week" "month"

Responses

Response samples

Content type
application/json
{
  • "data": [
    ],
  • "totals": null,
  • "period": null
}

Get usage trends over time

Get usage trends over time

Authorizations:
bearerAuthApiKeyAuth
query Parameters
startDate
string <date-time> ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[...
endDate
string <date-time> ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[...
groupBy
string
Default: "day"
Enum: "day" "week" "month"

Responses

Response samples

Content type
application/json
{
  • "data": [
    ],
  • "period": null
}

Credit burn forecasting

Credit burn forecasting

Authorizations:
bearerAuthApiKeyAuth
query Parameters
days
string

Responses

Response samples

Content type
application/json
{
  • "currentBalance": 0,
  • "averageDailyBurn": 0,
  • "forecast": [
    ],
  • "projections": null
}

Get customer summary statistics

Get customer summary statistics

Authorizations:
bearerAuthApiKeyAuth

Responses

Response samples

Content type
application/json
{
  • "creditBalance": null,
  • "lifetime": null,
  • "last30Days": null,
  • "recentActivity": [
    ]
}

Get usage analytics by feature for a customer

Get usage analytics by feature for a customer

Authorizations:
bearerAuthApiKeyAuth
query Parameters
customerId
string non-empty
startDate
string <date-time> ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[...
endDate
string <date-time> ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[...
groupBy
string
Enum: "day" "week" "month"
provider
string
model
string
featureId
string

Responses

Response samples

Content type
application/json
{
  • "data": {
    }
}

Get cost breakdown and margin analysis

Get cost breakdown and margin analysis

Authorizations:
bearerAuthApiKeyAuth
query Parameters
customerId
string non-empty
startDate
string <date-time> ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[...
endDate
string <date-time> ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[...

Responses

Response samples

Content type
application/json
{
  • "data": {
    }
}

Get credit burn rate and consumption trends

Get credit burn rate and consumption trends

Authorizations:
bearerAuthApiKeyAuth
query Parameters
customerId
string non-empty
userId
string non-empty

Responses

Response samples

Content type
application/json
{
  • "data": {
    }
}

Rating

Cost calculation engine

Calculate cost for a single operation

Calculate cost for a single operation

Authorizations:
bearerAuthApiKeyAuth
Request Body schema: application/json
required
provider
required
string
Enum: "OPENAI" "ANTHROPIC" "GOOGLE" "COHERE" "MISTRAL"
model
required
string non-empty
inputTokens
required
integer [ 0 .. 9007199254740991 ]
outputTokens
required
integer [ 0 .. 9007199254740991 ]

Responses

Request samples

Content type
application/json
{
  • "provider": "OPENAI",
  • "model": "string",
  • "inputTokens": 9007199254740991,
  • "outputTokens": 9007199254740991
}

Response samples

Content type
application/json
{
  • "cost": 0,
  • "currency": "string",
  • "credits": 0
}

Bulk cost calculation

Bulk cost calculation

Authorizations:
bearerAuthApiKeyAuth
Request Body schema: application/json
required
required
Array of objects [ 1 .. 100 ] items

Responses

Request samples

Content type
application/json
{
  • "calculations": [
    ]
}

Response samples

Content type
application/json
{
  • "customerId": "string",
  • "results": [
    ],
  • "total": 0
}

Get all provider pricing

Get all provider pricing

Authorizations:
bearerAuthApiKeyAuth

Responses

Response samples

Content type
application/json
{
  • "data": [
    ],
  • "total": 0
}

Burn Tables

Pricing configuration

List all burn tables

List all burn tables

Authorizations:
bearerAuthApiKeyAuth
query Parameters
isActive
string

Responses

Response samples

Content type
application/json
{
  • "data": [
    ],
  • "total": 0
}

Create a new burn table

Create a new burn table

Authorizations:
bearerAuthApiKeyAuth
Request Body schema: application/json
required
name
required
string [ 1 .. 255 ] characters
required
object
validFrom
string <date-time> ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[...
validUntil
string <date-time> ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[...

Responses

Request samples

Content type
application/json
{
  • "name": "string",
  • "rules": {
    },
  • "validFrom": "2019-08-24T14:15:22Z",
  • "validUntil": "2019-08-24T14:15:22Z"
}

Response samples

Content type
application/json
{
  • "data": null
}

Get a specific burn table

Get a specific burn table

Authorizations:
bearerAuthApiKeyAuth
path Parameters
id
required
string <uuid> ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA...

Responses

Response samples

Content type
application/json
{
  • "data": null
}

Update a burn table

Update a burn table

Authorizations:
bearerAuthApiKeyAuth
path Parameters
id
required
string <uuid> ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA...
Request Body schema: application/json
name
string [ 1 .. 255 ] characters
object
isActive
boolean
validFrom
string <date-time> ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[...
validUntil
string <date-time> ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[...

Responses

Request samples

Content type
application/json
{
  • "name": "string",
  • "rules": {
    },
  • "isActive": true,
  • "validFrom": "2019-08-24T14:15:22Z",
  • "validUntil": "2019-08-24T14:15:22Z"
}

Response samples

Content type
application/json
{
  • "data": null
}

Delete (deactivate) a burn table

Delete (deactivate) a burn table

Authorizations:
bearerAuthApiKeyAuth
path Parameters
id
required
string <uuid> ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA...

Responses

Response samples

Content type
application/json
{
  • "message": "string"
}

Get active burn table for the authenticated custom

Get active burn table for the authenticated customer

Authorizations:
bearerAuthApiKeyAuth

Responses

Response samples

Content type
application/json
{
  • "data": null,
  • "isDefault": true
}