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
The AI model provider. Accepted values:
azure
azure-2
openai
gemini
deepseek
bedrock
The specific model name used for the request. Available models per provider: Provider Available Models azuregpt-4o-mini, gpt-4oazure-2gpt-4.1-nano, gpt-4.1-mini, gpt-4.1, gpt-5-nano, gpt-5-mini, gpt-5-chat, gpt-5openaigpt-4.1, gpt-4.1-minigeminigemini-2.0-flash, gemini-2.0-flash-exp, gemini-2.5-flash, gemini-2.5-pro, gemini-3-pro, gemini-3-flashdeepseekdeepseek-chat, DeepSeek-V3.2, DeepSeek-V3.2-thinkingbedrockclaude-4-sonnet, global.anthropic.claude-sonnet-4-20250514-v1:0
The number of input tokens consumed in the request. Must be a non-negative integer.
The number of output tokens generated in the response. Must be a non-negative integer.
Optional multiplier for credit calculation (between 1 and 10). Useful for premium features or custom pricing tiers.
feature
string
default: "agent_run"
The feature or action that triggered this credit spend (e.g., agent_run, chat_completion, embedding).
Optional. The ID of the agent associated with this usage. Useful for per-agent analytics and billing.
Optional. Additional metadata to associate with this credit event. Can include any custom fields for tracking purposes.
Response
Indicates whether the credit spend was successfully recorded.
The ID of the organization that was charged.
A unique identifier for this credit spend event. Useful for auditing and reconciliation.
The actual number of credits charged for this event.
The number of credits that were requested based on the token count.
The input tokens recorded.
The output tokens recorded.
curl --location --request POST 'https://dashboard.laburen.com/api/usage/increment-agent-queries' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer <API_KEY>' \
--data-raw '{
"provider": "azure-2",
"modelName": "gpt-4.1",
"inputTokens": 1500,
"outputTokens": 500,
"feature": "agent_run",
"agentId": "clxxxxxxxxxxxxxxxxx"
}'
{
"success" : true ,
"organizationId" : "org_xxxxxxxxxxxx" ,
"eventId" : "evt_xxxxxxxxxxxx" ,
"credits" : {
"charged" : 0.045 ,
"requested" : 0.045
},
"model" : {
"provider" : "azure-2" ,
"modelName" : "gpt-4.1"
},
"tokens" : {
"inputTokens" : 1500 ,
"outputTokens" : 500
}
}