Metabase API + a custom open ai model tips?

I am planning to build a chatbot that works on specific types of e-commerce data sets. To start with I have a large data set with product pricing, stock status, review count, promotions, etc. This information is scraped from e-commerce websites. The data is updated periodically in a Postgres database. I've already connected metabase with the database and built a model from the product data table.

I built a custom open ai model that generates SQL queries from natural language text for this type of data set. How can I pass the SQL to the metabase API and get the visualization from metabase as a public link inside my chatbot?

Questions:

  1. Is it possible on the open-source version?
  2. Any references or tips for the implementation?

The only way would be to do this via a headless browser, as the Metabase query is done on the backend but the visualization is done on the frontend, so you need to do this on the frontend altogether