semconv.com

gen_ai.usage.input_tokens

MovedGenAI registryintas of v1.44.0

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

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

  1. v1.42.0deprecated

    Moved to the OpenTelemetry GenAI semantic conventions repository.

  2. v1.31.0

    Stability label respelled from experimental to development.

  3. v1.30.0

    Already present at v1.30.0, the oldest release tracked here (experimental).

Definition sourceRegistry docsJSON