You add money to your account and spend it on processor time. There is no plan, no subscription, no seat and no invoice. Your balance is what you can spend, and one job can take it slightly below zero (see below).
Everything on this page, in the API and in the workbench is in US dollars. There is no second unit and nothing to convert.
You sign in to use the service, and an account is opened with $100 of credit, once. Every account is the same object after that: a balance, and the entries that moved it.
Processor time, priced per processor-hour: the time a chip is held for your work, added up over every chip your job used. A ten-structure batch that runs on ten chips at once costs ten times what one structure costs, because it spent ten chips' time.
That time includes loading the model. A chip that does not already hold the model your job needs spends a minute or two loading it while leased to you, and that is billed; the results table says how much of each prediction's time it was, and the usage record carries it as load_s. A chip that already holds the model loads nothing, so you never pay for a load another job needed, and a reload we do between jobs is on nobody's bill.
What you are not charged for:
The meter reads the chip lease, not the wall clock on your job. A job that sits marked *running* for ten minutes behind someone else's work, holding no chip, costs nothing for those ten minutes.
A job is charged once, when it ends. The results table shows each prediction's time and its share of that charge, and GET /v1/jobs/{id}/usage returns the same share as amount_micros on every target. The shares add up to the job's charge exactly. A prediction that failed reads *not charged*.
Two decimals, extended to as many as it takes to show two significant digits, and never more than six: $20.00, $0.33, $0.011, $0.00078. Six decimals is where the ledger itself stops โ one millionth of a dollar โ so an amount is shown as $0.00 only when it really is zero. A twenty-second fold costs $0.0014, so most of what you will read here sits below the place a shop price would stop.
There is no price estimate and no reservation. A submission is accepted if your balance covers the most your runs still in progress can cost (each at its watchdog ceiling, below), and when the job finishes it is charged the chip time it actually held. That is a measurement, not a prediction, so there is no ceiling to be charged instead of the real number and no safety factor on top of it.
One job can therefore take your balance slightly below zero, and the most it can is one job's watchdog ceiling per chip it holds. Up to 1024 residues that is 25 minutes for a fold and 45 for a design, $0.11 and $0.20 at $0.26 an hour. Above 1024 the ceiling grows with the cube of the size, so at 2048 residues it is $0.87 for a fold and $1.56 for a design. That holds however many jobs you send at once, because each one is admitted only while your balance covers the ones before it. Below zero you cannot submit again until you top up.
An account is opened with $100 of credit, once, at sign-up. It does not renew and it does not expire. It appears in history as an entry with kind grant, next to anything you buy.
The credit is one per inbox. A second account on the same mailbox, such as jane+lab@example.org next to jane@example.org, or a Gmail address with its dots moved, opens with $0, and so does an address whose earlier account was deleted. We suspend accounts opened to farm it.
A code we give you looks like JF-7K2D-QX9M-4TRA-8VWC. It can add money to your balance, take a percentage off the processor-hour price, or both. Redeem it on your account page, or:
curl -X POST https://api.japanfold.aiand.com/v1/credits/redeem \
-H "Authorization: Bearer $JAPANFOLD_API_KEY" \
-H "Content-Type: application/json" \
-d '{"code": "JF-7K2D-QX9M-4TRA-8VWC"}'
The answer is your balance and rate afterwards. The redemption is an entry in history with kind grant and the reason the code was issued for. Case, spaces and dashes do not matter.
A code works once per account. Redeeming it again changes nothing and answers 409 with the day you redeemed it. A code that is not valid, has expired or has been used as many times as it allows answers 400 and says which, except that an unknown code and a withdrawn one get the same answer. Ten wrong codes in an hour and the account is told to wait (429).
A discount is part of your rate. rate on GET /v1/credits and GET /v1/account shows the price you pay and discount_percent, and every run from then on is charged at it. A discount never changes a run already charged: each usage entry records the rate it was charged at. A code never lowers a discount you already have; a code that offers only a smaller one is refused and stays unused.
Sign in with your email address. There is no password: the workbench mails you a six-digit code, good for ten minutes and five attempts, and that is the whole of it. Signing in again from anywhere reaches the same account, the same balance and the same history.
From the same screen you can create an API key, see the keys you have, and revoke one. A key is shown once, when it is created; only its SHA-256 is stored, so it cannot be shown again. Revoking takes effect immediately. Keys are managed only from a signed-in browser: a key can do everything else, but it cannot make another key, revoke one, or change the account.
A submission is refused with 402 and type pointing here when your balance has run out, or would not cover the runs you already have in progress. The body says what is left and where to add funds. Top up with POST /v1/credits/checkout below, or redeem a code, and submit again.
A refusal takes nothing from your balance.
A top-up is refused with 402 and type pointing here when the amount is outside the configured bounds, or the card processor declined it. The bounds are in rate on GET /v1/credits, in dollars: min_topup exists because a card processor charges a fixed fee per payment, and max_topup is anti-fraud rather than commercial.
A refused checkout charges nothing and adds nothing. If a payment succeeded and your balance has not moved after a minute, send us the payment id โ the repair is idempotent, so you cannot end up credited twice.
curl https://api.japanfold.aiand.com/v1/credits -H "Authorization: Bearer $JAPANFOLD_API_KEY"
{
"object": "credits",
"account": "acct_7Kd2f",
"balance": 25.0,
"balance_micros": 25000000,
"currency": "usd",
"processor_seconds_left": 346153.8,
"rate": {"per_hour": 0.26, "description": "$0.26 per processor-hour"},
"history": [{"kind": "purchase", "amount": 25.0, "ref": "stripe:pi_...", "at": 1790000000}]
}
balance_micros is the exact figure, in millionths of a dollar; balance is the same number as a decimal, for reading. GET /v1/account serves the same balance next to your keys.
The sign-up credit and a purchase both appear in history as entries, told apart by kind and by nothing else the service acts on.
Add funds on your account page takes a card. Type an amount, pay on Stripe's page, and you come back to your account with the new balance on it. The amount it accepts is the one the service accepts, so the form cannot offer you a payment the server would refuse.
From a script, or to choose the amount yourself:
curl -X POST https://api.japanfold.aiand.com/v1/credits/checkout \
-H "Authorization: Bearer $JAPANFOLD_API_KEY" \
-H "Content-Type: application/json" \
-d '{"amount": 25.00}'
You get back a url. Open it, pay on Stripe's page, and your balance goes up within a few seconds. Card details never reach us.
Your balance moves when Stripe tells our server the payment succeeded, not when your browser returns from the payment page, so poll GET /v1/credits rather than trusting the page you land on. The account page does exactly that: it says the payment arrived, then waits for the balance and tells you what it became. If a payment succeeded and the balance has not moved after a minute, tell us the payment id and we will reconcile it; the repair is idempotent, so you cannot end up credited twice.
Your balance does not expire. Refunds appear in your history as their own entry rather than as a change to the payment they reverse, so the history you read is what happened.