← HTTP Status Drill
API
Tokens

Run HTTP Status Drill from your own code

The one metered task, round, is available over HTTP. You send your API's endpoint list - one METHOD /path per line - plus the questions you just missed, and get back 10 multiple-choice practice questions about your endpoints: which status code the server should return, or which method the client should use, each with four choices and a one-line reason. It also returns one to three notes about the endpoint list itself.

The division of labour first: the 60-second drill, the general deck of status codes, methods and REST URLs, the scoring and your streaks all run in the browser. That part is free and never calls the API. Only the round step is metered: model alias llm-default, billed per run. The page then checks every question before it joins the drill - see How the page checks the reply.

Base URL and the response shape

Every endpoint lives under https://api.skillsafe.ai/v1/app-api, and every response has one shape:

{ "ok": true,  "data":  { ... } }
{ "ok": false, "error": { "code": "...", "message": "..." } }

The token is minted for this app (the guest call takes {"slug":"http-status-drill"}), so no slug header is needed afterwards. Send it as Authorization: Bearer …. The run body is the input object, sent bare.

StatusCodeMeaning
400validation_errorThe body is not a JSON object, or a required key (task, endpoints, misses) is missing.
401unauthorizedNo token, or a stale one. Mint a guest token or sign in again.
402insufficient_creditsThe balance is under min_credits. Price with /estimate first.
403forbiddenA guest token tried to run: the round run is metered and needs a personal sign-in.
404not_foundUnknown job id.
429rate_limitedBack off and retry.
5xxserver_errorTransient. Retry with the same Idempotency-Key so a retry never double-bills.

The task field and the input

Every run sends task. There is one lane:

LaneWhat it returns
roundExactly 10 practice questions about the endpoints you sent (at least 7 about status codes, the rest about methods) and 1-3 notes. A missing or different task is still answered as round, with a note saying so.

The run input (the POST body for /estimate, /run and /run-stream). All four values are strings:

{"task": "round", "endpoints": "<one METHOD /path per line>", "misses": "<JSON string of an array, may be \"[]\">", "note": "<optional text>"}
KeyRequiredWhat it holds
taskyesAlways round.
endpointsyesYour endpoint list as plain text, one METHOD /path per line, such as POST /orders/{id}/refunds. A short description may follow the path. The page may clip a long list and add a line saying how many lines were left out.
missesyesA JSON string holding an array of short descriptions of questions you just got wrong in the general deck, such as 409 Conflict - creating a user whose email is already registered. Send "[]" when there are none. When it is not empty, at least 3 questions aim at the same ideas, applied to your endpoints.
notenoYour own words: what the API is for, who calls it. May be empty.

The output

The job's output text is ONE JSON object and nothing else - no prose around it, no code fence:

{
  "questions": [
    { "kind": "status", "endpoint": "METHOD /path", "situation": "...", "answer": "409",
      "choices": ["409", "400", "404", "201"], "why": "..." }
  ],
  "notes": [ "..." ]
}
KeyRule
questionsExactly 10 entries. At least 7 have kind status; the rest have kind method.
questions[].endpointOne line of your input, copied exactly as METHOD /path with the same placeholders. Never an endpoint you did not send; one endpoint at most 3 times.
questions[].situationOne sentence, at most 160 characters: a concrete request to that endpoint and what happens, in your resources' words. It never gives away the answer.
questions[].answerFor status: a 3-digit status code as a string. For method: one of GET, POST, PUT, PATCH, DELETE.
questions[].choices4 distinct values of the same kind, the answer among them. Status codes come from a fixed list: 200, 201, 202, 204, 301, 302, 304, 307, 308, 400, 401, 403, 404, 405, 406, 409, 410, 412, 413, 415, 422, 428, 429, 500, 501, 502, 503, 504. Validation errors are 400, and no question offers both 400 and 422.
questions[].whyOne sentence, at most 180 characters: why the answer is right, and often why the tempting wrong choice is wrong.
notes1 to 3 short sentences about the endpoint list itself: a verb in a path, a singular collection name, a method that does not match its action, a missing version prefix - or one note saying the list follows the conventions.

The model uses only the endpoints you sent: no invented endpoints, fields, numbers or limits. An input with no recognisable endpoints returns {"questions":[],"notes":["No endpoints found - list one METHOD /path per line."]}.

How the page checks the reply

The page never adds a question blindly. It reads the JSON and checks every question on its own. A question that fails any check is dropped, and the round plays with the ones that pass:

Worked example - an orders API

Six endpoints for orders and refunds, and one question missed in the general deck. No note.

The request body, exactly as sent (endpoints uses \n between lines; misses is a string):

{
  "task": "round",
  "endpoints": "GET /orders\nPOST /orders\nGET /orders/{id}\nPATCH /orders/{id}\nDELETE /orders/{id}\nPOST /orders/{id}/refunds",
  "misses": "[\"409 Conflict - creating a user whose email is already registered\"]",
  "note": ""
}

