Developer Platform

Developer API

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 an API Key →

Why the API?

Synchronous

Get the finished specification in the response — no job ID to poll.

Scored output

Every response includes before/after quality scores across 4 dimensions.

Integrity Engine

Multiple dedicated agents inspect every claim in the output. Opt in per call with integrity: true.

Base URL

https://promptkaizen.com/api/v1

Authentication

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

Quickstart

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.

Prism Modes

Supported values for the mode parameter: general, coding, creative, enterprise, educational.

POST /api/v1/optimize — Request Fields

POST /api/v1/optimize — Response Fields

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.

Integrity Engine

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.

GET /api/v1/ping

Check connectivity and your remaining balance without spending a credit.

GET https://promptkaizen.com/api/v1/ping
Authorization: Bearer YOUR_API_KEY

Error Codes

Every error response is JSON with an error field. Branch your error handling on that field, not on the HTTP status alone.

Response Headers

Rate Limits

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.

Command-Line Tool (pk-kaizen)

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

pk optimize flags

pk ping flags

pk configure flags

CLI Examples

# 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'

Ready to build?

Not a better sentence — a proven specification.

Get an API Key →

Home Pricing About Privacy Terms