Works in OpenAlex are tagged with Topics using an automated system that takes into account the available information about the work, including title, abstract, source (journal) name, and citations.
There are around 4,500 Topics. Topics are grouped into subfields, which are grouped into fields, which are grouped into top-level domains. This is shown in the diagram below, along with the counts for each.
Works are assigned topics using a model that assigns scores for each topic for a work. The highest-scoring topic is that work's primary_topic. Each topic has one subfield, one field, and one domain, so each of these may also be used to classify the work, depending on the level of granularity you want. We also provide additional highly ranked topics for works, in Work.topics.