An excerpt of a matching reply (the job's output.output). A real reply has 10 questions; two are shown here:

{
  "questions": [
    {"kind": "status", "endpoint": "POST /orders/{id}/refunds", "situation": "The client asks for a refund on an order that has already been refunded in full.", "answer": "409", "choices": ["409", "400", "404", "201"], "why": "The request is well formed but clashes with the order's current state; 400 is for a malformed request."},
    {"kind": "method", "endpoint": "PATCH /orders/{id}", "situation": "The client wants to change only the shipping address on an existing order and leave every other field alone.", "answer": "PATCH", "choices": ["PATCH", "PUT", "POST", "GET"], "why": "Changing some fields is PATCH; PUT replaces the whole order."}
    /* ... 8 more questions ... */
  ],
  "notes": [
    "The paths use plural nouns and no verbs; consider a version prefix such as /v1 in front of /orders."
  ]
}

What the page does with it: both questions pass every check - four distinct choices with the answer among them, known values only, and endpoints copied from the list. The first one aims at the missed idea (409 for a clash with the current state) on your own refunds endpoint.

Step 1 — a tiny client helper

One function that sends JSON and unwraps the response. Paste a personal token from /tokens.html, or leave it empty and mint a guest token in step 2.

BASE="https://api.skillsafe.ai/v1/app-api"
TOKEN="YOUR_TOKEN"   # from https://http-status-drill.skillsafe.ai/tokens.html
api() { # api METHOD PATH [JSON-BODY]
  curl -s -X "$1" "$BASE$2" -H "Content-Type: application/json" \
    ${TOKEN:+-H "Authorization: Bearer $TOKEN"} ${3:+--data "$3"}
}

Step 2 — a token

A guest token is enough for /me and /estimate. A run is metered, so it needs a personal token: sign in on /tokens.html and copy it from there.

# a guest token (enough for /me and /estimate); a run needs your personal token from /tokens.html
TOKEN=$(curl -s -X POST "$BASE/guest" -H "Content-Type: application/json" -d '{"slug":"http-status-drill"}' | jq -r '.data.token')

Step 3 — GET /me

Who the token is (subject_type: user or guest) and the credit balance.

api GET /me | jq '.data | {subject_type, credits}'

Step 4 — POST /estimate

Free. The body is the run input itself, the bare object (never wrapped in {"input": ...}). hold_credits is a reservation, not the price; min_credits is what the balance must cover; model_alias reads llm-default and warnings lists anything worth fixing in the input. Save the worked example's request body as input.json.

# input.json: the run input object - {"task": "round", "endpoints": "GET /orders\nPOST /orders\nGET /orders/{id}\nPATCH /orders/{id}\nDELETE /orders/{id}\nPOST /orders/{id}/refunds", "misses": "[\"409 Conflict - creating a user whose email is already registered\"]", "note": ""}
api POST /estimate "$(cat input.json)" | jq '.data | {hold_credits, min_credits, model, model_alias, warnings}'

Step 5 — POST /run, then poll the job

Send an Idempotency-Key built from the lane and the input: a retry with the same key never bills twice. The page uses http-status-drill:<task>:<inputHash>:a<attempt> (the one task is round). The job's output.output is the reply text - one JSON object; truncated: true means the balance cut it short, and the complete questions that did arrive are still usable.

KEY="http-status-drill:round:$(shasum -a 256 input.json | cut -c1-16):a1"
JOB=$(curl -s -X POST "$BASE/run" -H "Content-Type: application/json" -H "Authorization: Bearer $TOKEN" \
  -H "Idempotency-Key: $KEY" --data @input.json | jq -r '.data.job_id')
while :; do
  J=$(api GET "/jobs/$JOB"); S=$(echo "$J" | jq -r '.data.status')
  case "$S" in succeeded|failed|cancelled) break;; esac; sleep 2
done
echo "$J" | jq -r '.data.output.output' > reply.json   # one JSON object, the reply contract
echo "$J" | jq '.data | {charged_credits, truncated}'
jq -r '.questions[]? | "[\(.kind)] \(.endpoint): \(.situation)\n   answer \(.answer) of \(.choices | join(", ")) - \(.why)"' reply.json
jq -r '.notes[]?' reply.json

Step 6 — POST /run-stream

The same run as Server-Sent Events, with the same input.json. Browsers receive progress ticks rather than text deltas; the final done event carries the job, whose output.output is the reply.

# Server-Sent Events: tick/delta events while the job runs, then a final event with the job
curl -N -s -X POST "$BASE/run-stream" -H "Content-Type: application/json" -H "Authorization: Bearer $TOKEN" \
  -H "Idempotency-Key: http-status-drill:round:$(shasum -a 256 input.json | cut -c1-16):a1" --data @input.json