Python SDK and CLI for the AgentPatch tool marketplace
Project description
AgentPatch
Zero-dependency Python SDK and CLI for the AgentPatch tool marketplace. Single file, stdlib only.
Install
pip install agentpatch
Or with pipx for CLI-only usage:
pipx install agentpatch
Or just copy src/agentpatch.py into your project — it has no dependencies beyond Python 3.10+.
Authentication
Get your API key from agentpatch.ai/dashboard, then either:
# Option 1: Save to config file
ap config set-key
# Option 2: Environment variable
export AGENTPATCH_API_KEY=ap_your_key_here
CLI Usage
# Search for tools
ap search "image generation"
ap search --max-price 100 --json
# Get tool details
ap info agentpatch google-search
# Invoke a tool (waits for result by default)
ap run agentpatch google-search --input '{"query": "best pizza NYC"}'
# Invoke without waiting (for async tools)
ap run agentpatch generate-image-recraft --input '{"prompt": "a cat"}' --no-poll
# Check async job status
ap job job_abc123
ap job job_abc123 --poll # wait for completion
Every command supports --json for scripting:
ap search "email" --json | jq '.[0].slug'
ap run agentpatch google-search --input '{"query": "test"}' --json | jq '.output'
SDK Usage
from agentpatch import AgentPatch
ap = AgentPatch() # uses AGENTPATCH_API_KEY env var or ~/.agentpatch/config.toml
# Search for tools
tools = ap.search("image generation")
for t in tools["tools"]:
print(f"{t['owner_username']}/{t['slug']} — {t['price_credits_per_call']} credits")
# Get tool details
tool = ap.get_tool("agentpatch", "google-search")
print(tool["input_schema"])
# Invoke a tool (auto-polls async jobs)
result = ap.invoke("agentpatch", "google-search", {"query": "best pizza NYC"})
print(result["output"])
# Manual async control
result = ap.invoke("agentpatch", "generate-image-recraft", {"prompt": "a cat"}, poll=False)
job = ap.get_job(result["job_id"])
Configuration
API key resolution order:
api_key=parameter (SDK) or--api-keyflag (CLI)AGENTPATCH_API_KEYenvironment variable~/.agentpatch/config.tomlfile
ap config set-key # save API key
ap config show # show current config
ap config clear # delete config file
License
MIT
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file agentpatch-0.1.0.tar.gz.
File metadata
- Download URL: agentpatch-0.1.0.tar.gz
- Upload date:
- Size: 10.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1d87fa262c4de1bfc345c96d2c25a4f7272dba6a5ff83ad1fb35cc1518004559
|
|
| MD5 |
9f71341de401cfc29d5df56ae3f9eeb4
|
|
| BLAKE2b-256 |
f468f86f1b6db7ebbe17f7ddedc93373db7392060e8c294af0845adefdb05484
|
Provenance
The following attestation bundles were made for agentpatch-0.1.0.tar.gz:
Publisher:
publish.yml on fullthom/agentpatch-python
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
agentpatch-0.1.0.tar.gz -
Subject digest:
1d87fa262c4de1bfc345c96d2c25a4f7272dba6a5ff83ad1fb35cc1518004559 - Sigstore transparency entry: 1021681897
- Sigstore integration time:
-
Permalink:
fullthom/agentpatch-python@9a8084aff2f42d79ef5800a180c730b0224271dd -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/fullthom
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@9a8084aff2f42d79ef5800a180c730b0224271dd -
Trigger Event:
push
-
Statement type:
File details
Details for the file agentpatch-0.1.0-py3-none-any.whl.
File metadata
- Download URL: agentpatch-0.1.0-py3-none-any.whl
- Upload date:
- Size: 8.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ff43ef150208351f98afd7efb9dc3c19faeb7abe88a62d269ae0da52a37b1592
|
|
| MD5 |
e8874e78272485673106ae1078530bf3
|
|
| BLAKE2b-256 |
d3c55b9d5b3cc5e12baa0eb58dca3f1ae5e64a95f069951e9b17837820d9ecdb
|
Provenance
The following attestation bundles were made for agentpatch-0.1.0-py3-none-any.whl:
Publisher:
publish.yml on fullthom/agentpatch-python
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
agentpatch-0.1.0-py3-none-any.whl -
Subject digest:
ff43ef150208351f98afd7efb9dc3c19faeb7abe88a62d269ae0da52a37b1592 - Sigstore transparency entry: 1021681961
- Sigstore integration time:
-
Permalink:
fullthom/agentpatch-python@9a8084aff2f42d79ef5800a180c730b0224271dd -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/fullthom
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@9a8084aff2f42d79ef5800a180c730b0224271dd -
Trigger Event:
push
-
Statement type: