Can webhooks be used for chat completions requests to o3?

Can webhooks be used for chat completions requests to o3?

Some of them are very complex and take too long. It would be useful to run them on background and be notified when the the response is ready.

Yes, they recently introduced webhooks… here is the documentation about it:
https://platform.openai.com/docs/guides/webhooks#page-top

I recommend you follow the X account of OpenAI developers, they annonunce all the updates to the API @OpenAIDevs

1 Like

For the time being and AFAIK, webhooks do not support chat completions API.

Also, chat completions do not support background mode.

You can check here, the events supported by webhooks (basically responses, batch, finetune and evals).

I believe @aprendendo.next is right that I don’t think background mode is supported with chat completions (:cry: )

However, you might look at batches:

https://platform.openai.com/docs/guides/webhooks

https://platform.openai.com/docs/guides/batch#1-prepare-your-batch-file

So yes @pachocastillosr, you should absolutely be able to use Chat Completions in a batch and utilise webhooks to find out when those have been completed.

3 Likes

Nice @merefield , batch is indeed an alternative to use completions. Thanks for pointing that.

1 Like

Thanks for pointing that out!

Using batches in combination with webhooks is indeed a good idea @merefield!

Couple of things to note are that batches can take up to 24 hours to return the response. Unless there’s a specific reason you wish to use the Chat Completions API, the Responses API might just be more flexible for your use case @pachocastillosr. It supports Background mode natively, and you can also stream background responses. Furthermore, if you ever wish to upgrade to the deep research models, you will have to use to Responses API, as Chat Completions is not supported for these models.

4 Likes

Indeed. But also worth remembering you get a 50% discount on batches in recompense.

A 24:hour delay on a single call is quite a delay though!

It would be good if there was some financial incentive to use background mode.

Using Responses leads you into a proprietary corner but if using webhooks you are going there anyway …

1 Like

Completely agree @merefield. I think Flex processing can also be utilized here, as it is available for o3 and o4-mini models currently, and the sweet 50% discount is offered here as well. The API usage seems to be more simple than Batch processing (as batch files don’t need to be created, uploaded, monitored, etc.) as well. Integrating flex processing in exisiting workflows might be relatively straightfoward, and can be used with Chat Completions as well.

1 Like

Oh nice find!

That would be awesome if we could use that on the other models too!!

1 Like