Skip to main content
The Figranium and AsyncFigranium classes accept keyword-only constructor arguments. Every option is optional, and the SDK falls back to sensible defaults so a local install works with Figranium(api_key="...").

Constructor options

str
Absolute URL of your Figranium server. Must use http or https. Trailing slashes are trimmed. Defaults to "http://localhost:11345".
Optional[str]
API key sent as Authorization: Bearer <key> by default. Create keys from the Figranium web UI.
str
Header name for the API key. Either "authorization" (default) or "x-api-key".
float
Client-wide default timeout for non-stream requests, in seconds. Defaults to 30.0. Streams have no default timeout.
Optional[httpx.Client]
A preconfigured httpx.Client (or httpx.AsyncClient for AsyncFigranium). Useful for tracing, retries, proxies, or test doubles. The SDK does not close a caller-supplied client.
Optional[Mapping[str, str]]
Default headers merged into every request. Per-call headers override these.

Option details

base_url

filename.py

api_key and api_key_header

Pass api_key to authenticate every request with an API key. By default the key is sent as Authorization: Bearer <key>. Set api_key_header="x-api-key" if your deployment expects that header.
filename.py
See Authentication for how to create and manage API keys.

timeout

Client-wide default timeout for non-stream requests, in seconds. Defaults to 30.0. Streams have no default timeout; set a per-call timeout if you want a terminal deadline.
filename.py
Individual requests can override this per call with options={"timeout": 5.0}. See Request options.

http_client

Provide a preconfigured httpx.Client (or httpx.AsyncClient for AsyncFigranium). Useful for tracing, retries, proxies, or test doubles. The SDK does not close a caller-supplied client.
filename.py

headers

Default headers merged into every request. Per-call headers override these.
filename.py

Complete example

filename.py

Client lifecycle

Use the client as a context manager so it closes automatically, or call .close() explicitly.
filename.py
For async code, use async with:
filename.py

Client resources

The Figranium instance exposes one property per resource, plus a few top-level convenience helpers. Top-level shortcuts:
  • client.run_task(id, input?) proxies to tasks.run.
  • client.scrape(input) proxies to execution.scrape.
  • client.agent(input) proxies to execution.agent.
  • client.headful(input) proxies to execution.headful.