Docs

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/projects

Every 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:  0

Reads 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

EndpointTokensStatus
projects.create0live
projects.list1live
projects.get1live
sri-files.list1live
climatology.point1not yet available
rates.country1not yet available
yield.run25not yet available
quote.build50not yet available
design.run250not yet available
structure.run250not yet available
sri-file.generate500not 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.

PlanTokens / month
base2,000
launch10,000
core25,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.

Bundle S€292,000 tokens, one-off2,000 project-list calls
Bundle M€19930,000 tokens, one-off30,000 project-list calls
Bundle L€499100,000 tokens, one-off100,000 project-list calls
API S€29010,000 tokens a month, billed yearly10,000 project-list calls
API M€990100,000 tokens a month, billed yearly100,000 project-list calls
API L€2,9001,000,000 tokens a month, billed yearly1,000,000 project-list calls

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.

unauthorized401

The 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.

unauthenticated401

You 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.

forbidden403

You 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_core403

This 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_owner403

The action changes billing, ownership or the account itself.

Ask the account owner to do it. Roles cannot be widened to cover this one.

verification_required403

The 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_tokens402

The 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_requests429

More 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_attempts429

Too 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_tier403

SMS and RCS broadcasts are a Core feature. Email broadcasts are not.

Send by email, or move the account to Core.

content_too_large413

The email body, with its inline images, is over the size a message may carry.

Link large images instead of embedding them.

conflict409

A 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_json400

The body did not parse.

Send valid JSON and set `Content-Type: application/json`.

invalid_request400

The 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_email400

The address is not one we can send to.

Check for a typo. Role addresses and disposable domains are refused on purpose.

not_found404

No 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_bankable422

The 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_update400

The 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.

unavailable503

A 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_unavailable503

The 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_unavailable503

We 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