Would it be possible to record animations in playmode?

I am working on a project where I animate a character rig procedurally. I would like to capture this movement in an animation clip.

Is it possible to access clip curves and add keys programmatically?


Here is a link: