Reg Router / API
Tokens

Driving Reg Router from code

Base URL https://api.skillsafe.ai/v1/app-api. Every reply is an envelope: {"ok":true,"data":{...}} on success and {"ok":false,"error":{"code","message","status","details"}} on failure. Check ok before reading data.

The two beats

This app has no lanes a user picks. It has two calls: one proposes a plan, the other executes the plan the user confirmed. Send task on every call.

taskwhat it doesfields
planPropose a planquery
executeWrite the memoquery, steps

The run body is the input object. Wrapping it as {"input":{...}} returns 200 and silently hides every field from the model.

Errors

codestatuswhat it means
unauthorized401No token, or the token was revoked. Mint a new one on the tokens page.
forbidden403The token is valid but not allowed here — this is what a reference declared access:"run" returns to a browser.
not_found404Unknown app or endpoint. A private app returns 404 rather than 403 to anyone who is not the publisher.
validation_error400The input did not match the declared schema. details.violations names the field.
insufficient_credits402Balance below min_credits. Call /estimate first and compare against /me.
rate_limited429Back off and retry. Never tight-loop.

Step 1 — get a token

Open the tokens page and copy the token this browser holds. Paste it wherever these samples say YOUR_TOKEN.

Step 2 — who am I

/me carries only subject_type, subject_id and credits. Signed-in means subject_type === "user".

Step 3 — price it first

/estimate costs nothing and creates no job. It returns hold_credits (what is reserved, priced at the full output cap) and min_credits. Show the hold as reserved, never as the price — the settled charge is usually far lower.

Step 4 — run

Pass an Idempotency-Key header on every run. Replaying the same key returns the stored result as plain JSON instead of a stream, and is not charged again.

1. task: "plan"

One sentence in, an ordered plan out. The reply is a single JSON object; there is no prose around it.

2. task: "execute"

The confirmed steps back in, the memo out. The reply is Markdown with one ## Step n — Name (id) heading per step.

Step 5 — streaming

/run-stream is Server-Sent Events. From a browser it emits tick heartbeats and then one done frame carrying the whole output — not token deltas — so treat ticks as liveness and done as the result.

What comes back

task: "plan" returns one JSON object with read, regimes, steps[] (each with id, name, regime, cite, why, needs and an optional alt), skipped[] and ask.

task: "execute" returns Markdown: one ## Step n — Name (id) section per confirmed step, each with Obligation, What to do, Evidence to keep and Watch out, then ## Not triggered and ## First move.

On the catalogue

The procedures this app routes over live in a private reference corpus in the release, declared access: "run". It is resolved server-side and appended to the model's context; it is never served to a page and is not readable through this API. Asking for it returns 403.

Reg Router is a map of what to check with a chief compliance officer or counsel. It is not legal advice.