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.1.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.1-py3-none-any.whl (8.2 kB view details)

Uploaded Python 3

File details

Details for the file agentsim_sdk-0.23.1.tar.gz.

File metadata

  • Download URL: agentsim_sdk-0.23.1.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.1.tar.gz
Algorithm Hash digest
SHA256 480a6a3804603f42872df2c59909fd214a09ad957e19de09564e07140be10584
MD5 f9bda752562fa552a22329b1676c40f5
BLAKE2b-256 914400ee6bf528030639df78e75bc6a871924b0adaf0a17177a6c6b3f3191ffb

See more details on using hashes here.

Provenance

The following attestation bundles were made for agentsim_sdk-0.23.1.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.1-py3-none-any.whl.

File metadata

  • Download URL: agentsim_sdk-0.23.1-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.1-py3-none-any.whl
Algorithm Hash digest
SHA256 d8fc0cab4d351040efa8a3007a2351e03c0274a12c3499abcb450d86815b9ac9
MD5 6f2b44d5cbbf44a2e5b5d06db71a449e
BLAKE2b-256 f863bffe82a5ea9b1e1f1e0f3090fe0d75322384bed172acb025f73250f43295

See more details on using hashes here.

Provenance

The following attestation bundles were made for agentsim_sdk-0.23.1-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

This release

0.23.1 This release

2 files

0.23.0

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