gen_ai.usage.input_tokens
The number of tokens used in the GenAI input (prompt).
This value SHOULD include all types of input tokens, including cached tokens. Instrumentations SHOULD make a best effort to populate this value, using a total provided by the provider when available or, depending on the provider API, by summing different token types parsed from the provider output.
Examples
- 100
Used by
events (1)
- gen_ai.client.inference.operation.details
spans (8)
- span.anthropic.inference.client
- span.aws.bedrock.client
- span.azure.ai.inference.client
- span.gen_ai.embeddings.client
- span.gen_ai.inference.client
- span.gen_ai.invoke_agent.client
- span.gen_ai.invoke_agent.internal
- span.openai.inference.client
* required on that signal.
History
- v1.42.0deprecated
Moved to the OpenTelemetry GenAI semantic conventions repository.
Now referenced by
attributes.gen_ai.invoke_agent.client,attributes.gen_ai.invoke_agent.commonand 2 others (recommended).Now referenced by
span.anthropic.inference.client(recommended).No longer referenced by
span.gen_ai.azure.ai.inference.clientandspan.gen_ai.openai.inference.client.Now referenced by
gen_ai.client.inference.operation.details,span.azure.ai.inference.clientand 1 other (recommended).No longer referenced by
span.gen_ai.az.ai.inference.client.Now referenced by
span.gen_ai.azure.ai.inference.client(recommended).Now referenced by
span.aws.bedrock.client(recommended).No longer referenced by
attributes.gen_ai.openai_based,span.gen_ai.clientand 3 others.Now referenced by
attributes.gen_ai.inference.client,attributes.gen_ai.inference.openai_basedand 4 others (recommended).No longer referenced by
trace.gen_ai.az.ai.inference.client.Now referenced by
attributes.gen_ai.openai_based,span.gen_ai.az.ai.inference.clientand 1 other (recommended).Stability label respelled from experimental to development.
Already present at v1.30.0, the oldest release tracked here (experimental).