Client Reference¶
- class artifacts.AsyncArtifactsClient(token=None, *, base_url='https://api.artifactsmmo.com', auto_wait=True, retry=None)[source]¶
Bases:
objectAsync SDK client for the Artifacts MMO API.
Use as an async context manager:
async with AsyncArtifactsClient(token="your_token") as client: char = client.character("MyChar") await char.move(x=0, y=1) # auto-waits cooldown await char.fight() # auto-waits cooldown
- Parameters:
token (Optional[str]) – JWT token for authentication. Generate one via
client.token.generate(username, password)or pass an existing token.base_url (str) – API base URL. Defaults to the production server.
auto_wait (bool) – If
True(default), every action automatically sleeps until its cooldown expires. Disable globally here or per-character/per-call.retry (Optional[RetryConfig]) – Custom retry configuration. Defaults to 3 retries with exponential backoff.
- property auto_wait: bool¶
Whether actions automatically sleep until their cooldown expires.
Setting this on the client affects all characters that were created without an explicit per-character override:
client.auto_wait = False # disable globally client.auto_wait = True # re-enable globally
- class artifacts.sync_client.ArtifactsClient(token=None, *, base_url='https://api.artifactsmmo.com', auto_wait=True, retry=None)[source]¶
Bases:
objectSynchronous SDK client for the Artifacts MMO API.
No
async/awaitneeded – every call blocks until complete:from artifacts import ArtifactsClient with ArtifactsClient(token="your_token") as client: char = client.character("MyChar") info = char.get() print(f"{info.name} lv{info.level}") char.move(x=0, y=1) # blocks, auto-waits cooldown result = char.fight() # blocks, auto-waits cooldown char.skills.craft(code="iron_sword") char.bank.deposit_gold(quantity=100)
- Parameters:
- property auto_wait: bool¶
Whether actions automatically sleep until their cooldown expires.
Setting this on the client affects all characters that were created without an explicit per-character override:
client.auto_wait = False # disable globally client.auto_wait = True # re-enable globally
- property server: _SyncProxy¶
- property token: _SyncProxy¶
- property accounts: _SyncProxy¶
- property my_account: _SyncProxy¶
- property characters: _SyncProxy¶
- property achievements: _SyncProxy¶
- property badges: _SyncProxy¶
- property effects: _SyncProxy¶
- property events: _SyncProxy¶
- property grand_exchange: _SyncProxy¶
- property items: _SyncProxy¶
- property leaderboard: _SyncProxy¶
- property maps: _SyncProxy¶
- property monsters: _SyncProxy¶
- property npcs: _SyncProxy¶
- property resources: _SyncProxy¶
- property tasks: _SyncProxy¶
- property simulation: _SyncProxy¶
- property sandbox: _SyncProxy¶
- class artifacts.http.RetryConfig(max_retries=3, base_delay=1.0, max_delay=30.0, retry_on_status=(429, 500, 502, 503, 504), retry_on_cooldown=True)[source]¶
Configuration for automatic request retries.
- Parameters:
max_retries (int) – Maximum number of retry attempts (default 3).
base_delay (float) – Initial delay in seconds before the first retry (default 1.0).
max_delay (float) – Maximum delay cap in seconds for exponential backoff (default 30.0).
retry_on_status (tuple[int, ...]) – HTTP status codes that trigger a retry.
retry_on_cooldown (bool) – If
True, automatically wait and retry onCooldownActiveError(status 499).