Strudel API

SkillAI & models

Control the Strudel REPL via REST APIs. Use when you need to push code, start/stop playback, or check status.

Available today. Use it from your connected AI after setup.

Connect ahel once, and every AI you use reads what you have installed.

Then ask your AI: use the Strudel API skill

What this skill tells your AI

The instructions your AI receives, as published by renatoworks/strudel-claude in .claude/skills/api/SKILL.md and read by ahel’s review.

Talk to the REPL at http://localhost:3000.


Endpoints

EndpointMethodWhat it does
/api/codePOSTPush new code
/api/codeGETRead current code
/api/playPOSTStart playback
/api/stopPOSTStop playback
/api/statusGETGet current state
/api/eventsGETSSE stream (real-time updates)

Real-time sync: The browser connects to /api/events via Server-Sent Events. When you push code or trigger play/stop, the browser updates automatically.


Push Code

curl -X POST http://localhost:3000/api/code \
  -H "Content-Type: application/json" \
  -d '{"code": "YOUR_CODE_HERE"}'

JSON Escaping Rules (CRITICAL)

The API uses JSON.parse(). Invalid escape sequences will cause 500 errors.

Valid JSON escapes (these work):

EscapeMeaning
\"Double quote
\\Backslash
\nNewline
\tTab
\rCarriage return
\/Forward slash

Invalid escapes (these BREAK the API):

  • \x, \a, \s, \d, \w, or any backslash + letter not in the table above
  • Unescaped backslashes

Examples:

# ✅ GOOD - properly escaped
curl -X POST http://localhost:3000/api/code \
  -H "Content-Type: application/json" \
  -d '{"code": "$: s(\"bd sd hh hh\")"}'

# ❌ BAD - \s is not a valid JSON escape
curl -X POST http://localhost:3000/api/code \
  -H "Content-Type: application/json" \
  -d '{"code": "$: s(\"bd\sd\")"}'

Rule of thumb: If you need a literal backslash in the code, escape it as \\


Play / Stop

curl -X POST http://localhost:3000/api/play
curl -X POST http://localhost:3000/api/stop

Typical Flow

  1. Push code
  2. Play

That's it. The REPL handles the rest.


Multi-line Example

curl -X POST http://localhost:3000/api/code \
  -H "Content-Type: application/json" \
  -d '{"code": "setcpm(130/4)\n\n$: s(\"bd*4, hh*8\").bank(\"RolandTR909\")\n\n$: note(\"<c2 g1 ab1 bb1>\").s(\"sawtooth\").lpf(400)"}'

Signals

GitHub stars
63
Forks
7
Last commit
Feb 2026
Advanced
Catalog kind
skill
Gateway key
api-renatoworks
Source
github.com/renatoworks/strudel-claude