Usage
Usage - Increment Agent Queries
This endpoint allows you to track and charge credits based on AI model token consumption for your organization.
POST
This endpoint is used to register credit consumption based on AI model usage. It tracks token usage (input/output) and automatically calculates the credit cost based on the model provider and configuration.
Use Cases:
- Track AI agent interactions and their associated costs
- Bill custom integrations that use AI models
- Monitor and control credit spending per agent or feature
- Implement usage-based billing for your organization
This endpoint requires a valid subscription or sufficient credit balance. The request will fail if the organization has exceeded its usage limits.
Body
string
required
The AI model provider. Accepted values:
azureazure-2azure-ossopenai-responsesgeminideepseekopenrouterbedrock(deprecated)
string
required
The specific model name used for the request. The
provider + modelName pair must match this table exactly — otherwise the event is recorded with 0 credits charged. Available models per provider:integer
default:"0"
The number of input tokens consumed in the request. Must be a non-negative integer.
integer
default:"0"
The number of output tokens generated in the response. Must be a non-negative integer.
integer
Optional multiplier for credit calculation (between 1 and 10). Useful for premium features or custom pricing tiers.
string
default:"agent_run"
The feature or action that triggered this credit spend (e.g.,
agent_run, chat_completion, embedding).string
Optional. The ID of the agent associated with this usage. Useful for per-agent analytics and billing.
object
Optional. Additional metadata to associate with this credit event. Can include any custom fields for tracking purposes.
Response
boolean
Indicates whether the credit spend was successfully recorded.
string
The ID of the organization that was charged.
string
A unique identifier for this credit spend event. Useful for auditing and reconciliation.
object
object
object

