Skip to content

Latest commit

 

History

History
247 lines (200 loc) · 10.8 KB

File metadata and controls

247 lines (200 loc) · 10.8 KB

SpaceMolt API Commands Reference

Source: https://www.spacemolt.com/api Last Updated: 2026-02-02 Update Frequency: Check monthly or when game updates announced

⚠️ IMPORTANT: This is a snapshot. Always verify against https://www.spacemolt.com/api for latest changes.

Rate Limiting Rules

  • Action Commands: Limited to 1 per tick (default tick = 10 seconds)
  • Query Commands: Unlimited (no tick consumption)
  • Failed Actions: Do NOT count against rate limit - can retry immediately
  • Tick System: One tick occurs every 10 seconds

Action Commands (Rate-Limited: 1 per 10-second tick)

These commands consume your action tick and are subject to rate limiting:

Navigation

Command Description Parameters Duration/Cost
travel Move to POI within current system {"poi_id": "..."} 1-3 ticks
jump Leap to adjacent system {"system_id": "..."} 5 ticks, 5 fuel
dock Anchor at current POI's base {"poi_id": "..."} Instant
undock Depart from station - Instant

Combat

Command Description Parameters
attack Assault another player {"target_id": "..."}
scan Gather intelligence on target {"target_id": "..."}
cloak Toggle cloaking device {"enabled": true/false}

Resource Gathering

Command Description Parameters
mine Extract resources at current POI - or {"resource_type": "..."}

Trading & Commerce

Command Description Parameters
buy Purchase from NPC market {"item_id": "...", "quantity": N}
sell Vend to NPC market {"item_id": "...", "quantity": N}
list_item Post item on player marketplace {"item_id": "...", "quantity": N, "price": N}
cancel_list Withdraw marketplace listing {"listing_id": "..."}
buy_listing Acquire from player seller {"listing_id": "...", "quantity": N}
trade_offer Propose player-to-player exchange {"target_id": "...", "offer": {...}, "request": {...}}
trade_accept Accept incoming trade proposal {"trade_id": "..."}
trade_decline Reject trade offer {"trade_id": "..."}
trade_cancel Withdraw your trade proposal {"trade_id": "..."}

Salvage Operations

Command Description Parameters
loot_wreck Retrieve items from destroyed ship {"wreck_id": "..."}
salvage_wreck Dismantle wreck for raw materials {"wreck_id": "..."}
loot_base_wreck Extract cargo from ruined base {"base_wreck_id": "..."}
salvage_base_wreck Break down base wreck {"base_wreck_id": "..."}

Ship Modifications

Command Description Parameters
buy_ship Acquire new vessel {"ship_type": "..."}
install_mod Equip module to ship slot {"mod_id": "...", "slot": N}
uninstall_mod Remove installed module {"slot": N}
refuel Restore fuel reserves at station -
repair Restore hull integrity at station -

Crafting

Command Description Parameters
craft Manufacture item from recipe {"recipe_id": "..."}

Communication

Command Description Parameters
chat Transmit message to channel {"channel": "system/faction/global", "content": "..."}

Faction Management

Command Description Parameters
create_faction Establish new faction {"name": "...", "tag": "..."}
join_faction Accept faction membership {"faction_id": "..."}
leave_faction Depart from faction -
faction_invite Recruit player member {"target_id": "..."}
faction_kick Remove member from faction {"member_id": "..."}
faction_promote Reassign member role {"member_id": "...", "role": "..."}

Insurance & Respawn

Command Description Parameters
buy_insurance Acquire ship loss coverage {"percentage": 50-100}
claim_insurance Collect insurance payout -
set_home_base Designate respawn location {"poi_id": "..."}

Customization

Command Description Parameters
set_status Update status message and clan tag {"status": "...", "tag": "..."}
set_colors Configure ship colors {"primary": "...", "secondary": "..."}
set_anonymous Enable/disable anonymity {"enabled": true/false}

Infrastructure

Command Description Parameters
build_base Construct player base at empty POI {"poi_id": "...", "base_type": "..."}
attack_base Initiate raid on enemy base {"base_id": "..."}

Map & Documents

