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.

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

agentsim_sdk-0.23.0.tar.gz (22.6 kB view details)

Uploaded Source

Built Distribution

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

agentsim_sdk-0.23.0-py3-none-any.whl (8.2 kB view details)

Uploaded Python 3

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

Hashes for agentsim_sdk-0.23.0.tar.gz
Algorithm Hash digest
SHA256 5aff9dc5cbc5679a9c0084b912ff8ed4a1bbe82824c75b8336ada0073a59c2e6
MD5 e275befd1b83e93026ec083f8a845f7e
BLAKE2b-256 fe266e41103ede8c8bd60848790675203ba2a3da3257d6f53258c1b310fec457

See more details on using hashes here.

Provenance

The following attestation bundles were made for agentsim_sdk-0.23.0.tar.gz:

Publisher: publish-pypi.yml on agentsimdev/agentsim

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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

Hashes for agentsim_sdk-0.23.0-py3-none-any.whl
Algorithm Hash digest
SHA256 30a0203731e3679a9ed2aa86b98328e4549bb0d4ac8ee042ea7233f41bd8a7b6
MD5 7348864cc0234da38985379e56b6e73b
BLAKE2b-256 725b45d15a77e65a9a8a1d5836155974df160456a9ec025aaf78bc030fe81a33

See more details on using hashes here.

Provenance

The following attestation bundles were made for agentsim_sdk-0.23.0-py3-none-any.whl:

Publisher: publish-pypi.yml on agentsimdev/agentsim

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Release history Release notifications | RSS feed

0.23.1

2 files

This release

0.23.0 This release

2 files

0.22.1

2 files

0.22.0

2 files

0.21.0

2 files

0.20.0

2 files

0.19.0

2 files

0.18.0

2 files

0.17.0

2 files

0.16.0

2 files

0.15.0

2 files

0.14.0

2 files

0.13.0

2 files

0.12.0

2 files

0.11.0

2 files

0.10.2

2 files

0.10.1

2 files

0.6.1

2 files

0.3.1

2 files

0.2.5

2 files

0.2.3

2 files

0.2.0

2 files

0.1.1

2 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