# Changes for GPT 5 in Build AI-Powered Apps

**URL:** https://forum.codewithmosh.com/t/changes-for-gpt-5-in-build-ai-powered-apps/71496
**Category:** Uncategorized
**Created:** [September 11, 2025, 1:21pm UTC](https://forum.codewithmosh.com/t/changes-for-gpt-5-in-build-ai-powered-apps/71496 "2025-09-11T13:21:10Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![horst](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.codewithmosh.com/horst/32/14291_2.png) [@horst](https://forum.codewithmosh.com/u/horst)
#### Post date: [September 11, 2025, 1:21pm UTC](https://forum.codewithmosh.com/t/changes-for-gpt-5-in-build-ai-powered-apps/71496/1 "2025-09-11T13:21:10Z")

</div>

I have noticed that OpenAI has made some breaking changes to its API with the introduction of GPT 5. These are not yet documented.  
For example, if you use model: ‘gpt-5-nano’ at the OpenAi client, you must delete the ‘temperature’ parameter, otherwise an error will occur. Changes must be made in the client.ts and in the services layer of the course code.

Typical AI, the course is only a few weeks old and something has already changed again 😉

---

<div class="post-metadata">

### Author: ![atxy2k](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.codewithmosh.com/atxy2k/32/14300_2.png) [@atxy2k](https://forum.codewithmosh.com/u/atxy2k)
#### Post date: [September 12, 2025, 11:53pm UTC](https://forum.codewithmosh.com/t/changes-for-gpt-5-in-build-ai-powered-apps/71496/2 "2025-09-12T23:53:57Z")

</div>

Hi horst, I think it’s part of the way, I worked with gpt-4o-mini almost all the course without problem, I think It’s gonna be situations that we should to learn to handle.

---

<div class="post-metadata">

### Author: ![heroesch](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.codewithmosh.com/heroesch/32/14288_2.png) [@heroesch](https://forum.codewithmosh.com/u/heroesch)
#### Post date: [October 7, 2025, 2:51pm UTC](https://forum.codewithmosh.com/t/changes-for-gpt-5-in-build-ai-powered-apps/71496/3 "2025-10-07T14:51:25Z")

</div>

At  
2.1- Building the Chat API (6:26)  
The API has totally changed, this does not currently works:

```auto
import express from 'express';
import type { Request, Response } from 'express';
import dotenv from 'dotenv';
import OpenAI from 'openai';
import client from 'openai';

dotenv.config();

const openai = new OpenAI({
   apiKey: process.env.OPENAI_API_KEY,
});

const app = express();
app.use(express.json());
const port = process.env.PORT || 3000;

app.get('/', (req: Request, res: Response) => {
   // res.send(process.env.OPENAI_API_KEY);
   res.send('Hello World!');
});

app.get('/api/hello', (req: Request, res: Response) => {
   // res.send(process.env.OPENAI_API_KEY);
   res.json({ message: 'Hello World!' });
});

app.post('/api/chat', async (req: Request, res: Response) => {
   const { prompt } = req.body;

   const response = await client.responses.create({
      model: 'gpt-4.0-mini',
      input: prompt,
      temperature: 0.2,
      max_output_tokens: 100,
   });

   res.json({ message: response.output_text }); //{ message: response.choices[0].message
});

app.listen(port, () => {
   console.log(`Server is running at http://localhost:${port}`);
});

```

At the

```auto
   client.responses.create({

```

You will get a

`Property 'responses' does not exist on type 'typeof OpenAI'. Did you mean 'Responses'?ts(2551)`

---

<div class="post-metadata">

### Author: ![heroesch](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.codewithmosh.com/heroesch/32/14288_2.png) [@heroesch](https://forum.codewithmosh.com/u/heroesch)
#### Post date: [October 7, 2025, 4:31pm UTC](https://forum.codewithmosh.com/t/changes-for-gpt-5-in-build-ai-powered-apps/71496/4 "2025-10-07T16:31:45Z")

</div>

To fix the problem, I modified  
packages\server\index.ts  
as follows:

```auto
import express from 'express';
import type { Request, Response } from 'express';
import dotenv from 'dotenv';
import OpenAI from 'openai';

dotenv.config();

const openai = new OpenAI({
   apiKey: process.env.OPENAI_API_KEY,
});

const app = express();
app.use(express.json());
const port = process.env.PORT || 3000;

app.get('/', (req: Request, res: Response) => {
   // res.send(process.env.OPENAI_API_KEY);
   res.send('Hello World!');
});

app.get('/api/hello', (req: Request, res: Response) => {
   // res.send(process.env.OPENAI_API_KEY);
   res.json({ message: 'Hello World!' });
});

app.post('/api/chat', async (req: Request, res: Response) => {
   try {
      const { prompt } = req.body;

      if (!prompt) {
         return res.status(400).json({ error: 'Prompt is required' });
      }

      const response = await openai.chat.completions.create({
         model: 'gpt-4o-mini',
         messages: [
            {
               role: 'user',
               content: prompt,
            },
         ],
         temperature: 0.2,
         max_tokens: 100,
      });

      const content = response.choices[0]?.message?.content;
      res.json({ message: content || 'No response generated' });
   } catch (error) {
      console.error('OpenAI API error:', error);
      res.status(500).json({ error: 'Failed to generate response' });
   }
});

app.listen(port, () => {
   console.log(`Server is running at http://localhost:${port}`);
});

```
