Skip to content
Docs

SDKs

Both SDKs share one design:

LanguagePackageSource
Node.js / TypeScript (>= 18)@oryvox/sdksdks/node
Python (>= 3.9)oryvoxsdks/python

Both SDKs share one design:

Node.jsPython
Clientnew Oryvox({ apiKey, baseURL, maxRetries, timeout, defaultHeaders })Oryvox(api_key=, base_url=, max_retries=, timeout=, default_headers=), AsyncOryvox(...)
Env varsORYVOX_API_KEY, ORYVOX_BASE_URLsame
Responsesclient.responses.create(), client.responses.stream()client.responses.create(), with client.responses.stream() as s:
Chatclient.chat.completions.create()client.chat.completions.create()
Modelsclient.models.list()client.models.list()
Embeddingsclient.embeddings.create()client.embeddings.create()
Request logfor await (const r of client.requests.list({ limit: 50, workflow_id })), client.requests.retrieve(id)for r in client.requests.list(limit=50, workflow_id=...):, client.requests.retrieve(id)
Feedbackclient.requests.feedback(id, { rating: 5 })client.requests.feedback(id, rating=5)
Metricsclient.metrics.retrieve({ period: '24h' })client.metrics.retrieve(period="24h")
Cacheclient.cache.invalidate({ tags: [...] }) / ({ all: true })client.cache.invalidate(tags=[...]) / (all=True)
WebhooksOryvox.webhooks.verify(payload, header, secret)Oryvox.webhooks.verify(payload, header, secret)
Test modeclient.isTestModeclient.is_test_mode
Request idresult._requestIdresult._request_id
Idempotent replayresult.idempotentReplayedresult.idempotent_replayed

Defaults

  • Base URL https://api.oryvox.ai/v1
  • Timeout 60 seconds (Node: per attempt, whole body for normal calls and until the headers for streams; Python: per network operation)
  • 2 retries

Per-call options

await client.responses.create(params, { idempotencyKey: 'order-42', timeout: 10_000, maxRetries: 0, headers: {}, signal });
client.responses.create(model="oryvox-auto", input="Hi", idempotency_key="order-42", timeout=10, max_retries=0, extra_headers={})

ORYVOX request headers have their own options:

HeaderNode optionPython keyword
X-Oryvox-SessionsessionIdsession_id=
X-Oryvox-Trace-IdtraceIdtrace_id=
X-Oryvox-Parent-SpanparentSpanIdparent_span_id=
X-Oryvox-Cache: offcacheOff: truecache_off=True
X-Oryvox-Cache-ScopecacheScopecache_scope=

Retries

The SDKs retry only:

  • connection errors and timeouts,
  • HTTP 409, 429, 500, 502, 503 and 504, except a 409 with code ORYX_4092 (the key's request already ran and its result was not kept: retrying cannot help).

They never retry 400, 401, 402, 403, 404 or 422. Delays are exponential with jitter (0.5 s, 1 s, 2 s, 4 s, capped at 8 s, each shortened by up to 25%). When the response has a Retry-After header (seconds or HTTP date, up to 60 s) that value is used instead. The API sends Retry-After on its own rate limits; provider 429s passed through use backoff.

Every POST gets one Idempotency-Key (auto-generated unless you pass one) that is reused for all of its retries, so a retried request is never billed twice. Streams are only retried before the first byte arrives; a stream that breaks midway raises an error.

Errors

Both SDKs map API errors to typed classes; see Errors. Every error carries status, type, code and the request id. insufficient_credits raises InsufficientCreditsError, a subclass of BudgetExceededError.

Streaming

/responses streams yield typed events (response.created, response.output_text.delta, response.completed) and offer finalResponse() / finalText() (Node) or get_final_response() / get_final_text() (Python). Chat streams yield chat.completion.chunk objects and expose the oryvox summary as stream.summary. See Streaming.

Other languages

Any OpenAI-compatible SDK works with base_url=https://api.oryvox.ai/v1 and an ory_ key. ORYVOX extensions (routing, max_cost, optimization, metadata, tags, cache, oryvox) go in the request body (for example extra_body in the OpenAI Python SDK).

SDK versions: @oryvox/sdk 1.1.0 and oryvox 1.1.0 support everything in API 2026-10-04.

Was this page helpful?