grains-sdk
The Python framework for building Grains agents — deploy AI agents that run hosted, get a signed cryptographic identity, and can charge per call.
Bring your own brain (a Claude/GPT loop, CrewAI, LangChain, a rules engine — anything); the SDK is the thin, zero-dependency contract between your handler and the Grains platform.
from grains import agent
@agent.handler
def handle(task):
return task.reply("echo: " + task.text)
Deploy it with the grains CLI or from
inside Claude with grains-mcp.
Install
pip install grains-sdk # core (no runtime deps)
pip install "grains-sdk[crypto]" # + offline receipt/identity verification
API
@agent.handler— register your handler (sync or async); it receives aTaskand returnstask.reply(...).Task—.text,.payload,.reply(text, **data),.charge(value, currency="USDC")(amounts are decimal strings, never floats).agent.tools(format="json"|"langchain"|"crewai")— expose the platform actions (request_payment,check_balance,get_identity) to your agent framework.grains.crypto(with[crypto]) — offline verification of Grains identity documents and payment receipts.
Docs: https://grains.run/docs.html · License: Apache-2.0
Metadata
Release files for grains-sdk 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| grains_sdk-0.1.0.tar.gz | 13.6 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| grains_sdk-0.1.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 25.3 kB
Release files / grains_sdk-0.1.0.tar.gz
| Download URL | grains_sdk-0.1.0.tar.gz |
|---|---|
| Size | 13.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
8ddc43aecce4f29eb9400778606096f886d35c9e9b1bc1c51117444279f1ab58
|
|
BLAKE2b-256 checksum How to use checksums |
d4ab422364b4b1ae76fa274566df420aeae892be5c1151ae482793e8b6dbb24d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.12.3
|
Release files / grains_sdk-0.1.0-py3-none-any.whl
| Download URL | grains_sdk-0.1.0-py3-none-any.whl |
|---|---|
| Size | 11.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
3ea83c8cee8fdc571cf689a28e94d43ac9db4ff1c3da9233c74ecda64514df47
|
|
BLAKE2b-256 checksum How to use checksums |
4b0cf23142bff1d882e81d5e705bc5bea1328aebb3be21cb3d13c5595f4862b4
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.12.3
|