The Splat Labs API

Write Cooper Academy courses from your own tools or with an AI helper, and read the course and game catalogs.

What the API does

The API is a small set of web addresses that answer in JSON. Some are free and need nothing: they list the published courses and games. The rest need an API key, and they let you work on your own Academy courses. You can make a course, save its chapters, check it, search it, publish it and roll it back, all without opening the course builder.

Every address starts with https://splatlabs.games/api/v1. This is version 1. We won't rename or remove anything in version 1, so what you build keeps working. New fields may be added to answers, so ignore fields you don't know.

AI helpers such as Claude Code can also use it as an MCP server. See Using it from an AI helper.

Getting an API key

Sign in, open API keys in your account, and press Make a key. Give it a name, and choose whether it may only read or may also write. The key is shown once, so copy it straight away. An account can have up to 10 keys.

Send the key in the Authorization header of each request, as Bearer sl_.... A key works like a password: keep it out of web pages and shared code. If someone else might have it, turn it off on the same page, and it stops working at once.

Any grown-up's account can make keys. Writing courses needs an account that can make courses, as in the course builder: Creators whom Splat Labs has let make courses. Other keys get course_maker_required from the course endpoints.

Making requests

Send and expect JSON, except where a table below says otherwise. This asks who a key belongs to:

curl https://splatlabs.games/api/v1/me \
  -H "Authorization: Bearer $SPLAT_LABS_KEY"

Errors

An error always has the same shape. Check code in your code: it never changes. message is for people and may be reworded. details lists each problem and where it is, when there are several.

{
  "error": {
    "code": "invalid_course",
    "message": "That course can't be saved. See details for each problem.",
    "details": [
      {
        "path": "content.chapters[0].title",
        "message": "Too small: expected string to have >=1 characters"
      }
    ]
  }
}

How many requests

WhoLimit
Each API key120 requests a minute and 10,000 a day
Free endpoints, for each address60 requests a minute
PublishingThe same as the course builder's Publish button: a few a minute

Over a limit, the answer is 429 with a Retry-After header saying how many seconds to wait.

Free endpoints

These need no key. Lists come 12 to a page: send page for the next page, and read pageCount to know when to stop.

RequestWhat it gives
GET /coursesPublished courses. Search with q, and sort with sort: newest, highest_rated or most_taken.
GET /courses/{id}A published course's newest version, every chapter and section.
GET /gamesPublished games. Search with q, and pick a kind with type.
GET /games/{id}One published game's card.
GET /course-formatThe course format, in Markdown, ready to hand to an AI.
GET /openapi.jsonThe whole API as an OpenAPI 3.1 file.

Course endpoints

These need a key, and work only on your own courses. A read key can use the GET requests and the check. Everything else needs a key that can write.

RequestWhat it does
GET /meWho the key belongs to, and whether they can make courses.
GET /my/coursesYour courses, with where each one's review is.
GET /my/courses/searchFinds words in your drafts. Send q, and course to search one course only.
POST /my/coursesMakes a course. Send a form with title, summary and poster: a WebP picture of at most 300 KB.
GET /my/courses/{id}The whole draft. Its ETag header is the draft's revision.
PUT /my/courses/{id}Saves the whole draft: title, summary and content.
DELETE /my/courses/{id}Deletes a course that was never published.
POST /my/courses/{id}/checkLists what would stop a draft being published, without saving it.
PUT /my/courses/{id}/posterA new poster. Send the WebP picture as the body, with Content-Type: image/webp.
POST /my/courses/{id}/publicationSends the saved draft to review, to publish it.
GET /my/courses/{id}/publicationWhere the review is.
DELETE /my/courses/{id}/publicationTakes the draft back out of review.
GET /my/courses/{id}/versionsEvery published version, newest first.
GET /my/courses/{id}/versions/{n}One published version, as it was.
POST /my/courses/{id}/versions/{n}/rollbackBrings back an older version as the newest one.

Writing a course, step by step

1. Make the course

A course starts with its name, a sentence about it, and a poster picture. The answer holds the new course, with its id and a first chapter with one empty section.

curl https://splatlabs.games/api/v1/my/courses \
  -H "Authorization: Bearer $SPLAT_LABS_KEY" \
  -F title="Make an enemy jump" \
  -F summary="Write your first Splat Script." \
  -F poster=@poster.webp

2. Save the chapters and sections

Send the whole draft each time. Put the ETag you last read in If-Match: if the draft was saved since, in the course builder or anywhere else, the answer is 412 with draft_changed, and nothing is overwritten. Read it again, then save.

curl -X PUT https://splatlabs.games/api/v1/my/courses/COURSE_ID \
  -H "Authorization: Bearer $SPLAT_LABS_KEY" \
  -H "Content-Type: application/json" \
  -H 'If-Match: "3"' \
  --data @course.json

The draft is saved even when a student couldn't use it yet, so you can work on it bit by bit. The answer's problems lists what to fix before publishing.

3. Check it

The check finds a quiz with no right answer, a script the game can't read, or a quiz section with no quiz. Send a draft to check it before saving, or no body to check the saved draft.

curl -X POST https://splatlabs.games/api/v1/my/courses/COURSE_ID/check \
  -H "Authorization: Bearer $SPLAT_LABS_KEY"

4. Publish it

Publishing sends the saved draft to the same review the course builder uses. The answer comes straight away with 202. Ask for the publication every few seconds until its review.status is published, or changes_needed with feedback saying what to change.

