From 4e69811c9ee0a5432f96169a42b4a79c05d21453 Mon Sep 17 00:00:00 2001 From: Alex Castillo Date: Tue, 3 Nov 2026 21:12:09 -0500 Subject: [PATCH 1/3] fix(prompt-chatgpt): replace gpt-3.5-turbo, shut down by OpenAI on 2026-10-23 OpenAI retired gpt-3.5-turbo on 2026-10-23 and names gpt-5.6-terra as its replacement, so the prompt-chatgpt templates fail on every request. Point the python, node and php templates and their READMEs at gpt-5.6-terra, and send the limit as max_completion_tokens: the gpt-5 family rejects max_tokens. The dart template is left unchanged: dart_openai 3.x (the newest release that supports its Dart 2 SDK constraint) still sends max_tokens. Co-Authored-By: Claude Sonnet 5.5 --- node/prompt-chatgpt/README.md | 4 ++-- node/prompt-chatgpt/src/main.js | 4 ++-- php/prompt-chatgpt/README.md | 4 ++-- php/prompt-chatgpt/src/index.php | 4 ++-- python/prompt_chatgpt/README.md | 4 ++-- python/prompt_chatgpt/src/main.py | 4 ++-- 6 files changed, 12 insertions(+), 12 deletions(-) diff --git a/node/prompt-chatgpt/README.md b/node/prompt-chatgpt/README.md index 47e3654d..4b9090b0 100644 --- a/node/prompt-chatgpt/README.md +++ b/node/prompt-chatgpt/README.md @@ -1,6 +1,6 @@ # 🤖 Node Prompt ChatGPT Function -Ask question, and let OpenAI GPT-3.5-turbo answer. +Ask question, and let OpenAI GPT-5.6-terra answer. ## 🧰 Usage @@ -76,7 +76,7 @@ A unique key used to authenticate with the OpenAI API. Please note that this is ### OPENAI_MAX_TOKENS -The maximum number of tokens that the OpenAI response should contain. Be aware that OpenAI models read and write a maximum number of tokens per API call, which varies depending on the model. For GPT-3.5-turbo, the limit is 4096 tokens. +The maximum number of tokens that the OpenAI response should contain. Be aware that OpenAI models read and write a maximum number of tokens per API call, which varies depending on the model. | Question | Answer | | ------------- | ------------------------------------------------------------------------------------------------------------- | diff --git a/node/prompt-chatgpt/src/main.js b/node/prompt-chatgpt/src/main.js index d6bb4456..f5240fbb 100644 --- a/node/prompt-chatgpt/src/main.js +++ b/node/prompt-chatgpt/src/main.js @@ -20,8 +20,8 @@ export default async ({ req, res }) => { try { const response = await openai.chat.completions.create({ - model: 'gpt-3.5-turbo', - max_tokens: parseInt(process.env.OPENAI_MAX_TOKENS ?? '512'), + model: 'gpt-5.6-terra', + max_completion_tokens: parseInt(process.env.OPENAI_MAX_TOKENS ?? '512'), messages: [{ role: 'user', content: req.bodyJson.prompt }], }); const completion = response.choices[0].message.content; diff --git a/php/prompt-chatgpt/README.md b/php/prompt-chatgpt/README.md index 5f58ba59..b046e526 100644 --- a/php/prompt-chatgpt/README.md +++ b/php/prompt-chatgpt/README.md @@ -1,6 +1,6 @@ # 🤖 PHP Prompt ChatGPT Function -Ask question, and let OpenAI GPT-3.5-turbo answer. +Ask question, and let OpenAI GPT-5.6-terra answer. ## 🧰 Usage @@ -76,7 +76,7 @@ A unique key used to authenticate with the OpenAI API. Please note that this is ### OPENAI_MAX_TOKENS -The maximum number of tokens that the OpenAI response should contain. Be aware that OpenAI models read and write a maximum number of tokens per API call, which varies depending on the model. For GPT-3.5-turbo, the limit is 4096 tokens. +The maximum number of tokens that the OpenAI response should contain. Be aware that OpenAI models read and write a maximum number of tokens per API call, which varies depending on the model. | Question | Answer | | ------------- | ------------------------------------------------------------------------------------------------------------- | diff --git a/php/prompt-chatgpt/src/index.php b/php/prompt-chatgpt/src/index.php index a930c3b4..3a6bbe40 100644 --- a/php/prompt-chatgpt/src/index.php +++ b/php/prompt-chatgpt/src/index.php @@ -22,8 +22,8 @@ try { $response = $openai->chat()->create([ - 'model' => 'gpt-3.5-turbo', - 'max_tokens' => $_ENV['MAX_TOKENS'] ?: 150, + 'model' => 'gpt-5.6-terra', + 'max_completion_tokens' => $_ENV['MAX_TOKENS'] ?: 150, 'messages' => [ ['role' => 'user', 'content' => $context->req->bodyJson['prompt']] ], diff --git a/python/prompt_chatgpt/README.md b/python/prompt_chatgpt/README.md index 96c987a1..33eb8423 100644 --- a/python/prompt_chatgpt/README.md +++ b/python/prompt_chatgpt/README.md @@ -1,6 +1,6 @@ # 🤖 Python Prompt ChatGPT Function -Ask question, and let OpenAI GPT-3.5-turbo answer. +Ask question, and let OpenAI GPT-5.6-terra answer. ## 🧰 Usage @@ -76,7 +76,7 @@ A unique key used to authenticate with the OpenAI API. Please note that this is ### OPENAI_MAX_TOKENS -The maximum number of tokens that the OpenAI response should contain. Be aware that OpenAI models read and write a maximum number of tokens per API call, which varies depending on the model. For GPT-3.5-turbo, the limit is 4096 tokens. +The maximum number of tokens that the OpenAI response should contain. Be aware that OpenAI models read and write a maximum number of tokens per API call, which varies depending on the model. | Question | Answer | | ------------- | ------------------------------------------------------------------------------------------------------------- | diff --git a/python/prompt_chatgpt/src/main.py b/python/prompt_chatgpt/src/main.py index 3cb15e2f..1b1f95f3 100644 --- a/python/prompt_chatgpt/src/main.py +++ b/python/prompt_chatgpt/src/main.py @@ -24,8 +24,8 @@ def main(context): try: response = openai.ChatCompletion.create( - model="gpt-3.5-turbo", - max_tokens=int(os.environ.get("OPENAI_MAX_TOKENS", "512")), + model="gpt-5.6-terra", + max_completion_tokens=int(os.environ.get("OPENAI_MAX_TOKENS", "512")), messages=[{"role": "user", "content": context.req.body["prompt"]}], ) completion = response.choices[0].message.content From 80ff947032e7dcd33c694051e1366a9d94a1880f Mon Sep 17 00:00:00 2001 From: Alex Date: Sun, 29 Nov 2026 10:21:11 -0400 Subject: [PATCH 2/3] fix(prompt-chatgpt): align PHP completion token budget --- node/prompt-chatgpt/README.md | 2 +- php/prompt-chatgpt/README.md | 2 +- php/prompt-chatgpt/src/index.php | 2 +- python/prompt_chatgpt/README.md | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/node/prompt-chatgpt/README.md b/node/prompt-chatgpt/README.md index 4b9090b0..ed22b4c0 100644 --- a/node/prompt-chatgpt/README.md +++ b/node/prompt-chatgpt/README.md @@ -76,7 +76,7 @@ A unique key used to authenticate with the OpenAI API. Please note that this is ### OPENAI_MAX_TOKENS -The maximum number of tokens that the OpenAI response should contain. Be aware that OpenAI models read and write a maximum number of tokens per API call, which varies depending on the model. +The maximum number of tokens that the OpenAI response should contain. Be aware that OpenAI models read and write a maximum number of tokens per API call, which varies depending on the model. With GPT-5.x models, this limit includes reasoning tokens. | Question | Answer | | ------------- | ------------------------------------------------------------------------------------------------------------- | diff --git a/php/prompt-chatgpt/README.md b/php/prompt-chatgpt/README.md index b046e526..11ab6cbc 100644 --- a/php/prompt-chatgpt/README.md +++ b/php/prompt-chatgpt/README.md @@ -76,7 +76,7 @@ A unique key used to authenticate with the OpenAI API. Please note that this is ### OPENAI_MAX_TOKENS -The maximum number of tokens that the OpenAI response should contain. Be aware that OpenAI models read and write a maximum number of tokens per API call, which varies depending on the model. +The maximum number of tokens that the OpenAI response should contain. Be aware that OpenAI models read and write a maximum number of tokens per API call, which varies depending on the model. With GPT-5.x models, this limit includes reasoning tokens. | Question | Answer | | ------------- | ------------------------------------------------------------------------------------------------------------- | diff --git a/php/prompt-chatgpt/src/index.php b/php/prompt-chatgpt/src/index.php index 3a6bbe40..309cf713 100644 --- a/php/prompt-chatgpt/src/index.php +++ b/php/prompt-chatgpt/src/index.php @@ -23,7 +23,7 @@ try { $response = $openai->chat()->create([ 'model' => 'gpt-5.6-terra', - 'max_completion_tokens' => $_ENV['MAX_TOKENS'] ?: 150, + 'max_completion_tokens' => ($_ENV['OPENAI_MAX_TOKENS'] ?? $_ENV['MAX_TOKENS'] ?? null) ?: 512, 'messages' => [ ['role' => 'user', 'content' => $context->req->bodyJson['prompt']] ], diff --git a/python/prompt_chatgpt/README.md b/python/prompt_chatgpt/README.md index 33eb8423..a78160a0 100644 --- a/python/prompt_chatgpt/README.md +++ b/python/prompt_chatgpt/README.md @@ -76,7 +76,7 @@ A unique key used to authenticate with the OpenAI API. Please note that this is ### OPENAI_MAX_TOKENS -The maximum number of tokens that the OpenAI response should contain. Be aware that OpenAI models read and write a maximum number of tokens per API call, which varies depending on the model. +The maximum number of tokens that the OpenAI response should contain. Be aware that OpenAI models read and write a maximum number of tokens per API call, which varies depending on the model. With GPT-5.x models, this limit includes reasoning tokens. | Question | Answer | | ------------- | ------------------------------------------------------------------------------------------------------------- | From 65283518a1b25a675f644279687b6ab4d8a77dab Mon Sep 17 00:00:00 2001 From: Alex Date: Sun, 29 Nov 2026 10:39:51 -0400 Subject: [PATCH 3/3] fix(prompt-chatgpt): parse PHP completion token budget as integer --- php/prompt-chatgpt/src/index.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/php/prompt-chatgpt/src/index.php b/php/prompt-chatgpt/src/index.php index 309cf713..8d33b25e 100644 --- a/php/prompt-chatgpt/src/index.php +++ b/php/prompt-chatgpt/src/index.php @@ -23,7 +23,7 @@ try { $response = $openai->chat()->create([ 'model' => 'gpt-5.6-terra', - 'max_completion_tokens' => ($_ENV['OPENAI_MAX_TOKENS'] ?? $_ENV['MAX_TOKENS'] ?? null) ?: 512, + 'max_completion_tokens' => (int) ($_ENV['OPENAI_MAX_TOKENS'] ?? $_ENV['MAX_TOKENS'] ?? 0) ?: 512, 'messages' => [ ['role' => 'user', 'content' => $context->req->bodyJson['prompt']] ],