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.2.0.tar.gz (10.6 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.2.0-py3-none-any.whl (9.0 kB view details)

Uploaded Python 3

File details

Details for the file agentpatch-0.2.0.tar.gz.

File metadata

  • Download URL: agentpatch-0.2.0.tar.gz
  • Upload date:
  • Size: 10.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for agentpatch-0.2.0.tar.gz
Algorithm Hash digest
SHA256 b3b865726836439a33d79684655a4e308e8d5073d575293345434ccac03b78eb
MD5 3bf070cc3b6dc69326d055a09443cf10
BLAKE2b-256 021f9d6ace3d5a1a58bf3ce8c4312f67dc3812fec19fa7d27477a12fc196ebad

See more details on using hashes here.

Provenance

The following attestation bundles were made for agentpatch-0.2.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.2.0-py3-none-any.whl.

File metadata

  • Download URL: agentpatch-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 9.0 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.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 38aac9becc71e76f7d382534dd00026dfee2f57d789eaccbe571c94c37c88624
MD5 468b84d2b35bce2d2c6fe19059fdb7a4
BLAKE2b-256 ce48d5fe6156bb8dd8cebb1e1e7ce9d18ab9c1b2e02fd2f2e2f8d1eeef5c8212

See more details on using hashes here.

Provenance

The following attestation bundles were made for agentpatch-0.2.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