curl -X POST https://splatlabs.games/api/v1/my/courses/COURSE_ID/publication \
  -H "Authorization: Bearer $SPLAT_LABS_KEY"

curl https://splatlabs.games/api/v1/my/courses/COURSE_ID/publication \
  -H "Authorization: Bearer $SPLAT_LABS_KEY"

Search finds words anywhere in your drafts: course names and summaries, chapter names, parent notes, section names and section Markdown. It searches drafts, so it finds changes you haven't published yet. Use it to check a course is still right after a change, such as finding every section that uses a Splat Script word.

Send words, and put a phrase in quotes to find it as written. A place matches when it holds every word and phrase, in any case.

curl -G https://splatlabs.games/api/v1/my/courses/search   -H "Authorization: Bearer $SPLAT_LABS_KEY"   --data-urlencode 'q="when I see the hero"'

Each place in places says which course, chapter and section it is in, and which part (field), such as markdown. Its lines give the first matching lines with their line numbers, and builderUrl opens the course builder. You get up to 100 places; truncated is true when there were more.

The course format

A course has chapters, and each chapter has sections. Each section is a piece of Markdown with a kind, which says how a student finishes it: by reading it, watching a video, pressing Play in a code widget, answering a quiz, or passing a challenge's tests.

Sections can hold code widgets, tests, quizzes and game buttons, written as Markdown fences. The full format, with every limit and a whole example course, is at /api/v1/course-format. It is written so you can hand it straight to an AI helper along with what you want the course to teach.

Courses are for kids of about 9. Write in short sentences and plain words, and look up Splat Script words in the help rather than guessing them.

Using it from an AI helper (MCP)

The API is also an MCP server. AI helpers such as Claude Code, Cursor and VS Code can use it straight away, without you writing any code. Each MCP tool does exactly what one endpoint does, with the same key, the same limits and the same error codes.

Connecting

The server's address is https://splatlabs.games/api/mcp. It always needs an API key, even for tools whose endpoint is free. A read key can use the tools that read and the check. The other tools need a key that can write.

In Claude Code, run this once:

claude mcp add --transport http splatlabs https://splatlabs.games/api/mcp \
  --header "Authorization: Bearer sl_..."

In Cursor, add this to your MCP settings:

{
  "mcpServers": {
    "splatlabs": {
      "url": "https://splatlabs.games/api/mcp",
      "headers": { "Authorization": "Bearer sl_..." }
    }
  }
}

In VS Code, add this to .vscode/mcp.json:

{
  "servers": {
    "splatlabs": {
      "type": "http",
      "url": "https://splatlabs.games/api/mcp",
      "headers": { "Authorization": "Bearer sl_..." }
    }
  }
}

Claude on the web (claude.ai) signs in to MCP servers a different way, so it can't connect yet. Claude Code, Cursor and VS Code can.

The tools

ToolWhat it doesEndpoint
games_listList games.GET /games
games_getGet a game.GET /games/{gameId}
courses_listList courses.GET /courses
courses_getGet a course.GET /courses/{courseId}
courses_formatRead the course format.GET /course-format
account_meWho the key belongs to.GET /me
my_courses_listList my courses.GET /my/courses
my_courses_createMake a course.POST /my/courses
my_courses_searchSearch my courses.GET /my/courses/search
my_courses_getGet my course.GET /my/courses/{courseId}
my_courses_saveSave my course's draft.PUT /my/courses/{courseId}
my_courses_deleteDelete my course. Asks you first.DELETE /my/courses/{courseId}
my_courses_checkCheck my course.POST /my/courses/{courseId}/check
my_courses_set_posterSet my course's poster.PUT /my/courses/{courseId}/poster
my_courses_reviewWhere my course's review is.GET /my/courses/{courseId}/publication
my_courses_publishPublish my course. Asks you first.POST /my/courses/{courseId}/publication
my_courses_withdrawTake my course out of review.DELETE /my/courses/{courseId}/publication
my_courses_versionsList my course's versions.GET /my/courses/{courseId}/versions
my_courses_version_getGet one version of my course.GET /my/courses/{courseId}/versions/{version}
my_courses_rollbackBring back an older version. Asks you first.POST /my/courses/{courseId}/versions/{version}/rollback

Deleting, publishing and rolling back change things for good, so they are marked for your AI helper to ask you first. Most helpers do.

Inputs and answers

A tool's inputs are its endpoint's parameters. A whole draft goes in body, and the draft's draftRevision goes in revision: it does the job of If-Match. Pictures are sent as base64.

The answer is the endpoint's own JSON. An error has the same error.code, with its HTTP status beside it.

The course format and the OpenAPI file are also MCP resources, at splatlabs://course-format and splatlabs://openapi.json.

Error codes

CodeStatusWhat it means
bad_request400The request isn't what the endpoint expects.
invalid_course400The draft can't be saved. See details.
course_has_problems400Students couldn't finish the course as it is. See details.
cannot_publish400The course can't be published yet, such as with no poster.
missing_key401No API key was sent.
invalid_key401The key is wrong, or it has been turned off.
read_only_key403A read-only key tried to change something.
course_maker_required403The account can't make courses.
not_found404There's no such course, game or version, or it isn't yours.
published_course409A published course can't be deleted.
already_newest409That version is already the newest.
too_many_courses409The account has as many courses as it can.
draft_changed412The draft was saved since you read it.
too_big413The course is too big to save.
rate_limited429Too many requests. Wait, then try again.
server_error500Something went wrong on our side. Try again.