We switch based on main_api. In the future, I'd like to move the openai-specific token count stuff outside the switch case and extract the generate_data preparation into its own function that we can pass main_api into.