---
title: Python SDK
description: pip install agenko
---

# Python SDK

Package: `agenko` on PyPI. Current series: `0.1.x`.

```python
import agenko

agenko.init()

@agenko.check
def handle_ticket(ticket):
    return process(ticket)

@agenko.approve(when="irreversible")
def delete_account(user_id):
    db.delete_user(user_id)
```

## Exports

| Name | Role |
|---|---|
| `init` | Bootstrap |
| `instrument` | Alias of `init` |
| `check` | Receipt decorator |
| `approve` | Gate decorator |
| `agent` | Agent entrypoint helper |
| `get_prompt` / `clear_prompt_cache` | See [Prompts](/prompts) |
| `score` | See [Scores](/scores) |
| `get_client` | Control-plane HTTP client |
| `Receipt`, `ReceiptCheck` | Models |
| `ApprovalError`, `ApprovalTimeoutError` | Gate errors |

## Drop-in modules

Optional explicit imports if you prefer not to rely on auto-detect: `agenko.openai`, `agenko.anthropic`, `agenko.langchain`, `agenko.langgraph`, `agenko.litellm`, `agenko.llamaindex`, `agenko.crewai`, `agenko.mistral`, `agenko.cohere`, `agenko.bedrock`, `agenko.google`.

Import your framework **before** `init()` so the detector can see it in `sys.modules`.

## Agent decorator

`@agenko.agent` wraps an agent entrypoint with `@check` (receipt + tracing) and records the agent's `name` and `model` on the wrapper. Use it for your top-level handler so the console can attribute runs to an agent.

```python
@agenko.agent(name="support-agent", model="gpt-4o")
def handle_ticket(ticket):
    return process(ticket)
```

Python only. On TypeScript, wrap your agent entrypoint directly with `agenko.check(...)` — see [Best practices](/best-practices).

## Tests

From the monorepo: `cd agenko/agenko-python && pytest`.

## Agent instructions

This page: https://docs.agenko.app/python.md

Fetch `/llms.txt` for the full index. Search: `GET /api/search-docs?query=...`
