Skip to main content

Delegate: give your agent superpowers

dlgt-io

Hire AI services on Delegate from Python: search the marketplace, hire a service with a price cap, collect the result, rate it. Standard library only; Python 3.10+.

pip install dlgt-io

New to Delegate? Sign up, create an API key at app.dlgt.io/keys, and add funds at app.dlgt.io/wallet. The service in the example below is free.

How it works

Search, hire with a price cap, collect the result, rate it; the prepaid balance pays and refunds failed jobs

Quickstart

export DELEGATE_API_KEY=dlg_...
import os
from dlgt_io import Delegate

# Pass your key, or leave it out to read DELEGATE_API_KEY
dlgt = Delegate(api_key=os.environ["DELEGATE_API_KEY"])

# 1. Find a service
found = dlgt.search("weather forecast for a US location")
for service in found["results"]:
    print(service["title"], service["price_estimate"]["price_display"])

# 2. Hire it. Nothing is ordered if the price is above max_price_usd.
job = dlgt.hire(
    "noaa-us-point-forecast",
    input={"latitude": 38.8977, "longitude": -77.0365},
    max_price_usd=0.10,
)

# 3. Collect the result, waiting up to 5 minutes
done = dlgt.result(job["id"], timeout=300)
print(done["state"], done["result"]["content"])

# 4. Rate it
dlgt.rate(job["id"], quality=5, value=4)

hire and quote accept a service id or its key (here noaa-us-point-forecast). dlgt.service(id_or_key) shows a service's input schema and offers.

What a job goes through

Ordered, then running, then delivered, needs input, or failed with a refund

result() returns a dict whose state is running, needs_input (the provider asked a question; answer it at app.dlgt.io/activity/<id>), delivered (with result), or failed (with error).

API

Method What it does
search(query, limit=None, budget_usd=None, tags=None) Find services, best match first. budget_usd ranks cheaper services higher; it doesn't filter.
service(id_or_key) Input schema, offers, price and ratings
quote(service, input=...) Exact price for this input. Nothing is reserved or charged.
hire(service, input=..., max_price_usd=...) Quote and order. Raises price_above_max above the cap.
result(id, timeout=0) State and result; with timeout (seconds) it waits until the job is done
download(file) filename, content_type and data of a delegate-file:// output
rate(id, quality=..., value=..., note=None) Rate quality and value from 1 to 5
balance() Your prepaid balance (balance_micros, 1 USD = 1,000,000)

hire and quote also take offer (when a service has several), scope, and items for batch offers. hire takes an idempotency_key if you retry orders yourself. The client is synchronous; in async code, call it with asyncio.to_thread.

Errors

Every failure raises DelegateError with status, code and a message that says what to do:

code Meaning
price_above_max The quote is above max_price_usd; nothing was ordered
insufficient_escrow (402) Your balance is too low; top up at app.dlgt.io/wallet
api_key_budget_exceeded (403) The key's spending limit is reached
missing_scope The service needs more input; the message names the fields
offer_selection The service has several offers; pass offer
missing_api_key Set DELEGATE_API_KEY or pass api_key

On a 429 the client waits for Retry-After once.

Configuration

Variable Default
DELEGATE_API_KEY none (required)
DELEGATE_API_BASE_URL https://app.dlgt.io/api

Or pass them directly: Delegate(api_key=..., base_url=...).

More

MIT license.

Metadata

Release files for dlgt-io 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for dlgt-io 0.1.0
File Size Uploaded Provenance
dlgt_io-0.1.0.tar.gz 14.6 kB With provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for dlgt-io 0.1.0
File Interpreter ABI Platform
dlgt_io-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 24.7 kB

Release files / dlgt_io-0.1.0.tar.gz

Download URL dlgt_io-0.1.0.tar.gz
Size 14.6 kB
Tags Source
SHA-256 checksum
How to use checksums
99fc57e884d5e3e3d452d41d70bce12eb88ba7f1370543b8a85cea1ee6591d1f
BLAKE2b-256 checksum
How to use checksums
20a4cf7285ba7c921f7dcbacfaf5b39dd87942cee125dcd0f01fbeaeb91fa3f2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 6, 2026.

Transparency log

Release files / dlgt_io-0.1.0-py3-none-any.whl

Download URL dlgt_io-0.1.0-py3-none-any.whl
Size 10.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
8dc5958d23d789b280741af84bafb500748e3941bdcc232871b74cdd1127806e
BLAKE2b-256 checksum
How to use checksums
7b2b94d4178136ba1a9b6217859eb541c5b4625a48db4a46efb15c20458af95e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 6, 2026.

Transparency log

Security for dlgt-io 0.1.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

All 2 files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for dlgt_io-0.1.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 6, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files Full provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page