Quickstart
Get ThinkingSDK running in your Python application in under 2 minutes.
Installation
pip install thinkingsdk
Requires Python 3.7 or later.
Initialize
import thinkingsdk as thinking
thinking.start(
api_key="sk_live_your_api_key_here",
server_url="https://api.thinkingsdk.ai",
config={"git_repositories": ["https://github.com/your-org/your-repo"]}
)
That's it. ThinkingSDK now captures every unhandled exception in your application, in the main thread and in worker threads. Main thread crashes arrive with the stack trace, exception chain, system state, breadcrumb trail and repository context.
server_urlis required for the hosted service: without it the SDK sends tohttp://localhost:8000.git_repositoriestells the autofix pipeline which GitHub repository to open pull requests against. Leave it out if you only want crash reports.- Exceptions your code catches are not reported by default. Neither are request exceptions in FastAPI, Flask or Django, which the framework catches and turns into a 500 response. To report them, enable
capture_caught_exceptions.
Get Your API Key
- Sign up at thinkingsdk.com/get-started
- Navigate to Settings → API Keys
- Create a new key: it starts with
sk_live_
What Happens Next
When an exception occurs in your production code:
- Captured: SDK freezes the crash state (stack, exception chain, breadcrumbs, system info)
- Sent: Event is batched and sent to ThinkingSDK servers from a background thread (gzip compressed, non-blocking)
- Grouped: Repeats are aggregated by the SDK and grouped on the server
- Displayed: View the crash in your dashboard with the Time Capsule
- Fixed: If you're on a paid plan and set
git_repositories, ThinkingSDK generates an AI fix and opens a PR
Verify It Works
import thinkingsdk as thinking
thinking.start(
api_key="sk_live_your_key",
server_url="https://api.thinkingsdk.ai"
)
# Trigger a test exception and leave it uncaught
def divide(a, b):
return a / b
divide(1, 0)
The script exits with the usual ZeroDivisionError traceback and the SDK sends the report before the process exits. Check your dashboard: you should see a ZeroDivisionError within seconds. Wrapping the call in try/except reports nothing unless capture_caught_exceptions is on.
Next Steps
- Client Configuration: Customize what the SDK captures
- What ThinkingSDK Is Not: Important boundaries
- Server Configuration: Customize server behavior