HTTP Fetch Timeouts

HTTP fetch timeouts

Canonical page: https://docs.seda.xyz/home/for-agents/modules/12-http-fetch-timeouts Source file: modules/12-http-fetch-timeouts.md (label only, do not fetch)

Authoritative reference:

This page exists to prevent flaky Oracle Programs caused by slow upstream APIs.


Default values (do not assume otherwise)

  • Per-request timeout: 2,000ms

  • Global timeout budget across all HTTP requests: 20,000ms

Meaning:

  • Each individual HTTP request defaults to failing after ~2 seconds.

  • Across the entire Oracle Program execution, all HTTP requests share a combined maximum budget of ~20 seconds.


Why this matters

If your upstream frequently takes longer than 2 seconds, requests will fail unless you explicitly set a per-request timeout.

However, increasing timeouts too much can cause you to hit the global 20s budget if you make multiple requests.


How to set a per-request timeout (Rust)

Copy/paste example:

When to increase timeout

Increase timeout_ms when the upstream is expected to be slower, for example:

  • AI/ML services (often 3–5 seconds)

  • heavy data processing APIs

  • slow but reliable providers


Agent action (do this every time you add an HTTP call)

Action checklist:

  1. Estimate upstream p95 latency (rough guess is fine).

  2. Set timeout_ms slightly above that p95 (e.g., p95=2.4s → timeout=3.0s).

  3. Count how many HTTP calls the Oracle Program makes in one execution.

  4. Ensure the total worst-case time across calls stays within the 20,000ms global budget.

Checkpoint:

  • You can state the chosen timeout_ms and why.

  • You can justify that the number of HTTP calls will not exceed the global 20s budget.

Authoritative references:

- Operating and Running a Data Proxy: https://docs.seda.xyz/home/for-data-providers/operating-a-data-proxy/operating-and-running-a-data-proxyarrow-up-right

- Data Proxy overview: https://docs.seda.xyz/home/for-data-providers/operating-a-data-proxy/introduction-to-data-proxyarrow-up-right

- Enabling SEDA Fast on a Data Proxy: https://docs.seda.xyz/home/for-data-providers/operating-a-data-proxy/enabling-seda-fast-on-a-data-proxyarrow-up-right

- Advanced: API-key Gated Data (proxyHttpFetch): https://docs.seda.xyz/home/for-data-providers/operating-a-data-proxy/advanced-api-key-gated-dataarrow-up-right

- System requirements: https://docs.seda.xyz/home/for-data-providers/operating-a-data-proxy/system-requirementsarrow-up-right

- Scaling up: https://docs.seda.xyz/home/for-data-providers/operating-a-data-proxy/scaling-uparrow-up-right

- Debugging: https://docs.seda.xyz/home/for-data-providers/operating-a-data-proxy/debuggingarrow-up-right

Last updated

Was this helpful?