Developer Platform
The same Multi-Agent Orchestration Pipeline that runs in the interface runs in your code. Send a prompt. Get back a specification built to hold up across models, runs, and contexts.
Get the finished specification in the response — no job ID to poll.
Every response includes before/after quality scores across 4 dimensions.
Multiple dedicated agents inspect every claim in the output. Opt in per call with integrity: true.
https://promptkaizen.com/api/v1
Every request carries your key as a Bearer token. Generate keys from your account — the raw key is shown once at creation, so store it somewhere safe.
Authorization: Bearer YOUR_API_KEY Content-Type: application/json
One authenticated POST turns a rough prompt into a contract-grade one.
POST https://promptkaizen.com/api/v1/optimize
Authorization: Bearer YOUR_API_KEY
Content-Type: application/json
{
"prompt": "write a function to parse user CSVs",
"mode": "coding",
"integrity": false
}
Response:
{
"optimizationId": 42,
"optimizedPrompt": "...",
"promptStrength": {
"overall": 96,
"input_quality_score": 8,
"output_improvement_score": 88,
"clarity": 91,
"structure": 94,
"specificity": 89,
"redundancy": 78
}
}
Each optimize call costs 1 credit. The call is synchronous — finished specification arrives in the response.
Supported values for the mode parameter: general, coding, creative, enterprise, educational.
prompt (Required) — Any non-empty stringmode (Required) — general · coding · creative · enterprise · educationalintegrity (Optional) — true / false — runs the verification circuit (5 credits vs 1)targetModel (Optional) — Hint for the model you'll run the result against (default: general)sandbox (Optional) — true returns a canned $0 response — no model call, no credit, no concurrency slot. Use it to wire up your integration.optimizationId — Unique ID for this optimization run.optimizedPrompt — The finished specification.promptStrength.overall — Output quality score (0–100).promptStrength.input_quality_score — Input quality score before optimization (0–100). Optional.promptStrength.output_improvement_score — Improvement magnitude score (0–100). Optional.promptStrength.clarity / .structure / .specificity / .redundancy — Per-dimension scores (0–100 each).pipelineFailure — Only on a soft failure (still HTTP 200): { reasons, details }. optimizedPrompt is empty, promptStrength is null, and no credit is charged.integrity — Only present when an integrity run executed. A versioned object — see the Integrity response table below.Credit balances after the call are returned in the X-Api-* response headers — not in the response body. See the Response Headers section for the full list.
Set integrity: true and the engine inspects the finished output, flagging fabricated facts, figures, and citations before they reach you. Any API key can run integrity — costs 5 credits per call. Response includes a verdict (pass | findings_detected | review_recommended), findings, and fabricationAlerts.
Check connectivity and your remaining balance without spending a credit.
GET https://promptkaizen.com/api/v1/ping Authorization: Bearer YOUR_API_KEY
Every error response is JSON with an error field. Branch your error handling on that field, not on the HTTP status alone.
X-Api-Free-Standard-Remaining — Free standard runs left in your one-time free grant.X-Api-Free-Integrity-Remaining — Free integrity runs left in your one-time free grant.X-Api-Paid-Credits — Purchased (card-on-file) credits remaining.X-Api-Balance — Which balance funded this response: free, paid, sandbox, or none (nothing charged).X-Concurrency-Limit — Max simultaneous in-flight requests allowed for your key.X-Concurrency-InFlight — Slots in use at the moment this response was sent.Usage is credit-based. Standard optimization runs cost 1 credit; integrity runs cost 5 credits. The API credit balance is separate from the web app’s monthly allowance — runs draw from your one-time free grant first, then from purchased credits. Credits are deducted atomically — two concurrent requests racing the last credit can’t both win. Track your balance via the X-Api-* response headers without a separate API call.
The same API, from your terminal. pk-kaizen is a zero-dependency client — Node 18+, nothing else to install.
npm install -g pk-kaizen
Authenticate:
export PK_API_KEY=your_api_key
-p, --prompt <text> — Inline prompt text. --file <path> — Read the prompt from a file. --mode <mode> — general · coding · creative · enterprise · educational (default: general) --json — Print the full JSON response to stdout instead of the prompt string. Useful for piping. --show-score — Print the before/after strength score to stderr. --integrity — Run the Integrity Engine on the output; report is printed to stderr. Costs 5 credits (vs 1 for a standard run). --base-url <url> — Override the API base URL (default: promptkaizen.com). --timeout <secs> — Request timeout in seconds (default: 60).-h, --help — Show command help. --json — Print the raw JSON response to stdout. --base-url <url> — Override the API base URL.-h, --help — Show command help. --key <value> — Save the key non-interactively (appears in shell history — prefer the interactive prompt for security).-h, --help — Show command help.# check balance before a run (costs nothing) pk ping # optimize a prompt, pipe result to a file pk -p "draft an onboarding email" > spec.txt # read from a file, use coding mode, show score pk optimize --file ./myprompt.txt --mode coding --show-score # run with the Integrity Engine; findings go to stderr pk -p "summarise the Q3 earnings report" --integrity # get the full JSON response (useful in scripts) pk -p "your prompt" --json | jq '.promptStrength.overall'
Not a better sentence — a proven specification.