Each section issues one real HTTP request to 127.0.0.1:8765 and shows the raw response.
Server-Sent Events — /api/events
SSE/api/eventsdisconnected
Persistent push stream. The server sends events as they occur. No polling needed.
frame: 0z80_bp: 0basic_bp: 0pause: 0reset: 0
— connect to start receiving events —
Self-Documentation — /api/doc
GET/api/doc
List every documented endpoint (path, HTTP methods, one-line summary). Machine-readable contract for the whole API below — source of truth: amspirit-helpers/src/web_doc.cpp.
—
GET/api/doc/<name>
Detail for one endpoint (all its HTTP methods): params (query/body, type, required/default) and response shape. <name> is the path segment under /api/, e.g. "config" for /api/config.
—
GET Endpoints
GET/api/ping
Connection probe + emulator status (fps, paused, cpc_model, crtc_type). Used by the UI for the connection overlay.
Queue a string for autotype (injected as key events on the CPC)
—
POST/api/keypress
Press a single CPC virtual key by VK number (0x00–0xFF, see CORE_rVK_* constants)
—
POST/api/ram
Write bytes to CPC RAM. data = hex string. exec=true → also set PC to entry. Queued (several calls in the same tick all apply, in order) — response includes a "seq"; poll /api/state's emu.ram_apply_seq until it reaches that value before trusting a readback.
—
POST/api/exec
Set Z80 PC to addr and resume execution (no RAM write). Same queue/"seq" contract as POST /api/ram above.
—
POST/api/basic?reset=…&run=…
Inject BASIC source (raw text body, not JSON). reset=1 → hard reset first. run=1 → RUN after inject.
—
POST/api/script?lang=…
Run a CSL or Lua script (raw text body). ?lang=lua for Lua, default = CSL.
—
POST/api/disk— action: create
Create a blank disk image in the given drive (0=A, 1=B)
—
POST/api/disk— action: save (triggers browser download)
Save current disk image as .dsk file (response is binary — triggers download via <a>)
—
POST/api/lang
Change UI language {"lang":"en"|"fr"|"es"|"de"}
—
POST/api/keymap
Remap a key: kc (keycode hex), vk (CPC VK for unshifted), vk_s (shifted), nomod (bool)
—
DELETE Endpoints
DELETE/api/script
Abort the currently running CSL/Lua script
—
DELETE/api/codemap
Reset the executed-instruction bitmap and the instruction history