Skip to main content
POST
https://dashboard.laburen.com
/
api
/
usage
/
increment-agent-queries
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
  }
}
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

provider
string
required
The AI model provider. Accepted values:
  • azure
  • azure-2
  • openai
  • gemini
  • deepseek
  • bedrock
modelName
string
required
The specific model name used for the request. Available models per provider:
ProviderAvailable Models
azuregpt-4o-mini, gpt-4o
azure-2gpt-4.1-nano, gpt-4.1-mini, gpt-4.1, gpt-5-nano, gpt-5-mini, gpt-5-chat, gpt-5
openaigpt-4.1, gpt-4.1-mini
geminigemini-2.0-flash, gemini-2.0-flash-exp, gemini-2.5-flash, gemini-2.5-pro, gemini-3-pro, gemini-3-flash
deepseekdeepseek-chat, DeepSeek-V3.2, DeepSeek-V3.2-thinking
bedrockclaude-4-sonnet, global.anthropic.claude-sonnet-4-20250514-v1:0
inputTokens
integer
default:"0"
The number of input tokens consumed in the request. Must be a non-negative integer.
outputTokens
integer
default:"0"
The number of output tokens generated in the response. Must be a non-negative integer.
coefficient
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).
agentId
string
Optional. The ID of the agent associated with this usage. Useful for per-agent analytics and billing.
metadata
object
Optional. Additional metadata to associate with this credit event. Can include any custom fields for tracking purposes.

Response

success
boolean
Indicates whether the credit spend was successfully recorded.
organizationId
string
The ID of the organization that was charged.
eventId
string
A unique identifier for this credit spend event. Useful for auditing and reconciliation.
credits
object
model
object
tokens
object
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
  }
}