# GPT-4 API to slow when you have to work with a 46 second time out

**URL:** <https://community.openai.com/t/gpt-4-api-to-slow-when-you-have-to-work-with-a-46-second-time-out/182144>\
**Category:** API\
**Created:** [April 28, 2023, 5:35am UTC](https://community.openai.com/t/gpt-4-api-to-slow-when-you-have-to-work-with-a-46-second-time-out/182144 "2023-04-28T05:35:43Z")\
**Posts on this page:** 13\
**Page:** 1

<div class="post-metadata">

**Author:** ![paul.armstrong](https://sea2.discourse-cdn.com/openai1/user_avatar/community.openai.com/paul.armstrong/32/15511_2.png) [@paul.armstrong](https://community.openai.com/u/paul.armstrong)\
**Post date:** [April 28, 2023, 5:35am UTC](https://community.openai.com/t/gpt-4-api-to-slow-when-you-have-to-work-with-a-46-second-time-out/182144/1 "2023-04-28T05:35:43Z")

</div>

Hi  
I have been a member and contributor to the community for a while now. Enough to earn some electronic tokens which reward my good behavior and contributions.

I am explaining this because I have also seen many posts about the performance of the API, or lack of performance. And I am not sure if they make any difference as I don’t see any replies.

But because I am a good community citizen I will do as told by the email I got today telling me I had access to GPT-4 via the api— “As an early customer we’d love to hear about your experience. Feel free to share feedback on our community forum.”

\*\* My feedback is that via the API GPT-4 is considerably slower than gpt3-turbo. And GPT-4 via the Chat GPT website. \*\*

Speed by itself is actually not that important to me. But we are making use of the API via Google’s Workspace Add-on architecture. Giving the user ease of use between their Google Document and the API. And any request that takes more than 45 seconds is terminated. Most of our requests that used to work are now failing with this time limit.

\*I know it can respond fast as [chat.openai.com](http://chat.openai.com) does. And I don’t in principle have an issue with a rate limit. But as it stands, GPT-4 is close to unusable for us. \*

I say ‘close’ as there are asynchronous solutions to overcome the 30-second timeout (which is enforced at 45 seconds.). But they do alter the functionality and are not trivial.

There! Another good community badge was earned for giving feedback, as requested.

Seriously, otherwise, I love it. It is already making a difference to our business. I’d just like it to do more.

😊

---

<div class="post-metadata">

**Author:** ![paul.armstrong](https://sea2.discourse-cdn.com/openai1/user_avatar/community.openai.com/paul.armstrong/32/15511_2.png) [@paul.armstrong](https://community.openai.com/u/paul.armstrong)\
**Post date:** [April 28, 2023, 5:39am UTC](https://community.openai.com/t/gpt-4-api-to-slow-when-you-have-to-work-with-a-46-second-time-out/182144/2 "2023-04-28T05:39:16Z")

</div>

If it helps, I would trade requests per hour for speed. We do not use the API a lot relative, I am sure, to other use cases. But when we do it needs to be fast as I have explained.

---

<div class="post-metadata">

**Author:** ![jochenschultz](https://sea2.discourse-cdn.com/openai1/user_avatar/community.openai.com/jochenschultz/32/491030_2.png) [@jochenschultz](https://community.openai.com/u/jochenschultz)\
**Post date:** [April 28, 2023, 8:16am UTC](https://community.openai.com/t/gpt-4-api-to-slow-when-you-have-to-work-with-a-46-second-time-out/182144/3 "2023-04-28T08:16:22Z")

</div>

Maybe using websockets might help? I mean with a proxy server where you can control timeouts?

---

<div class="post-metadata">

**Author:** ![sam.saffron](https://sea2.discourse-cdn.com/openai1/user_avatar/community.openai.com/sam.saffron/32/31387_2.png) [@sam.saffron](https://community.openai.com/u/sam.saffron)\
**Post date:** [April 28, 2023, 10:22am UTC](https://community.openai.com/t/gpt-4-api-to-slow-when-you-have-to-work-with-a-46-second-time-out/182144/4 "2023-04-28T10:22:58Z")

</div>

You really have to stream to get the “right” experience

When I stream results start coming back almost right away

I wonder if proxying a stream is a way for you to work around google limitations

---

<div class="post-metadata">

**Author:** ![paul.armstrong](https://sea2.discourse-cdn.com/openai1/user_avatar/community.openai.com/paul.armstrong/32/15511_2.png) [@paul.armstrong](https://community.openai.com/u/paul.armstrong)\
**Post date:** [May 2, 2023, 10:01am UTC](https://community.openai.com/t/gpt-4-api-to-slow-when-you-have-to-work-with-a-46-second-time-out/182144/5 "2023-05-02T10:01:37Z")

</div>

Thank you for all your suggestions.

The problem with Google app script is that it’s a bit of a walled garden. It restricts a number of things including threading and any asynchronous processing. Plus add-ons have a 30-second processing limit.

Technically there are many solutions. But I’m attempting to keep the existing investment in app script and not rewrite the code.

That said, I do think I have found s solution that will require minimal changes and keep our app script investment intact.

If anyone is interested I’ll explain how once I’m done proving it.

Thank you 🙏

---

<div class="post-metadata">

**Author:** ![manyapps](https://sea2.discourse-cdn.com/openai1/user_avatar/community.openai.com/manyapps/32/8882_2.png) [@manyapps](https://community.openai.com/u/manyapps)\
**Post date:** [June 1, 2023, 8:44pm UTC](https://community.openai.com/t/gpt-4-api-to-slow-when-you-have-to-work-with-a-46-second-time-out/182144/6 "2023-06-01T20:44:14Z")

</div>

Hi Paul, did you work it out yet or are you still testing your solution?

---

<div class="post-metadata">

**Author:** ![paul.armstrong](https://sea2.discourse-cdn.com/openai1/user_avatar/community.openai.com/paul.armstrong/32/15511_2.png) [@paul.armstrong](https://community.openai.com/u/paul.armstrong)\
**Post date:** [June 2, 2023, 5:24am UTC](https://community.openai.com/t/gpt-4-api-to-slow-when-you-have-to-work-with-a-46-second-time-out/182144/7 "2023-06-02T05:24:47Z")

</div>

The completed project involves an application that functions as a Google Workspace Add-On, built utilizing Google App Script. The application interacts with a Google Document and sends text requests from the document to the Open AI chat/completions API, followed by updating the document with the received results.

The primary challenges of this project come from the inherent restrictions of Google App Scripts Workspace Add-Ons, which are:

1. An Add-On is only allowed to run for a maximum duration of 30 seconds (though in practice, there is some leniency, extending up to 45 seconds) before it gets terminated.
2. Asynchronous processing or threading cannot be implemented.
3. Our extensive existing investment in App Script prompts us to build the solution within its ecosystem, rather than branching out.

To resolve these issues, the following sequence of operations is implemented:

1. The Google Add-On publishes a message to a Google Pub/Sub queue.
2. A Google Cloud Function (coded in Node.js) dequeues this message.
3. The Cloud Function then calls the same Google Add-On using its WebApp doPost() interface, in a RESTful manner.
4. Consequently, the original App Script code that couldn’t be executed earlier (due to the 30-second constraint) can now be processed.

To facilitate this operation, a unique piece of text, timestamped, is inserted into the document before queuing the message. Once the response is generated, this unique text is located and replaced in the Google Document with the API response.

There were some other challenges within this to overcome (eg, OAuth requirements) , but now I have a useful mechanism for other challenges that we had. For example, I ca now cache information with async processing which speeds up the users experience.

---

<div class="post-metadata">

**Author:** ![bill.french](https://sea2.discourse-cdn.com/openai1/user_avatar/community.openai.com/bill.french/32/15015_2.png) [@bill.french](https://community.openai.com/u/bill.french)\
**Post date:** [June 7, 2023, 1:02pm UTC](https://community.openai.com/t/gpt-4-api-to-slow-when-you-have-to-work-with-a-46-second-time-out/182144/8 "2023-06-07T13:02:36Z")

</div>

> [@paul.armstrong](#):
>
> The completed project involves an application that functions as a Google Workspace Add-On, built utilizing Google App Script.

Curious if you’ve considered building this add-in with PaLM 2. I have created some sidebar apps using Google Apps Script and PaLM that are extremely quick (sub-2500ms) in many cases.

---

<div class="post-metadata">

**Author:** ![paul.armstrong](https://sea2.discourse-cdn.com/openai1/user_avatar/community.openai.com/paul.armstrong/32/15511_2.png) [@paul.armstrong](https://community.openai.com/u/paul.armstrong)\
**Post date:** [June 9, 2023, 11:07pm UTC](https://community.openai.com/t/gpt-4-api-to-slow-when-you-have-to-work-with-a-46-second-time-out/182144/9 "2023-06-09T23:07:59Z")

</div>

I have been following from a distance Google AI roll-outs. And hope to integrate them eventually. Indeed I predict that some of the features I have created with our Add On will be superseded by new Workspace feature.

---

<div class="post-metadata">

**Author:** ![BrianLovesAI](https://sea2.discourse-cdn.com/openai1/user_avatar/community.openai.com/brianlovesai/32/145226_2.png) [@BrianLovesAI](https://community.openai.com/u/BrianLovesAI)\
**Post date:** [June 10, 2023, 12:05am UTC](https://community.openai.com/t/gpt-4-api-to-slow-when-you-have-to-work-with-a-46-second-time-out/182144/10 "2023-06-10T00:05:03Z")

</div>

I believe this issue is not actually the fault of GPT-4, OpenAI, or Google.

Some APIs, cloud back-ends or back-end environments limit the time to the fixed amounts of the time (we cannot control). So, it was painful when I was facing similar “timeout” issue that you are experiencing now, but not happening from local.

Because some services strongly limit the time (for me, maximum 10 seconds and that made my gpt-3.5-turbo paid edition is started to timeout (because it sometimes took more than 10 seconds), unfortunately, we cannot do anything from this moment.

In my case, our team decided to use our back-end server (On-Premises) to handle all processes, so we moved, we are using gpt-4 now.

Occasionally, the response time exceeds 60 seconds, but the process does not terminate automatically. Furthermore, our team has taken full responsibility for managing the back-end server (This is very good). Consequently, the overall performance has improved significantly.

---

<div class="post-metadata">

**Author:** ![TheWarOnEntropy](https://sea2.discourse-cdn.com/openai1/user_avatar/community.openai.com/thewaronentropy/32/33911_2.png) [@TheWarOnEntropy](https://community.openai.com/u/TheWarOnEntropy)\
**Post date:** [July 30, 2023, 8:35am UTC](https://community.openai.com/t/gpt-4-api-to-slow-when-you-have-to-work-with-a-46-second-time-out/182144/11 "2023-07-30T08:35:10Z")

</div>

I would like to know any solution you have found for speed. The responses I get are always excruciatingly slow.

I have nearly finished an app that would be very marketable if GPT4 answered as quickly as ChatGPT, but instead the wait is so slow most users will not be prepared to wait.

---

<div class="post-metadata">

**Author:** ![\_j](https://sea2.discourse-cdn.com/openai1/user_avatar/community.openai.com/_j/32/766292_2.png) [@\_j](https://community.openai.com/u/_j)\
**Post date:** [July 30, 2023, 8:47am UTC](https://community.openai.com/t/gpt-4-api-to-slow-when-you-have-to-work-with-a-46-second-time-out/182144/12 "2023-07-30T08:47:45Z")

</div>

The only OpenAI solution to language token generation speed is to move the customer-facing AI to gpt-3.5-turbo.

You can see the recent improvement in completion time of 250 tokens of GPT-4 (top blue) that corresponds almost exactly with the load reduction of “GPT-4 no longer making long outputs” complaints.

![image](https://us1.discourse-cdn.com/openai1/original/3X/b/1/b1472680c78cf3b96edcfc4dfdc2c6563f882234.jpeg)

---

<div class="post-metadata">

**Author:** ![curt.kennedy](https://sea2.discourse-cdn.com/openai1/user_avatar/community.openai.com/curt.kennedy/32/709249_2.png) [@curt.kennedy](https://community.openai.com/u/curt.kennedy)\
**Post date:** [December 29, 2025, 4:25am UTC](https://community.openai.com/t/gpt-4-api-to-slow-when-you-have-to-work-with-a-46-second-time-out/182144/13 "2025-12-29T04:25:03Z")

</div>


