Skip to main content
The Python SDK is the v2 API with the retries, the pagination, the SSE reconnection and the id encoding already written. Python 3.11 or newer.
SploxClient(api_key=None, *, base_url=None, timeout=300.0). base_url is the server API root — https://splox.io/api by default — and every path is appended to it already versioned, so nothing is rewritten behind your back.

The first call

The resources are client.runs, client.interactions, client.harnesses, client.harness_versions, client.llm_endpoints, client.tool_servers, client.evaluations, plus client.mcp for the MCP catalog.

Reading a run

message.text joins the text parts, which is why the two middle lines are empty: that turn was a tool call and its result, and both live in message.content as json parts. usage.amount is a decimal string, never a float. A Run is a handle as well as a snapshot — run.wait(), run.cancel(), run.events(), run.messages(), run.outputs(), run.tree(), run.usage(), run.pending_interactions(), run.refresh() — and the same operations exist on client.runs taking a run id.

Creating a run

input takes a plain string, a full {"role": "user", "content": [...]} dict, or a list of content parts.
runs.create in 0.5.4 does not send machine_id, which the API now requires, so it raises SploxValidationError — a 422 whose .errors names /machine_id as required. Until the SDK ships the field, create runs over HTTP — see Runs — and use the SDK for everything after that.

Streaming

The iterator reconnects with Last-Event-ID, drops events it has already yielded, and stops after the terminal run.status_changed. For the durable journal instead of a live stream:

Paging

Every list returns a page with .data and .page:

The async client

Every resource has an async twin with the same shape:
AsyncSploxClient.harnesses and .harness_versions mirror the sync ones. splox.evals is deliberately synchronous.

Errors

Retries: GETs are retried up to three times with exponential backoff on connection errors, 429 and 5xx. POSTs are retried only when they carry an Idempotency-Key — always the same one — so a replay returns the original answer instead of doing the work twice.

Ids

Harness ids may be passed as raw UUIDs; the SDK encodes them for you.

Harnesses and evaluations

splox.evals grades a harness with ordinary Python — run_cases(), a Scorer(score_fn=...), and judge() for LLM grading — and records the result as a server-side evaluation.
The SDK’s client.mcp, client.chats, client.memory and client.billing surfaces speak the v1 API and are unchanged by the v2 work.