Client

The Client is your entry point to the Artifacts MMO API.

Purpose:

  • Authenticate with your API token

  • Query game data (items, monsters, maps, resources)

  • Create Character controllers

There are two client types:

  • ArtifactsClient - Synchronous (blocking)

  • AsyncArtifactsClient - Asynchronous (non-blocking)

Sync Client

Use the sync client for simple scripts and tools:

from artifacts import ArtifactsClient

with ArtifactsClient(token="your_token") as client:
    # Query game data
    items = client.get_all_items()

    # Control a character
    char = client.character("MyCharacter")
    char.move(x=1, y=2)
class artifacts.ArtifactsClient[source]

Bases: object

Synchronous SDK client for the Artifacts MMO API.

No async/await needed – 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:
  • token (Optional[str]) – JWT token for authentication.

  • 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.

  • retry (Optional[Any]) – Custom retry configuration.

__init__(token=None, *, base_url='https://api.artifactsmmo.com', auto_wait=True, retry=None)[source]
Parameters:
  • token (str | None)

  • base_url (str)

  • auto_wait (bool)

  • retry (Any | None)

character(name, *, auto_wait=None)[source]

Return a synchronous SyncCharacter controller for name.

Return type:

SyncCharacter

Parameters:
  • name (str)

  • auto_wait (bool | None)

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
close()[source]

Close the HTTP session.

Return type:

None

Async Client

Use the async client for bots managing multiple characters:

from artifacts import AsyncArtifactsClient
import asyncio

async def main():
    async with AsyncArtifactsClient(token="your_token") as client:
        # Control multiple characters in parallel
        char1 = client.character("Fighter")
        char2 = client.character("Mage")

        await asyncio.gather(
            char1.fight(),
            char2.fight()
        )

asyncio.run(main())
class artifacts.AsyncArtifactsClient[source]

Bases: object

Async 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.

__init__(token=None, *, base_url='https://api.artifactsmmo.com', auto_wait=True, retry=None)[source]
Parameters:
  • token (str | None)

  • base_url (str)

  • auto_wait (bool)

  • retry (RetryConfig | None)

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
character(name, *, auto_wait=None)[source]

Return a Character controller for name.

Parameters:
  • auto_wait (Optional[bool]) – Override the client-level auto_wait setting for this character. If None (default), the character shares the client reference and will reflect any future changes to client.auto_wait automatically.

  • name (str)

Return type:

Character

async start()[source]

Start the HTTP session (called automatically by __aenter__).

Return type:

None

async close()[source]

Close the HTTP session (called automatically by __aexit__).

Return type:

None