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

Uploaded Python 3

File details

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

File metadata

  • Download URL: agentsim_sdk-0.22.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.22.1.tar.gz
Algorithm Hash digest
SHA256 fa6dacd8d213e410685c265d52019bd2515c6632209c28603926c75c018bb41d
MD5 415fe271fe05c99504a6a7bba8c7e94d
BLAKE2b-256 494a7c8aa2efdddac3848406703c971ad2bfa80fe9eb7287b2ca040697d96e2d

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: agentsim_sdk-0.22.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.22.1-py3-none-any.whl
Algorithm Hash digest
SHA256 e14d48b539c1e3bf50773e7824cd2440a2b8630225b23fa5e3826c1a480a525a
MD5 15c7da40358da241666b20a9251745fe
BLAKE2b-256 967a87eff8a94c85d8f76198e5775320c95ce6d9d977211470922c7113e49cf5

See more details on using hashes here.

Provenance

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

0.23.1

2 files

0.23.0

2 files

This release

0.22.1 This release

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