What it costs, and what to do when it breaks.
Short on purpose. The full API reference is at /developers; this is the wallet and the error catalogue.
Getting started
The API requires an active paid plan with Developer API enabled for its tier. A key is created in the dashboard under Account → Developer API and shown once — we store only a hash, so a lost key is replaced, never recovered.
curl -H "Authorization: Bearer swpk_your_key_here" \
https://sriwatt.io/api/v1/projectsEvery metered response carries your remaining balance, so you can watch it fall rather than discover it empty:
X-SriWatt-Tokens-Charged: 250
X-SriWatt-Tokens-Allowance: 9750
X-SriWatt-Tokens-Purchased: 0Reads have a 60-a-minute ceiling and writes a 20-a-minute ceiling per endpoint bucket and network address; reduced limits may apply during limiter outages. These limits are separate from token balances.
API tokens
API packs are priced in euro. Live endpoints cover project records and .sri-file listings. Design, yield and structure compute endpoints below are planned and cannot currently be called; their listed prices do not make them available.
What each call costs
| Endpoint | Tokens | Status |
|---|---|---|
| projects.create | 0 | live |
| projects.list | 1 | live |
| projects.get | 1 | live |
| sri-files.list | 1 | live |
| climatology.point | 1 | not yet available |
| rates.country | 1 | not yet available |
| yield.run | 25 | not yet available |
| quote.build | 50 | not yet available |
| design.run | 250 | not yet available |
| structure.run | 250 | not yet available |
| sri-file.generate | 500 | not yet available |
4 of 11 are live. The rest are priced here so the ratios are settled and visible, and the server refuses them — nothing can be charged for a call that cannot be made. Creating a project costs no tokens: it already consumes a project slot or PAYG project credit. The current project-detail GET and PATCH handlers do not debit tokens or return token-balance headers; the table includes the listed project-detail price, not a charge currently collected by that handler.
Two balances
Your plan grants an allowance every month. Anything you buy sits in a second balance that does not expire. Spending draws the allowance first — drawing from the paid balance while a monthly grant sat unused would destroy that grant at the month boundary and charge you for something already given.
| Plan | Tokens / month |
|---|---|
| base | 2,000 |
| launch | 10,000 |
| core | 25,000 |
A trial gets no monthly tokens. The Hub controls which paid tiers can use the Developer API; a token balance does not override a disabled capability.
Buying more
Bundles are one-off and never expire. Plans refresh every month and bill annually. You can hold both, and more than one of either.
Pack examples count calls to live endpoints only. Buying tokens does not enable a disabled Developer API capability or make a planned endpoint callable.
Errors
All 21 of them, grouped by what you were doing. Each says what happened and what to do — not what the code is called.
Access
Who you are, and whether this account may do it.
unauthorized401The API key was missing, malformed, or has been revoked.
Send it as `Authorization: Bearer swpk_…`. Keys are shown once when created — if you no longer have it, make a new one in Account → Developer API and delete the old one.
unauthenticated401You are signed out, or the session expired while the page was open.
Sign in again. Work already saved is not affected; an unsaved form is.
forbidden403You are signed in, but this account or role may not touch this record. It is also what you get for another tenant’s data — deliberately the same answer as “does not exist”.
Check you are on the right account. If a teammate should have access, an owner can grant the matching role under Account → Team.
requires_core403This account does not currently have the paid access and enabled capability required by the endpoint.
Read the response message and the current plan comparison. Base, Launch and Core have token allowances, but Developer API must also be enabled for the tier. Trial-Core and a token purchase alone do not grant API access.
only_owner403The action changes billing, ownership or the account itself.
Ask the account owner to do it. Roles cannot be widened to cover this one.
verification_required403The email on the account has not been confirmed yet.
Open the message we sent and enter the code. Resend it from the same screen if it has expired.
Limits
Everything metered: tokens, rate, plan ceilings and upload caps.
insufficient_tokens402The wallet is empty — both the monthly allowance and any purchased balance.
Buy a bundle, or wait for the monthly allowance to reset. Every successful call returns your remaining balance in the `X-SriWatt-Tokens-*` headers, so you can watch it fall before it runs out.
too_many_requests429More calls per minute than the endpoint allows — 60 reads, 20 writes.
Back off and retry. This is separate from tokens: it limits how fast, not how much.
too_many_attempts429Too many wrong codes on a verification step.
Wait for the window to clear, then request a fresh code rather than retrying the old one.
sms_requires_core_tier403SMS and RCS broadcasts are a Core feature. Email broadcasts are not.
Send by email, or move the account to Core.
content_too_large413The email body, with its inline images, is over the size a message may carry.
Link large images instead of embedding them.
conflict409A project already exists for that customer email on this account.
Add the second site to the existing project from the dashboard rather than creating a new one — a customer owns many projects.
Your request
The call reached us and something in it did not hold up.
invalid_json400The body did not parse.
Send valid JSON and set `Content-Type: application/json`.
invalid_request400The body parsed but a field is missing or out of range.
The response names the field. Sizes are in kW, coordinates in decimal degrees, money in the account’s own currency.
invalid_email400The address is not one we can send to.
Check for a typo. Role addresses and disposable domains are refused on purpose.
not_found404No such record on this account.
Check the id. A record belonging to another tenant answers the same way, so this does not confirm it exists elsewhere.
not_bankable422The design cannot carry a bankable label — the inputs it would need are missing or out of range.
The response says which check failed. The estimate is still yours; only the bankable claim is withheld.
nothing_to_update400The patch contained no field we act on.
Send at least one changed field. This is not an error worth retrying unchanged.
Our side
Nothing you did. These are safe to retry.
unavailable503A dependency we need was not reachable for that request.
Retry with a short backoff. Metering deliberately fails open, so a hiccup here does not spend tokens.
storage_unavailable503The file store did not answer — attachments, datasheets and generated PDFs live there.
Retry. If a PDF was being generated, re-request it; nothing partial is kept.
quota_unavailable503We could not read your quota, so we did not run the query.
Retry. Refusing before the query is deliberate — an over-quota caller must not be able to time a response and learn whether it would have matched.
Where else to look
- API reference — endpoints, request and response shapes, webhooks and signature verification.
- Methodology — what the engines compute, what they assume, and the four things they refuse to answer.
- Contact — for anything this page did not settle. Quote the error code; it is the fastest route to an answer.