WAI API

Use WAI from your own apps. Prepaid only: calls are paid from your W$ balance, never from free credit.

Quick start

  1. Top up W$ in My Credit → Instant Top-Up.
  2. Create a key in My Credit → WAI API. It is shown once - copy it.
  3. Call the API:
curl -X POST "https://wht-ai.com/wai-api.php?e=ask" \
  -H "Authorization: Bearer wai_live_..." \
  -H "Content-Type: application/json" \
  -d '{"prompt":"Explain LCOE in two sentences","task_type":"simple"}'

Every response is JSON with ok (true/false). Successful calls include usage: charged_usd, balance_usd, daily_remaining_usd.

Authentication

Send Authorization: Bearer wai_live_... on every request over HTTPS. Keep keys secret; never put them in browser code or public repositories. You can hold up to 5 active keys and revoke any key instantly. Lost key? Revoke it and create a new one.

Pricing & billing

EndpointPrice (W$ = USD)
askengine cost × 1.8, minimum 0.01 per call
reportengine cost × 1.8, minimum 0.04 per requested page
legalengine cost × 1.8, minimum 0.25 per call
tool (calculators)flat 0.005 per call
balance, toolsfree
Any call with "byok": trueflat 0.005 platform fee (your own provider key pays the engine)

No subsidy, no surprises. Only your paid balance is used. If it is too low, or the key's daily cap (default 10 W$) is reached, the call returns HTTP 402 and nothing runs. Failed engine calls are not charged. Each key allows 30 requests per minute.

Balance

GET https://wht-ai.com/wai-api.php?e=balance
→ {"ok":true,"balance_usd":4.25,"daily_cap_usd":10,"daily_remaining_usd":9.8,"per_minute_limit":30}

Ask

POST?e=ask

FieldNotes
promptrequired, max 8,000 characters
task_typesimple (default), engineering, business, project, market, personal_life, shopping, hr_career
tierbasic (default) or pro
byokoptional boolean, see BYOK
→ {"ok":true,"text":"...","usage":{"charged_usd":0.012,"balance_usd":4.238,"daily_remaining_usd":9.988}}

Reports

POST?e=report - a structured written report in Markdown.

{"topic":"Battery storage market in Romania","pages":3,"language":"English"}

pages 1-10 (about 400 words each). Output is AI-generated; verify important facts. Larger, designed documents (PDF/Word/slides) are available inside the WAI app.

POST?e=legal - analyse contract or legal text you supply.

{"text":"...contract text...","question":"List termination rights and liability caps","jurisdiction":"Romania"}

text max 60,000 characters. The response includes a notice: this is informational analysis, not legal advice. Do not use it as a substitute for a qualified lawyer.

Calculators

GET?e=tools lists available deterministic calculators (energy, finance, engineering). Run one:

POST https://wht-ai.com/wai-api.php?e=tool
{"tool":"<id from e=tools>","input":{ ... }}

Invalid inputs return HTTP 422 with a message and are not charged. Fortune/entertainment, photo and CAD-file tools are not available through the API.

BYOK (bring your own key)

If you saved your own provider key in your WAI account (Settings), add "byok": true to ask, report or legal. Your provider bills you for the engine; WAI charges only the 0.005 W$ platform fee. If no key is saved you get HTTP 400. WAI never returns your stored key.

Errors & limits

HTTPMeaning
400Bad request or missing field
401Missing, invalid or revoked key
402Insufficient prepaid balance or daily cap reached - top up or wait
403Account unavailable
404Unknown endpoint or tool
405Use POST
422Tool input rejected
42930 requests per minute exceeded
502AI engine unavailable - not charged, retry later

API Terms of Use

  1. Prepaid, no credit. API usage is paid only from purchased W$ balance. Top-ups follow the Refund Policy; consumed W$ is not refundable.
  2. Your key, your responsibility. You are responsible for all calls made with your keys. Revoke compromised keys immediately.
  3. Informational output. Results are AI-generated and may contain errors. They are not professional, legal, medical, financial or engineering advice. Verify before relying on them.
  4. Acceptable use. No unlawful, harmful, deceptive or abusive use; no attempts to bypass limits, billing or security; no reselling raw access without written agreement; no uploading data you have no right to process.
  5. Limits. We may rate-limit, throttle, suspend or revoke keys that threaten service stability or violate these terms. Prices and limits may change with notice on this page; prices in force at call time apply.
  6. Availability. The API is provided as-is, without uptime guarantee. Upstream AI providers may change or fail; failed calls are not charged.
  7. Data. Request content is sent to the AI providers needed to answer it. Do not send secrets or personal data you are not permitted to share. See the Privacy Policy.
  8. Liability. To the extent permitted by law, WAI's liability is limited to the amount you paid for the affected calls.