Hey Team,
I’m working with the OpenAI Agents SDK and noticed that the agent response includes a Usage object. This object shows properties that help me understand the model’s input and output token counts for the agent run. However, I don’t see any way to access cached tokens.
Here is the code snippet to run agent and access usage value
result = await Runner.run(
starting_agent = demo_agent,
input = input
)
# Print the original final_output
print("Final output:", result.final_output)
print(result.raw_responses[0].usage)
and I can see the usage printed as below
usage=Usage(requests=1, input_tokens=935, output_tokens=15, total_tokens=950)
Is there a specific reason why cached tokens aren’t included in the Usage object? Do I need to enable any additional settings to have them reflected?