Low level build cache API

Is there a way to use build cache in a more direct but still “official” way like
something.store(key, file)
file = something.retrieve(key)

In case splitting work into more tasks or transforms and defining inputs/outputs is infeasible for one reason or another