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.
Install
uv add agentsim-sdk
Or with pip:
pip install agentsim-sdk
Quickstart
import agentsim
async with agentsim.open_challenge(agent_id="checkout-bot", 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, country="US", service_url=None, 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", 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
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file agentsim_sdk-0.23.0.tar.gz.
File metadata
- Download URL: agentsim_sdk-0.23.0.tar.gz
- Upload date:
- Size: 22.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5aff9dc5cbc5679a9c0084b912ff8ed4a1bbe82824c75b8336ada0073a59c2e6
|
|
| MD5 |
e275befd1b83e93026ec083f8a845f7e
|
|
| BLAKE2b-256 |
fe266e41103ede8c8bd60848790675203ba2a3da3257d6f53258c1b310fec457
|
Provenance
The following attestation bundles were made for agentsim_sdk-0.23.0.tar.gz:
Publisher:
publish-pypi.yml on agentsimdev/agentsim
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
agentsim_sdk-0.23.0.tar.gz -
Subject digest:
5aff9dc5cbc5679a9c0084b912ff8ed4a1bbe82824c75b8336ada0073a59c2e6 - Sigstore transparency entry: 2617682770
- Sigstore integration time:
-
Permalink:
agentsimdev/agentsim@e67588c64ae9ca36a8e592a28180bd89ad285b71 -
Branch / Tag:
refs/tags/v0.23.0 - Owner: https://github.com/agentsimdev
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
self-hosted -
Publication workflow:
publish-pypi.yml@e67588c64ae9ca36a8e592a28180bd89ad285b71 -
Trigger Event:
release
-
Statement type:
File details
Details for the file agentsim_sdk-0.23.0-py3-none-any.whl.
File metadata
- Download URL: agentsim_sdk-0.23.0-py3-none-any.whl
- Upload date:
- Size: 8.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
30a0203731e3679a9ed2aa86b98328e4549bb0d4ac8ee042ea7233f41bd8a7b6
|
|
| MD5 |
7348864cc0234da38985379e56b6e73b
|
|
| BLAKE2b-256 |
725b45d15a77e65a9a8a1d5836155974df160456a9ec025aaf78bc030fe81a33
|
Provenance
The following attestation bundles were made for agentsim_sdk-0.23.0-py3-none-any.whl:
Publisher:
publish-pypi.yml on agentsimdev/agentsim
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
agentsim_sdk-0.23.0-py3-none-any.whl -
Subject digest:
30a0203731e3679a9ed2aa86b98328e4549bb0d4ac8ee042ea7233f41bd8a7b6 - Sigstore transparency entry: 2617682776
- Sigstore integration time:
-
Permalink:
agentsimdev/agentsim@e67588c64ae9ca36a8e592a28180bd89ad285b71 -
Branch / Tag:
refs/tags/v0.23.0 - Owner: https://github.com/agentsimdev
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
self-hosted -
Publication workflow:
publish-pypi.yml@e67588c64ae9ca36a8e592a28180bd89ad285b71 -
Trigger Event:
release
-
Statement type: