AgentBill icon

AgentBill

Interact with AgentBill API for AI usage tracking & billing

Actions16

Overview

This node interacts with the AgentBill API to track AI usage events specifically for the 'Signal' resource with the 'Track Signal' operation. It records detailed AI usage event data such as event name, agent and customer identifiers, revenue, AI model and provider, token usage, and latency. This is useful for monitoring and billing AI usage in applications that integrate with AgentBill, enabling users to log and analyze AI-related events for cost tracking and operational insights.

Use Case Examples

  1. Tracking a chat completion event with details about the AI model used, tokens consumed, and latency to monitor usage and costs.
  2. Recording an embedding creation event with associated revenue and identifiers for agent and customer to maintain accurate billing records.

Properties

Name Meaning
Event Name The type of event being tracked, e.g., chat.completion or embedding.create.
Agent External ID Identifier for the agent involved in the event.
Customer External ID Identifier for the customer involved in the event.
Revenue Revenue amount associated with this event.
Model The AI model used for the event, e.g., gpt-4 or claude-3.
Provider The AI provider for the event, e.g., openai or anthropic.
Input Tokens Number of input tokens consumed during the event.
Output Tokens Number of output tokens produced during the event.
Latency (ms) Latency of the event in milliseconds.

Output

JSON

  • event_name - The name/type of the tracked event.
  • agent_external_id - External identifier for the agent.
  • customer_external_id - External identifier for the customer.
  • revenue - Revenue amount for the event.
  • model - AI model used in the event.
  • provider - AI provider for the event.
  • input_tokens - Number of input tokens used.
  • output_tokens - Number of output tokens used.
  • latency_ms - Latency in milliseconds for the event.

Dependencies

  • AgentBill API with API key authentication

Troubleshooting

  • Ensure the API key credential for AgentBill is correctly configured and has necessary permissions.
  • Verify that required fields like 'Event Name' are provided and valid to avoid request errors.
  • Check network connectivity to the AgentBill API endpoint to prevent request failures.
  • If the node throws errors about missing parameters, confirm all required input properties are set correctly.

Links

Discussion