Thoth SDK
sdk v0.1.15 / proxy v0.3.4

Installation

Install the Thoth SDK for Python, Go, or TypeScript and configure your API key.

Enterprise rollout?

If you are deploying Thoth across managed endpoints, start with the Deployment Guides and Claude Desktop Fleet Configuration.

Prerequisites

You need a tenant, an API key, and the enforce URL for your environment.

export THOTH_API_KEY="thoth_live_your_key_here"
export THOTH_API_URL="https://enforce.<tenant>.<apex-domain>"

If your security team already provisions keys through secrets management, use that key directly.

Headless key creation (control-plane API)

If you run fully headless, create keys through the Thoth Control Plane API instead of a UI.

export THOTH_TENANT_ID="<tenant>"
export THOTH_APEX_DOMAIN="<apex-domain>"
 
# Interactive admin login (one-time):
thothctl auth login \
  --tenant-id "$THOTH_TENANT_ID" \
  --admin-email "<admin@company.com>"
 
# Create org-scoped key for SDK/provider automation:
thothctl api-keys create \
  --tenant-id "$THOTH_TENANT_ID" \
  --organization \
  --permission read \
  --permission write \
  --permission execute \
  --name "sdk-runtime-key" \
  --json

For CI/CD pipelines, export the returned key as THOTH_API_KEY.

Store returned api_key in your secret manager. It is shown once.


Python

Requirements: Python 3.12+

pip install aten-thoth

Pin to the current stable SDK release:

pip install aten-thoth==0.5.11

Or with Poetry:

poetry add aten-thoth

Verify install:

import thoth
print(thoth.__version__)

Framework integrations

  • Anthropic Claudeinstrument_anthropic()
  • OpenAIinstrument_openai()
  • LangChain / LangGraph — auto-detected by instrument()
  • CrewAI — auto-detected by instrument()

Go

Requirements: Go 1.25+

go get github.com/atensecurity/thoth-go

Pin to the current stable SDK release:

go get github.com/atensecurity/thoth-go@v0.1.15

Import:

import "github.com/atensecurity/thoth-go"

Environment fallbacks are applied automatically (THOTH_API_KEY, THOTH_API_URL, THOTH_TENANT_ID, THOTH_AGENT_ID).


TypeScript / Node.js

Requirements: Node.js 18+, TypeScript 5.x

npm install @atensec/thoth
# or
pnpm add @atensec/thoth
# or
yarn add @atensec/thoth

Pin to the current stable SDK release:

npm install @atensec/thoth@0.5.11

Sub-path integrations:

import { wrapAnthropicTools } from "@atensec/thoth/anthropic";
import { wrapOpenAITools } from "@atensec/thoth/openai";

Proxy and CLI line (thoth + thothctl)

For MCP gateway and operator CLI workflows, install the Thoth binary line from thoth/v* releases (current stable: thoth/v0.3.4).


Next steps

On this page