prehistoric-carpenter-68779
03/26/2025, 5:41 AMtall-airline-16756
03/26/2025, 5:41 AMtall-airline-16756
03/26/2025, 5:41 AMfrom openai import MultimodalAgent
# Initialize your agent
agent = MultimodalAgent(api_key="your_api_key")
# Example input
input_data = "Your input text or multimodal data here"
# Process the input and get a response
response = agent.process(input_data)
# Access token usage metrics
token_usage = response["usage"]
print("Prompt tokens:", token_usage["prompt_tokens"])
print("Completion tokens:", token_usage["completion_tokens"])
print("Total tokens:", token_usage["total_tokens"])
This example assumes that the response
object contains a usage
field with token details. Let me know if you need further assistance! Sources: livekit.plugins.openai.realtime API documentation | livekit.agents.metrics API documentation