AgentSIM Python SDK — autonomous OTP relay for AI agents
Project description
agentsim
Autonomous OTP relay for AI agents. AgentSIM provisions real carrier-routed phone numbers, receives inbound SMS, and delivers parsed OTP codes back to your agent — no human relay needed.
Install
uv add agentsim
Or with pip:
pip install agentsim
Quickstart
import agentsim
async with agentsim.provision(agent_id="checkout-bot", country="US") as num:
await enter_phone_number(num.number) # "+14155552671"
otp = await num.wait_for_otp(timeout=60)
await enter_otp(otp.otp_code) # "847291"
# number auto-released
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 agentsim.dev/dashboard.
API
agentsim.provision(*, agent_id, country="US", ttl_seconds=3600, webhook_url=None)
Returns an async context manager. Provisions a number on enter, auto-releases on exit (even if the body raises).
async with agentsim.provision(agent_id="stripe-setup", country="DE") as num:
print(num.number) # E.164 phone number
print(num.session_id)
otp = await num.wait_for_otp(timeout=30)
print(otp.otp_code, otp.confidence)
num.wait_for_otp(timeout=60)
Long-polls until an OTP arrives or timeout seconds elapse.
Returns: OtpResult(otp_code, confidence, method, received_at)
Raises: OtpTimeoutError if no OTP arrives within timeout seconds.
agentsim.provision_sync(...) / num.wait_for_otp_sync(timeout=60)
Synchronous variants for non-async codebases:
with agentsim.provision_sync(agent_id="x") as num:
otp = num.wait_for_otp_sync(timeout=60)
Error Reference
| Exception | When |
|---|---|
AuthenticationError |
Missing or invalid API key |
PoolExhaustedError |
No numbers available in requested country |
OtpTimeoutError |
No OTP arrived within timeout seconds |
RateLimitError |
Too many requests — back off and retry |
SessionNotFoundError |
Session expired or already released |
Supported Countries
US, GB, DE, FR, NL, EE
Project details
Release history Release notifications | RSS feed
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.1.1.tar.gz.
File metadata
- Download URL: agentsim_sdk-0.1.1.tar.gz
- Upload date:
- Size: 22.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
baca1427988f4a89cb5f7fc83c4886be9de3b38b90d58e6d81a49e4535a1de1d
|
|
| MD5 |
391316c9c3e0b1536dffdd75b86805b0
|
|
| BLAKE2b-256 |
7e9d7d4fb73f490dab68d97c1b4cc55e2a3e828d58adf8d9edb7d9f075831803
|
Provenance
The following attestation bundles were made for agentsim_sdk-0.1.1.tar.gz:
Publisher:
publish-pypi.yml on Fato07/agentsim
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
agentsim_sdk-0.1.1.tar.gz -
Subject digest:
baca1427988f4a89cb5f7fc83c4886be9de3b38b90d58e6d81a49e4535a1de1d - Sigstore transparency entry: 1143867118
- Sigstore integration time:
-
Permalink:
Fato07/agentsim@60473b34bfbdcb5892dc017cf3a403792a39f691 -
Branch / Tag:
refs/tags/v0.1.1 - Owner: https://github.com/Fato07
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-pypi.yml@60473b34bfbdcb5892dc017cf3a403792a39f691 -
Trigger Event:
push
-
Statement type:
File details
Details for the file agentsim_sdk-0.1.1-py3-none-any.whl.
File metadata
- Download URL: agentsim_sdk-0.1.1-py3-none-any.whl
- Upload date:
- Size: 7.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
dc37caa38e2357717473e5a9a630a337832b078bd0e9a76807762727d1765840
|
|
| MD5 |
f402b5ab5fd614a70d1f63b071745bb8
|
|
| BLAKE2b-256 |
966860d8e1b2ef0c9cbe5a7e9c0d6bdcefde196ba91024211263d0da779651c5
|
Provenance
The following attestation bundles were made for agentsim_sdk-0.1.1-py3-none-any.whl:
Publisher:
publish-pypi.yml on Fato07/agentsim
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
agentsim_sdk-0.1.1-py3-none-any.whl -
Subject digest:
dc37caa38e2357717473e5a9a630a337832b078bd0e9a76807762727d1765840 - Sigstore transparency entry: 1143867193
- Sigstore integration time:
-
Permalink:
Fato07/agentsim@60473b34bfbdcb5892dc017cf3a403792a39f691 -
Branch / Tag:
refs/tags/v0.1.1 - Owner: https://github.com/Fato07
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-pypi.yml@60473b34bfbdcb5892dc017cf3a403792a39f691 -
Trigger Event:
push
-
Statement type: