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
| Who | Limit |
|---|---|
| Each API key | 120 requests a minute and 10,000 a day |
| Free endpoints, for each address | 60 requests a minute |
| Publishing | The 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.
| Request | What it gives |
|---|---|
GET /courses | Published 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 /games | Published games. Search with q, and pick a kind with type. |
GET /games/{id} | One published game's card. |
GET /course-format | The course format, in Markdown, ready to hand to an AI. |
GET /openapi.json | The 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.
| Request | What it does |
|---|---|
GET /me | Who the key belongs to, and whether they can make courses. |
GET /my/courses | Your courses, with where each one's review is. |
GET /my/courses/search | Finds words in your drafts. Send q, and course to search one course only. |
POST /my/courses | Makes 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}/check | Lists what would stop a draft being published, without saving it. |
PUT /my/courses/{id}/poster | A new poster. Send the WebP picture as the body, with Content-Type: image/webp. |
POST /my/courses/{id}/publication | Sends the saved draft to review, to publish it. |
GET /my/courses/{id}/publication | Where the review is. |
DELETE /my/courses/{id}/publication | Takes the draft back out of review. |
GET /my/courses/{id}/versions | Every published version, newest first. |
GET /my/courses/{id}/versions/{n} | One published version, as it was. |
POST /my/courses/{id}/versions/{n}/rollback | Brings 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.webp2. 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.jsonThe 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"Searching your courses
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
| Tool | What it does | Endpoint |
|---|---|---|
games_list | List games. | GET /games |
games_get | Get a game. | GET /games/{gameId} |
courses_list | List courses. | GET /courses |
courses_get | Get a course. | GET /courses/{courseId} |
courses_format | Read the course format. | GET /course-format |
account_me | Who the key belongs to. | GET /me |
my_courses_list | List my courses. | GET /my/courses |
my_courses_create | Make a course. | POST /my/courses |
my_courses_search | Search my courses. | GET /my/courses/search |
my_courses_get | Get my course. | GET /my/courses/{courseId} |
my_courses_save | Save my course's draft. | PUT /my/courses/{courseId} |
my_courses_delete | Delete my course. Asks you first. | DELETE /my/courses/{courseId} |
my_courses_check | Check my course. | POST /my/courses/{courseId}/check |
my_courses_set_poster | Set my course's poster. | PUT /my/courses/{courseId}/poster |
my_courses_review | Where my course's review is. | GET /my/courses/{courseId}/publication |
my_courses_publish | Publish my course. Asks you first. | POST /my/courses/{courseId}/publication |
my_courses_withdraw | Take my course out of review. | DELETE /my/courses/{courseId}/publication |
my_courses_versions | List my course's versions. | GET /my/courses/{courseId}/versions |
my_courses_version_get | Get one version of my course. | GET /my/courses/{courseId}/versions/{version} |
my_courses_rollback | Bring 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
| Code | Status | What it means |
|---|---|---|
bad_request | 400 | The request isn't what the endpoint expects. |
invalid_course | 400 | The draft can't be saved. See details. |
course_has_problems | 400 | Students couldn't finish the course as it is. See details. |
cannot_publish | 400 | The course can't be published yet, such as with no poster. |
missing_key | 401 | No API key was sent. |
invalid_key | 401 | The key is wrong, or it has been turned off. |
read_only_key | 403 | A read-only key tried to change something. |
course_maker_required | 403 | The account can't make courses. |
not_found | 404 | There's no such course, game or version, or it isn't yours. |
published_course | 409 | A published course can't be deleted. |
already_newest | 409 | That version is already the newest. |
too_many_courses | 409 | The account has as many courses as it can. |
draft_changed | 412 | The draft was saved since you read it. |
too_big | 413 | The course is too big to save. |
rate_limited | 429 | Too many requests. Wait, then try again. |
server_error | 500 | Something went wrong on our side. Try again. |

