← Env File Checker
Your token

Env File Checker API

Reading and checking the .env file and writing the .env.example, the fixed .env, JSON and the Compose block all run free in the browser and need no API. The API is for the one metered step: send the variable names and what the page found about each value (never the value), and get back, as JSON, a one-line comment for each variable, where to get its value, whether it holds a credential and whether the app needs it, plus up to four notes. The page uses a comment only for a name that is in the file and only if it carries nothing shaped like a credential.

Base URL: https://api.skillsafe.ai/v1/app-api. Every response is {"data": ...} or {"error": {"code", "message"}}; read error.code and error.message rather than the HTTP status alone.

The task field

This app has one task. Always send "task": "document".

taskWhat it doesReply
documentReads each variable name with its kind and shape and writes what it configures, where to get the value, whether it is a secret and whether it is required, plus notes on risks the flags show. It never sees or writes a value.One JSON object

Input fields

All values are strings. task and vars are required.

FieldMeaning
task"document"
projectOptional one-line description of the project, up to 300 characters, e.g. "Laravel shop with Pusher".
varsJSON text: a list of entries in file order, each with key (the name), kind (secret, setting or empty), shape (empty, boolean, number, word, text, list, email, path, url, local-url, url-with-password, random-looking, placeholder, reference or multiline), and when they apply format (a matched key format), browser: true (a NEXT_PUBLIC_-style prefix) and flags (problem codes such as public-secret, weak, placeholder, duplicate, undefined-ref). At most 200 entries. Never put a value in it.
vars_noteEmpty, or a sentence saying what was cut.

The reply

