Skip to main content

Python SDK for the Strale API — let AI agents buy capabilities at runtime

Project description

straleio

Python SDK for the Strale API — let AI agents buy and execute capabilities at runtime.

Install

pip install straleio

Quick start

from straleio import Strale

strale = Strale(api_key="sk_live_...")

result = strale.do(task="validate VAT number SE556703748501")

print(result.output)
# {"valid": True, "country_code": "SE", "company_name": "Spotify AB"}

Execute by slug

result = strale.do(
    capability_slug="vat-validate",
    inputs={"vat_number": "SE556703748501"},
    max_price_cents=10,
)

Dry run (preview cost without executing)

preview = strale.dry_run(task="look up Swedish company Klarna")

print(preview.matched_capability)  # "swedish-company-data"
print(preview.price_cents)         # 80

Async support

import asyncio
from straleio import Strale

async def main():
    strale = Strale(api_key="sk_live_...")
    result = await strale.do_async(task="validate VAT number SE556703748501")
    print(result.output)

asyncio.run(main())

Check balance

balance = strale.get_balance()
print(balance.balance_eur)  # "1.84"

List capabilities

capabilities = strale.list_capabilities()
# 250+ capabilities with slug, name, price, category

Free-tier (no API key)

5 capabilities work without authentication:

strale = Strale(api_key="")

result = strale.do(
    capability_slug="email-validate",
    inputs={"email": "hello@example.com"},
)

Options

strale = Strale(
    api_key="sk_live_...",
    base_url="https://api.strale.io",  # default
    timeout=60.0,                       # seconds, default 60
    default_max_price_cents=200,        # cap per call, default €2.00
)

Error handling

from straleio import Strale, StraleError

try:
    result = strale.do(task="...")
except StraleError as e:
    print(e.code)     # "insufficient_balance" | "no_matching_capability" | ...
    print(e.message)

Try for Free

5 capabilities work without an API key or signup:

  • email-validate — verify email deliverability
  • dns-lookup — DNS record lookup
  • json-repair — fix malformed JSON
  • url-to-markdown — convert any URL to markdown
  • iban-validate — validate international bank account numbers

For all 250+ capabilities, sign up for €2 in free trial credits.

Resources

License

MIT — see LICENSE

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

straleio-0.1.3.tar.gz (8.6 kB view details)

Uploaded Source

Built Distribution

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

straleio-0.1.3-py3-none-any.whl (8.1 kB view details)

Uploaded Python 3

File details

Details for the file straleio-0.1.3.tar.gz.

File metadata

  • Download URL: straleio-0.1.3.tar.gz
  • Upload date:
  • Size: 8.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.2

File hashes

Hashes for straleio-0.1.3.tar.gz
Algorithm Hash digest
SHA256 a3fc7c1bd367cb770a2f44f03551656dcfcec7df2311636d36058b900793bbb7
MD5 25d880411cff50dacd45a6e7f8633972
BLAKE2b-256 7facadde8316c141f090dd4df7b8c772805ea590a6a8b9d77075c71d5d1140af

See more details on using hashes here.

File details

Details for the file straleio-0.1.3-py3-none-any.whl.

File metadata

  • Download URL: straleio-0.1.3-py3-none-any.whl
  • Upload date:
  • Size: 8.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.2

File hashes

Hashes for straleio-0.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 91744b8f42d5d6b40514f081b53ad0d071b95437090c001999cfd78dd9dede0c
MD5 e5e75ef788f12d75d2617026bb916518
BLAKE2b-256 3fc016a0985a547c37ab85c7614ec78936339f9a8f3df8038e1dd70294430a96

See more details on using hashes here.

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