Installation
Keystore provides SDKs for TypeScript and Python, plus a CLI for managing tokens and credentials from your terminal.
TypeScript SDK
The @keystore/sdk package works in Node.js, Deno, Bun, and edge runtimes that support globalThis.fetch.
npm
npm install @keystore/sdkpnpm
pnpm add @keystore/sdkyarn
yarn add @keystore/sdkBun
bun add @keystore/sdkProvider peer dependencies
The SDK has optional peer dependencies for provider-specific wrappers. Install only the ones you need:
# OpenAI
npm install openai
# Anthropic
npm install @anthropic-ai/sdk
# Neon
npm install @neondatabase/serverless
# Resend
npm install resend
# AWS S3
npm install @aws-sdk/client-s3If you use interceptAll(), you do not need any peer dependencies — it works by patching fetch directly.
Python SDK
The Python SDK is published as the envclaw package on PyPI.
pip
pip install envclawPoetry
poetry add envclawuv
uv add envclawBasic usage
from envclaw import Keystore
from openai import OpenAI
ks = Keystore(agent_token="ks_a1b2c3d4e5f6...")
ks.intercept_all()
client = OpenAI(api_key="unused")
response = client.chat.completions.create(
model="gpt-4o",
messages=[{"role": "user", "content": "Hello!"}],
)
ks.restore()CLI
The Keystore CLI lets you manage agent tokens, list providers, and test connections from your terminal.
npm install -g @keystore/cliOr with pnpm:
pnpm add -g @keystore/cliAfter installation, authenticate:
keystore loginEnvironment variables
Both SDKs accept configuration through the constructor. You can also set environment variables for convenience:
| Variable | Description |
|---|---|
KEYSTORE_AGENT_TOKEN | Default agent token (used if not passed to constructor) |
KEYSTORE_PROXY_HOST | Custom proxy hostname (default: proxy.keystore.sh) |
Next steps
- Quickstart — End-to-end setup walkthrough
- SDK Reference — Full TypeScript API documentation