Skip to main content

agentsim-sdk

We run the auth challenge so your agent doesn't die there. This Python SDK opens an SMS challenge, waits for the verdict, and closes the session. Import name is agentsim. Primary names: open_challenge / wait_for_verdict. provision / wait_for_otp are aliases that still work. There is no AgentSIM() class.

Availability: Live SMS is self-serve for owned public HTTPS services after exact-origin verification and an allow policy. Hobby includes 10 live US SMS sessions per UTC month, with one active live session per account and no card required. Billing shows current paid terms before checkout and preserves any existing agreement. Check current access and channel support before using live examples.

Install

uv add agentsim-sdk

Or with pip:

pip install agentsim-sdk

Quickstart

Set AGENTSIM_API_KEY first. Run this inside an async function. Replace the target with an owned public HTTPS origin; enter_phone_number and enter_otp are your app automation callbacks. The first must request the SMS.

import agentsim

async with agentsim.open_challenge(agent_id="checkout-bot", service_url="https://staging.example.com", country="US") as num:
    await enter_phone_number(num.number)
    otp = await num.wait_for_verdict(timeout=60)
    await enter_otp(otp.otp_code)

Auth

Set AGENTSIM_API_KEY in your environment, or call agentsim.configure() at startup:

agentsim.configure(api_key="asm_live_xxx")

Get your API key at console.agentsim.dev.

API

agentsim.open_challenge(*, agent_id, service_url, country="US", ttl_seconds=3600, webhook_url=None)

Returns an async context manager. Opens an SMS challenge on enter, auto-releases on exit. provision is an alias.

async with agentsim.open_challenge(agent_id="checkout-bot", service_url="https://staging.example.com", country="US") as num:
    print(num.number)
    print(num.session_id)
    otp = await num.wait_for_verdict(timeout=60)
    print(otp.otp_code)

num.wait_for_verdict(timeout=60, auto_reroute=False, max_reroutes=2, on_reregistration_needed=None)

Long-polls until the SMS verdict arrives or timeout seconds elapse. wait_for_otp is an alias.

Returns: OtpResult(otp_code, from_number, received_at)

Raises: OtpTimeoutError if no verdict arrives within timeout seconds.

The shipped SDK does not include wait_for_verdict_sync. MCP agents should use open_challenge / wait_for_verdict.

Error Reference

Exception When
AuthenticationError Missing or invalid API key
PoolExhaustedError No numbers available in requested country
OtpTimeoutError No verdict arrived within timeout seconds
RateLimitError Too many requests — back off and retry
SessionNotFoundError Session expired or already released

Supported Countries

US

Metadata

Release files for agentsim-sdk 0.32.1

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

Source distribution (sdist)

Source distribution for agentsim-sdk 0.32.1
File Size Uploaded
agentsim_sdk-0.32.1.tar.gz 23.0 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for agentsim-sdk 0.32.1
File Interpreter ABI Platform
agentsim_sdk-0.32.1-py3-none-any.whl Python 3 none any Details

Total release size: 31.5 kB

Release files / agentsim_sdk-0.32.1.tar.gz

Download URL agentsim_sdk-0.32.1.tar.gz
Size 23.0 kB
Tags Source
SHA-256 checksum
How to use checksums
516267871efa2fdf2e618754894f01417c7b2976f3e9735256e808090dabf8c8
BLAKE2b-256 checksum
How to use checksums
27342bb06f425c3cda9a4ad54b8e288b0cac795f3de4de63adae7ba0c7a361a7
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 Sep 27, 2026.

Transparency log

Release files / agentsim_sdk-0.32.1-py3-none-any.whl

Download URL agentsim_sdk-0.32.1-py3-none-any.whl
Size 8.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
82054bb38e11b3457b7de642fc5336fdf455bfef9de4ea75f86d3f53ed75b16b
BLAKE2b-256 checksum
How to use checksums
588d3269b3915358e4df35b591f767d373126fedf970eee18bd03201efd28b9e
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 Sep 27, 2026.

Transparency log

Release history Release notifications | RSS feed

0.33.3

2 release files

0.33.2

2 release files

0.33.1

2 release files

0.33.0

2 release files

0.32.2

2 release files

This release

0.32.1 This release

2 release files

0.32.0

2 release files

0.31.0

2 release files

0.30.0

2 release files

0.24.2

2 release files

0.24.1

2 release files

0.24.0

2 release files

0.23.1

2 release files

0.23.0

2 release files

0.22.1

2 release files

0.22.0

2 release files

0.21.0

2 release files

0.20.0

2 release files

0.19.0

2 release files

0.18.0

2 release files

0.17.0

2 release files

0.16.0

2 release files

0.13.0

2 release files

0.12.0

2 release files

0.11.0

2 release files

0.10.2

2 release files

0.10.1

2 release files

0.6.1

2 release files

0.3.1

2 release files

0.2.5

2 release files

0.2.3

2 release files

0.2.0

2 release files

0.1.1

2 release files

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