TitanVX Developer Hub
Back

SDK

Python SDK

Lightweight helper for calling the TitanVX gateway (Metis TPS + gateway utilities). TPS commands are sent to POST /demo/v1/Metis/tps and routed by the service field.

Use /apidocs (or /api/openapi.json) to discover available services and payload shapes.

Contents

  1. Install
  2. Authentication
  3. Quickstart
  4. Client reference
  5. Errors
  6. Examples
  7. Operational tips

Install

Install from this repo (editable) while developing:

cd sdk/python
python -m pip install -e .

Verify install:

python -c "from titanvx_sdk import TitanVxClient; print(TitanVxClient())"

Quickstart

from titanvx_sdk import TitanVxClient

client = TitanVxClient(
    base_url="https://api.titanvx.com",
    api_key="TITAN-REPLACE-ME",
)

resp = client.tps.call(
    service="US_LogOn",
    target={"user": "you@example.com"},
    vx={"passcode": "1234"},
)
print(resp)

Authentication

API key

Docs/testing & gateway keys.

client = TitanVxClient(
    api_key="TITAN-REPLACE-ME",
)

Bearer

Titan session JWT.

client = TitanVxClient(
    bearer_token="YOUR_JWT",
)

Optional: pass session_id to send a Session-Id header when the service expects it.

Client reference

TitanVxClient constructor

TitanVxClient(
    base_url="https://api.titanvx.com",
    api_key=None,
    bearer_token=None,
    session_id=None,
    timeout_seconds=45.0,
)

tps.call()

client.tps.call(
    service: str,                 # required, e.g. "AP_Chat"
    vx: dict | None = None,       # optional
    target: dict | None = None,   # optional
    access: dict | None = None,   # optional
    cmd: dict | None = None,      # optional
    **extra,                      # any other top-level fields for the service
) -> dict

Envelope fields

resp = client.tps.call(
    service="AP_Chat",
    content="Hello",
    rule=False,
)

Errors

from titanvx_sdk import TitanVxClient, TitanVxHttpError, TitanVxTransportError

client = TitanVxClient(api_key="TITAN-REPLACE-ME")

try:
    client.tps.call(service="US_Read")
except TitanVxHttpError as e:
    print("HTTP failed:", e.status_code, e.response_text[:300])
except TitanVxTransportError as e:
    print("Transport failed:", str(e))

Examples

User: logon

resp = client.tps.call(
    service="US_LogOn",
    target={"user": "you@example.com"},
    vx={"passcode": "1234"},
)

Agent: chat

resp = client.tps.call(
    service="AP_Chat",
    content="Hello",
    rule=False,
)

MCP tools (list / install / invoke)

# List tools/templates visible to your account
resp = client.mcp.list_tools()
tools = resp.get("tools", []) if isinstance(resp, dict) else []
print("tools:", len(tools))

# Install (claim) a template by id
# client.mcp.install(template_id="tpl_123")

# Invoke a tool (gateway proxies to the tool runtime)
# out = client.mcp.invoke(tool_name="http_get_json", arguments={"url": "https://example.com"})
# print(out)

Skills (list / install)

resp = client.skills.list()
print(resp)

# Install (enable) a published skill by name
# client.skills.install(skill_name="json_pretty")

Documents (ingest)

# Queue a URL for ingestion
out = client.documents.ingest_url(url="https://example.com")
print(out)

# Or send raw text
out = client.documents.ingest_text(text="Hello from TitanVX")
print(out)

OpenAPI discovery (programmatic)

# List TPS services from the OpenAPI spec
services = client.openapi.tps_services()
print("tps services:", len(services))

Operational tips

Download as PDF: click Download PDF and choose “Save as PDF” in your browser print dialog.