Github
Our SDKs are available on Github:Node.js
Python
Packages
- Python:
orq-ai-sdkon PyPI - Node.js:
@orq-ai/nodeon npm
Installation
Usage
To get your workspace API Keys, see API Keys.
https://my.orq.ai. Self-hosted and on-premise deployments serve the API under their own hostname, which has to be passed explicitly as server_url or serverURL. See Base URLs.
Timeouts and retries
Both SDKs time out after 10 minutes (600000 ms). Node.js applies it to the whole request; Python applies it per read. Raise it before a long stream (the AI Router allows 30 minutes) or an agent run (the AI Gateway allows 12; see Request timeouts), as the sample below does.backoff both SDKs retry 429, 500, 502, 503 and 504: start at 500 ms, cap a wait at 60 seconds, multiply by 1.5 per attempt and give up after an hour, which are the four BackoffStrategy arguments in order. Node.js adds up to a second of jitter to every wait; Python adds jitter only when jitter_ms is set. A Retry-After or retry-after-ms header replaces the wait for that attempt in both SDKs.
The AI Gateway retries model calls inside a request as well. A request with no retry configuration gets up to two retries on 408, 429, 500, 502, 503, 504 and 529; see Fallbacks and retries.
Writes are retried too, and there is no idempotency key, so a retried create response or run agent can bill twice. Setting the SDK strategy to none stops the retries the client makes; the AI Gateway retries are configured separately.