Skip to main content

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:

  1. api_key= parameter (SDK) or --api-key flag (CLI)
  2. AGENTPATCH_API_KEY environment variable
  3. ~/.agentpatch/config.toml file
ap config set-key    # save API key
ap config show       # show current config
ap config clear      # delete config file

License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

agentpatch-0.1.0.tar.gz (10.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

agentpatch-0.1.0-py3-none-any.whl (8.5 kB view details)

Uploaded Python 3

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

Hashes for agentpatch-0.1.0.tar.gz
Algorithm Hash digest
SHA256 1d87fa262c4de1bfc345c96d2c25a4f7272dba6a5ff83ad1fb35cc1518004559
MD5 9f71341de401cfc29d5df56ae3f9eeb4
BLAKE2b-256 f468f86f1b6db7ebbe17f7ddedc93373db7392060e8c294af0845adefdb05484

See more details on using hashes here.

Provenance

The following attestation bundles were made for agentpatch-0.1.0.tar.gz:

Publisher: publish.yml on fullthom/agentpatch-python

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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

Hashes for agentpatch-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 ff43ef150208351f98afd7efb9dc3c19faeb7abe88a62d269ae0da52a37b1592
MD5 e8874e78272485673106ae1078530bf3
BLAKE2b-256 d3c55b9d5b3cc5e12baa0eb58dca3f1ae5e64a95f069951e9b17837820d9ecdb

See more details on using hashes here.

Provenance

The following attestation bundles were made for agentpatch-0.1.0-py3-none-any.whl:

Publisher: publish.yml on fullthom/agentpatch-python

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page