Skip to main content
Splox provides official SDKs so you can integrate workflows, chats, and billing into your applications without hand-rolling HTTP requests.

Quick Start

from splox import SploxClient

client = SploxClient(api_key="YOUR_API_KEY")

# List workflows
workflows = client.workflows.list()
for wf in workflows.workflows:
    print(wf.id, wf.latest_version.name)

# Create a chat and run a workflow
chat = client.chats.create(name="My Session", resource_id=wf.id)
version = client.workflows.get_latest_version(wf.id)
start_nodes = client.workflows.get_start_nodes(version.id)

result = client.workflows.run(
    workflow_version_id=version.id,
    chat_id=chat.id,
    start_node_id=start_nodes.nodes[0].id,
    query="Hello, world!",
)

# Stream real-time updates
for event in client.workflows.listen(result.workflow_request_id):
    if event.node_execution:
        print(f"[{event.node_execution.status}] {event.node_execution.node_id}")

# Check your balance
balance = client.billing.get_balance()
print(f"Balance: ${balance.balance_usd:.2f}")

Available Services

Every SDK client exposes the same four service namespaces:
ServiceDescription
workflowsList, get, run, listen, stop workflows and inspect execution trees
chatsCreate, list, get, delete chat sessions and message history
eventsTrigger workflows via webhooks
billingCheck balance, transaction history, activity stats, and daily usage

Authentication

All SDKs accept an API key directly or via the SPLOX_API_KEY environment variable:
# Explicit
client = SploxClient(api_key="YOUR_API_KEY")

# From environment variable SPLOX_API_KEY
client = SploxClient()
Generate API tokens from your account settings.

Async Support

The Python SDK includes a fully async client for use with asyncio:
from splox import AsyncSploxClient

async with AsyncSploxClient(api_key="YOUR_API_KEY") as client:
    balance = await client.billing.get_balance()
    print(f"Balance: ${balance.balance_usd:.2f}")

Error Handling

All SDKs raise typed errors you can catch individually:
from splox import SploxClient
from splox.exceptions import (
    AuthenticationError,
    NotFoundError,
    RateLimitError,
)

try:
    client.workflows.get("nonexistent-id")
except AuthenticationError:
    print("Invalid API key")
except NotFoundError:
    print("Workflow not found")
except RateLimitError as e:
    print(f"Rate limited — retry after {e.retry_after}s")

Source Code