job.output.output is text holding one JSON object (sometimes inside a ```json fence) with two keys: vars, a list of {key, about, where, secret, required} in input order (secret is a boolean, required is required, optional or unknown), and notes, 0 to 4 strings. Before using a comment, check that its key is one you sent and that it holds nothing shaped like a credential; the page does both and keeps a value out of the example when either side calls it a secret. If the balance ran low, truncated is true and the object may stop early; the page keeps every entry that arrived whole.

Worked example

Input (input.json), the Next.js sample on the page (11 variables):

{
  "task": "document",
  "project": "Next.js shop with Stripe payments and Postgres",
  "vars": "[{\"key\":\"NODE_ENV\",\"kind\":\"setting\",\"shape\":\"word\"},{\"key\":\"NEXT_PUBLIC_SITE_URL\",\"kind\":\"setting\",\"shape\":\"local-url\",\"browser\":true},{\"key\":\"NEXT_PUBLIC_ANALYTICS_ID\",\"kind\":\"setting\",\"shape\":\"word\",\"browser\":true},{\"key\":\"DATABASE_URL\",\"kind\":\"secret\",\"shape\":\"url-with-password\"},{\"key\":\"NEXTAUTH_URL\",\"kind\":\"setting\",\"shape\":\"local-url\",\"flags\":[\"duplicate\"]},{\"key\":\"NEXTAUTH_SECRET\",\"kind\":\"secret\",\"shape\":\"placeholder\",\"flags\":[\"placeholder\"]},{\"key\":\"NEXT_PUBLIC_STRIPE_SECRET_KEY\",\"kind\":\"secret\",\"shape\":\"random-looking\",\"browser\":true,\"flags\":[\"public-secret\"]},{\"key\":\"STRIPE_WEBHOOK_SECRET\",\"kind\":\"secret\",\"shape\":\"random-looking\"},{\"key\":\"SMTP_HOST\",\"kind\":\"setting\",\"shape\":\"word\"},{\"key\":\"SMTP_PASSWORD\",\"kind\":\"secret\",\"shape\":\"word\",\"flags\":[\"spaces-eq\",\"weak\"]},{\"key\":\"ADMIN_EMAILS\",\"kind\":\"setting\",\"shape\":\"list\"}]",
  "vars_note": ""
}

Reply:

{"vars":[{"key":"NODE_ENV","about":"Selects development or production mode for Node.js and Next.js.","where":"","secret":false,"required":"optional"},{"key":"NEXT_PUBLIC_SITE_URL","about":"Appears to be the public base URL of the site, readable in the browser.","where":"The address the site is served from; use the live domain in production.","secret":false,"required":"optional"},{"key":"NEXT_PUBLIC_ANALYTICS_ID","about":"Appears to be an analytics tracking id, shipped to the browser.","where":"Your analytics provider's dashboard.","secret":false,"required":"optional"},{"key":"DATABASE_URL","about":"Connection string for the app's Postgres database.","where":"Your database host's connection settings: user, password, host, port and database name.","secret":true,"required":"required"},{"key":"NEXTAUTH_URL","about":"Canonical base URL of the app, used by NextAuth for callbacks and redirects.","where":"The address the app is served from; the live domain in production.","secret":false,"required":"required"},{"key":"NEXTAUTH_SECRET","about":"Secret NextAuth uses to sign and encrypt session tokens and cookies.","where":"Generate with `openssl rand -base64 32`.","secret":true,"required":"required"},{"key":"NEXT_PUBLIC_STRIPE_SECRET_KEY","about":"Appears to be a Stripe secret API key, but its prefix ships it to browsers.","where":"Stripe Dashboard, developers API keys page.","secret":true,"required":"unknown"},{"key":"STRIPE_WEBHOOK_SECRET","about":"Signing secret used to verify webhook events sent by Stripe.","where":"Stripe Dashboard webhook endpoint details, or the Stripe CLI when testing locally.","secret":true,"required":"optional"},{"key":"SMTP_HOST","about":"Hostname of the SMTP server used to send email.","where":"Your email provider's SMTP settings.","secret":false,"required":"optional"},{"key":"SMTP_PASSWORD","about":"Password for logging in to the SMTP server.","where":"Your email provider's SMTP credentials page.","secret":true,"required":"optional"},{"key":"ADMIN_EMAILS","about":"Appears to be a list of email addresses granted admin access.","where":"Choose the addresses of your admins, separated as the app expects.","secret":false,"required":"unknown"}],"notes":["NEXT_PUBLIC_STRIPE_SECRET_KEY has been shipped to every visitor's browser: rename it without NEXT_PUBLIC_, read it on the server only, and roll the key in the Stripe Dashboard.","NEXTAUTH_SECRET is still a placeholder and SMTP_PASSWORD is weak: generate long random values for both before deploying.","NEXTAUTH_URL appears more than once in the file, so remove the duplicate line to avoid a conflicting value.","SMTP_PASSWORD has spaces around the equals sign, which many parsers read differently, so remove them."]}

On the page, all 11 comments pass the check and appear above their names in the .env.example; the notes appear under "Also worth doing".

Errors

HTTPWhat to do
401The token is missing, expired or a guest token on a run. Get a personal token on the token page.
402The balance is below what the run reserves. Top up at skillsafe.ai/account/billing.
400The body is not a JSON object of the fields above.
429Wait and retry with the same Idempotency-Key.

Step 1 — a tiny client helper

One function that sends JSON and unwraps the {data, error} envelope.

BASE="https://api.skillsafe.ai/v1/app-api"
TOKEN="paste-your-token-here"   # from https://env-file-checker.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 your personal token: sign in on the token page and copy it.

# 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":"env-file-checker"}' | jq -r '.data.token')

Step 3 — who am I, and my balance

subject_type is guest or user; credits is the balance (1 credit = $0.0001).

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

Step 4 — price a run for free

/estimate charges nothing and starts no job. hold_credits is the amount reserved while a run is in flight, not the price; the run is charged what it uses.

# input.json: the run input object - {"task": "document", "project": "Next.js shop with Stripe", "vars": "[...]", "vars_note": ""}
api POST /estimate "$(cat input.json)" | jq '.data | {hold_credits, min_credits, model, model_alias, markup_bps, warnings}' 

Step 5 — run it and wait for the job

Send an Idempotency-Key derived from the input: a retry with the same key is never billed twice.

KEY="env-file-checker:document:$(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: vars, notes
echo "$J" | jq '.data | {charged_credits, truncated}' 

Step 6 — or stream it

/run-stream sends Server-Sent Events while the job runs and the finished job at the end.

# 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: env-file-checker:document:$(shasum -a 256 input.json | cut -c1-16):a1" --data @input.json