GenerationSpanData
type GenerationSpanData = SpanDataBase & object;Type Declaration
Section titled “Type Declaration”input?
Section titled “input?”optional input: Record<string, any>[];model?
Section titled “model?”optional model: string;model_config?
Section titled “model_config?”optional model_config: Record<string, any>;output?
Section titled “output?”optional output: Record<string, any>[];type: "generation";usage?
Section titled “usage?”optional usage: GenerationUsageData;Usage fields are intentionally flexible in agents-core tracing.
Exporters are responsible for backend-specific mapping and validation.
For example, the OpenAI tracing exporter in @openai/agents-openai keeps
top-level generation usage to input_tokens and output_tokens for OpenAI
traces ingest, and maps additional usage fields under usage.details.
Third-party exporters can choose their own usage schema and transformation
strategy.