---
title: "fswa_ai_http_timeout — Filter Hook"
description: "Sets the HTTP timeout in seconds for calls to AI providers."
url: "https://wpwebhooks.org/docs/fswa-ai-http-timeout/"
---

[WP Webhooks](https://wpwebhooks.org/) / [Docs](https://wpwebhooks.org/docs/) / fswa\_ai\_http\_timeout

Filter since v2.1.1

# fswa\_ai\_http\_timeout

Sets the HTTP timeout in seconds for calls to AI providers.

/ Signature

```
apply_filters( 'fswa_ai_http_timeout', $seconds )
```

/ When it fires

Fires each time Build with AI or an AI-drafted notification message makes an HTTP request to an AI provider or to the hosted AI service. The filter is not told which call it is, so returning a fixed number also changes the short trial requests — scale the incoming default if you only want longer model calls.

/ Parameters

| Name | In | Type | Req | Description |
| --- | --- | --- | --- | --- |
| $seconds | param | int | yes | Timeout in seconds. The default depends on the call: \`120\` for model requests through your own Google, OpenAI or Anthropic key and the hosted trial, \`150\` for Pro's hosted AI, and \`15\` / \`30\` for the short trial-status and credit-grant requests. |

/ Returns

`int` Timeout in seconds.

/ Examples

Give slow models more time

```
add_filter( 'fswa_ai_http_timeout', function ( $seconds ) {
    return $seconds >= 120 ? 240 : $seconds; // only lengthen the model calls
} );
```

/ Related

[Build with AI](https://wpwebhooks.org/docs/build-with-ai/)[fswa\_ai\_transport](https://wpwebhooks.org/docs/fswa-ai-transport/)[fswa\_http\_timeout](https://wpwebhooks.org/docs/fswa-http-timeout/)

/Ready

## Your next automation is  
one sentence away.

[Try the Live Preview](https://playground.wordpress.net/?blueprint-url=https://wpwebhooks.org/blueprint.json) [See the Plugin →](https://wpwebhooks.org/wordpress-webhook-plugin/)

$ wp plugin install flowsystems-webhook-actions --activate

## Structured data

```json
{"@context":"https://schema.org","@type":"TechArticle","name":"fswa_ai_http_timeout — Filter Hook — Webhook Actions Docs","description":"Sets the HTTP timeout in seconds for calls to AI providers.","url":"https://wpwebhooks.org/docs/fswa-ai-http-timeout/","isPartOf":{"@type":"WebSite","name":"WP Webhooks","url":"https://wpwebhooks.org"},"about":{"@type":"SoftwareApplication","name":"Webhook Actions","applicationCategory":"WordPress Plugin"}}
```
