Skip to content
semconv.com
↑↓ move↵ openUse with your agent →

gen_ai.token.modality

DevelopmentGenAI registryenumas of v1.45.0

The modality of the tokens being counted.

For each operation, token usage counter measurements across all modalities SHOULD add up to the corresponding total, such as the gen_ai.usage.input_tokens attribute or a measurement on the gen_ai.client.inference.operation.input_tokens histogram.

Instrumentations SHOULD record tokens as unknown when their modality cannot reliably be determined. For example, if a provider reports 300 input tokens and 100 of them are audio, record 100 as audio and 200 as unknown.

Examples

  • text
  • image
  • audio

Values (4)

  • textText tokens.
  • imageImage tokens.
  • audioAudio tokens.
  • unknownThe modality is not known.

Used by

metrics (4)

  • gen_ai.client.inference.usage.cache_read.input_tokens *
  • gen_ai.client.inference.usage.cache_write.input_tokens *
  • gen_ai.client.inference.usage.input_tokens *
  • gen_ai.client.inference.usage.output_tokens *

* required on that signal.

History

    Definition sourceRegistry docsJSONUse with your agent →