---
title: "Working with ChatGPT Functions on Heroku"
description: "Menu Maker is a Node.js web application that turns user-supplied ingredients into a dish name, fine-dining description, ingredient list, and recipe. Its React front end communicates with an Express back end, which adds prompt instructions and sends the request to OpenAI’s Chat Completions API. The application uses ChatGPT’s function calling feature to define an updateDish function with structured JSON fields for the title, description, ingredients, and recipe, so parsed arguments can update React state directly. The GitHub-hosted Node.js monorepo is deployed to Heroku, where an OPENAI_API_KEY config var authenticates requests, an optional CHATGPT_MODEL selects the model, and Heroku runs yarn build and yarn start."
---

# Working with ChatGPT Functions on Heroku

[Heroku](https://yomu.fyi/company/heroku) · Julián Duque · Jan 30, 2024

**Type:** Tutorial

## Summary

Menu Maker is a Node.js web application that turns user-supplied ingredients into a dish name, fine-dining description, ingredient list, and recipe. Its React front end communicates with an Express back end, which adds prompt instructions and sends the request to OpenAI’s Chat Completions API. The application uses ChatGPT’s function calling feature to define an updateDish function with structured JSON fields for the title, description, ingredients, and recipe, so parsed arguments can update React state directly. The GitHub-hosted Node.js monorepo is deployed to Heroku, where an OPENAI\_API\_KEY config var authenticates requests, an optional CHATGPT\_MODEL selects the model, and Heroku runs yarn build and yarn start.

## Context

The project is motivated by developers building applications on top of OpenAI’s APIs and by the need for a quick, secure, and simple hosting path on Heroku.

## Approach / What changed

The application combines a React front end with an Express API server, uses ChatGPT function calling to request structured dish data, parses the returned arguments, and deploys the GitHub-hosted monorepo to Heroku with configuration variables for authentication and model selection.

## Takeaways

- ChatGPT function calling provides a formatted response that code can feed into a custom function; it does not invoke the function itself.
- The updateDish schema requires title, description, ingredients, and recipe fields, with ingredients represented as objects containing an ingredient name and amount.
- Heroku deployment uses OPENAI\_API\_KEY as a config var, optionally reads CHATGPT\_MODEL, and runs yarn build followed by yarn start; dynos can be scaled to zero when unused.

**Tags:** [API](https://yomu.fyi/topic/api), [Generative AI](https://yomu.fyi/topic/generative-ai), [Heroku](https://yomu.fyi/topic/heroku), [Node.js](https://yomu.fyi/topic/node-js), [React](https://yomu.fyi/topic/react)

- Source: [Heroku](https://www.heroku.com/blog/working-with-chatgpt-functions-on-heroku)
- Source URL: https://www.heroku.com/blog/working-with-chatgpt-functions-on-heroku
- Ingested by Yomu: 2026-09-09T20:04:31.201Z

[Read original post](https://www.heroku.com/blog/working-with-chatgpt-functions-on-heroku)
