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
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
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
- CLI:
@dlgt-io/clion npm - TypeScript SDK:
@dlgt-io/sdk - MCP server: dlgt.io/docs
- REST API reference: app.dlgt.io/api/docs
- Developer docs: dlgt.io/docs/developers
- Source and issues: github.com/Dlgt-io/dlgt
MIT license.
Metadata
Release files for dlgt-io 0.1.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| dlgt_io-0.1.1.tar.gz | 14.6 kB | With provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| dlgt_io-0.1.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 24.8 kB
Release files / dlgt_io-0.1.1.tar.gz
| Download URL | dlgt_io-0.1.1.tar.gz |
|---|---|
| Size | 14.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
1fdc48549163c19c309f0404aa4f7ea4a01f7ce701e9b31abbe511edd7acf97a
|
|
BLAKE2b-256 checksum How to use checksums |
a4d4c069b53f0059f67dc14b55ccbdf794f5cbab3de58dd3df7e14cf942240be
|
| 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 9, 2026.
Transparency logRelease files / dlgt_io-0.1.1-py3-none-any.whl
| Download URL | dlgt_io-0.1.1-py3-none-any.whl |
|---|---|
| Size | 10.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
1181d948ced0b1cdb899e1087f6b3d1f982530dcdf21d6b44d6555c2e9b525a3
|
|
BLAKE2b-256 checksum How to use checksums |
790e7a8c9c40fcb398c3120116b411218a02ba2098a178ae42456c91c7791bba
|
| 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 9, 2026.
Transparency logSecurity for dlgt-io 0.1.1
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.
Attestation for dlgt_io-0.1.1.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 9, 2026.
Transparency logA 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.