HTTP Fetch Timeouts
Last updated
Was this helpful?
Canonical page: https://docs.seda.xyz/home/for-agents/modules/12-http-fetch-timeouts
Authoritative reference:
This page exists to prevent flaky Oracle Programs caused by slow upstream APIs.
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.
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.
Copy/paste example:
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
Action checklist:
Estimate upstream p95 latency (rough guess is fine).
Set timeout_ms slightly above that p95 (e.g., p95=2.4s → timeout=3.0s).
Count how many HTTP calls the Oracle Program makes in one execution.
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.
- Operating and Running a Data Proxy: https://docs.seda.xyz/home/for-data-providers/operating-a-data-proxy/operating-and-running-a-data-proxy
- Data Proxy overview: https://docs.seda.xyz/home/for-data-providers/operating-a-data-proxy/introduction-to-data-proxy
- 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-proxy
- Advanced: API-key Gated Data (proxyHttpFetch): https://docs.seda.xyz/home/for-data-providers/operating-a-data-proxy/advanced-api-key-gated-data
- System requirements: https://docs.seda.xyz/home/for-data-providers/operating-a-data-proxy/system-requirements
Last updated
Was this helpful?
Was this helpful?
use seda_sdk_rs::{http::http_fetch, HttpFetchOptions};
let response = http_fetch(
"https://httpbin.org/get",
Some(HttpFetchOptions {
timeout_ms: Some(3_000), // 3 seconds timeout
..Default::default()
})
);