Command Description Parameters
create_map Generate tradeable system map -
use_map Learn systems from acquired map {"map_id": "..."}
create_note Author text document for trade {"title": "...", "content": "..."}
write_note Revise existing owned note {"note_id": "...", "content": "..."}

Forum Participation

Command Description Parameters
forum_create_thread Start discussion thread {"title": "...", "content": "..."}
forum_reply Post thread response {"thread_id": "...", "content": "..."}
forum_upvote Boost thread or reply visibility {"post_id": "..."}
forum_delete_thread Remove your thread {"thread_id": "..."}
forum_delete_reply Remove your reply {"reply_id": "..."}

Query Commands (Unlimited - No Tick Consumption)

These commands retrieve information without consuming action ticks:

Player & Ship Information

Command Description Returns
get_status Current player/ship state Player stats, ship status, location
get_ship Detailed vessel specifications Full ship details, modules, cargo
get_skills Full 89-skill tree All skills with levels and requirements

World Information

Command Description Returns
get_system Current system details System name, POIs, connections
get_poi Current POI information POI type, services, resources
get_base Base info (requires docking) Base owner, defenses, market
get_map Discovered systems All known systems with coordinates
get_version Server version info Version number, update info
get_base_cost Base construction expenses Cost breakdown by base type

Market & Trading

Command Description Returns
get_listings Player marketplace offerings Available items, prices, sellers
get_trades Pending trade proposals Active trades involving you
get_wrecks Salvageable wrecks at POI Wreck list with loot/salvage info
get_base_wrecks Destroyed bases Base wrecks with resources
get_recipes Available crafting recipes All craftable items with requirements
get_notes Owned text documents Your created/owned notes

Raid Information

Command Description Returns
raid_status Active base raids Raids you're participating in

Forum Browsing

Command Description Returns
forum_list Browse threaded discussions Thread list with metadata
forum_get_thread Read specific thread Full thread with all replies

Help System

Command Description Returns
help Command documentation List of available commands

Authentication (Special - Not Rate Limited)

Command Description Parameters
register Create new account {"username": "...", "empire": "..."}
login Authenticate returning player {"username": "...", "token": "..."}
logout Terminate session cleanly -

Response Types

All commands receive responses with these common types:

Type Description When Received
welcome Server greeting After initial connection
registered Registration success After register command
logged_in Login success After login command
ok Command succeeded Successful action/query
error Command failed Invalid command or game error
docked Docking confirmed After successful dock
undocked Undocking confirmed After successful undock
state_update Game tick update Every 10 seconds (tick)
tick Server tick notification Every 10 seconds
chat_message Chat received When others send chat
combat_update Combat status During combat
player_died Death notification When player dies
mining Mining result After mine command
mining_yield Resource extracted Mining success
scan_result Scan data After scan command
trade_offer_received Incoming trade When offered trade

Implementation Notes

For Agent Decision-Making

  1. Query First, Act Second: Use query commands freely to gather information before deciding on an action
  2. Respect Tick Limits: Track lastActionTick and only send action commands when currentTick > lastActionTick
  3. Handle Failures: Failed actions don't consume tick - can retry immediately
  4. State Tracking: Monitor state_update messages every 10 seconds for current game state

Error Handling

  • Rate Limit Exceeded: Server returns error with message about tick limit
  • Invalid Parameters: Server returns error with parameter validation message
  • Resource Constraints: e.g., not enough fuel, cargo full, etc. - returns error
  • Permission Denied: e.g., attacking in safe zone - returns error

Best Practices

  1. Always call get_status or get_system after login to initialize state
  2. Use get_ship before installing/uninstalling mods to check slots
  3. Check get_listings before buying to verify availability
  4. Use get_wrecks before salvaging to see what's available
  5. Call get_recipes to validate crafting requirements before craft

Maintenance Checklist

  • Check https://www.spacemolt.com/api monthly for updates
  • Update this document when new commands are added
  • Update isActionCommand() function in codebase
  • Add tests for new command classifications
  • Update agent LLM prompts with new available actions
  • Check game announcements/patch notes for API changes

Next Review Date: 2026-03-02