Get Started with Tork in 5 Minutes
STEP 1Get Your API Key
First, you'll need an API key to authenticate your requests. You can generate one in seconds from your dashboard.
Go to DashboardSTEP 2Install the SDK
Because you want the results in your dashboard, this quickstart uses the cloud path: Tork makes the governance decision server-side and records it. In Python that means calling the REST API with requests — there is no Python cloud SDK.
pip install requestsUsing JS/TS? Install @torknetwork/sdk and use its TorkClient class — the same cloud path. Not to be confused with tork-governance, a separate on-device package that decides locally and sends nothing to your dashboard.
STEP 3Add to Your Code
Just a few lines of code to make your AI safe and compliant.
import requests
# Check any AI output for safety
resp = requests.post(
"https://tork.network/api/v1/govern",
headers={"Authorization": "Bearer your_api_key_here"},
json={"content": "Your AI agent's response here",
"options": {"mode": "redact"}},
timeout=10,
)
result = resp.json()
# Act on the result
if result["action"] != "deny":
print("Safe to send:", result["output"])
else:
print("Blocked:", result["verdict"])
# This receipt is what shows up in your dashboard
print("Receipt:", result["receipt_id"])STEP 4You're Ready!
Successfully integrated Tork!
📺 Video Tutorial Coming Soon
Watch a step-by-step walkthrough of integrating Tork