API for auto-generating BPMN models?

Which API would you recommend to generate BPMN models with JavaScript?

Would you recommend bpmn-js Modeling or pure bpmn-moddle?

I’m essentially looking for something like the Camunda BPMN Model API but in JavaScript, because a customer wants to convert a proprietary JSON format into BPMN XML.

That depends on your use-case. With bpmn-moddle you need to take care of wiring the BPMN 2.0 correctly according to the BPMN 2.0 meta-model. In that regard it is closer to the Camunda BPMN Model API .

If you use the Modelling API you work on a much simpler shapes + connections model and creating/wiring the underlying BPMN 2.0 document is taken care of automatically.