Snake AI API

One endpoint. The name is cleaned before use: letters, numbers, spaces and . + _ - are kept, and anything else is dropped. Other methods get 405 with a JSON message. Send a User-Agent header: Python's default one is rejected with error code: 1010.

POST /api/snake

Send the name of an AI and the snake narrates a short, family-friendly story about swallowing its API. It is make-believe: no provider is contacted.

Hostai.snakeindex.com
Sign-innot needed
Limit8 requests per minute per visitor
BodyJSON: target, 1 to 40 characters
Max body1,000 characters

Request

curl -s -i -X POST https://ai.snakeindex.com/api/snake \
  -H "Content-Type: application/json" \
  -d '{"target":"ChatGPT"}'
const res = await fetch("https://ai.snakeindex.com/api/snake", {
  method: "POST",
  headers: {
    "Content-Type": "application/json",
  },
  body: JSON.stringify({ target: "ChatGPT" }),
});
console.log(res.status, await res.json());
import json
import urllib.request
import urllib.error

req = urllib.request.Request(
    "https://ai.snakeindex.com/api/snake",
    data=json.dumps({"target": "ChatGPT"}).encode(),
    headers={
    "Content-Type": "application/json",
    "User-Agent": "snake-api-client/1.0",
    },
    method="POST",
)
try:
    with urllib.request.urlopen(req) as r:
        status, body = r.status, r.read()
except urllib.error.HTTPError as e:
    status, body = e.code, e.read()
print(status, json.loads(body))

Response

200Story returned
{
  "target": "ChatGPT",
  "story": "…",
  "model": "@cf/meta/llama-4-scout-17b-16e-instruct"
}
200Fallback story when the model is unavailable
{"target":"ChatGPT","story":"…","fallback":true}
400Missing or empty target
{"error":"Tell the snake which AI to hunt (1 to 40 letters or numbers)."}
413Body over 1,000 characters
{"error":"That is too much for one snake."}
429Limit reached
{"error":"The snake is digesting. Give it a minute and try again."}