How do I make a chart’s tag values dynamic via the API?

To set the tag value as dynamic, specify the tag’s value in the metric as “$tags”.  See the API doc for more details.