Docs · REST API
Use the REST API
One endpoint runs every tool. Send the tool and its inputs, and read the result.
Make your first call
Free tools run without a key, 300 calls a month per IP address. This call runs IBAN Validation.
-
Send the request
curl -X POST https://api.strale.io/v1/do \ -H 'Content-Type: application/json' \ -d '{ "capability_slug": "iban-validate", "inputs": { "iban": "SE4550000000058398257466" }, "max_price_cents": 1 }'const res = await fetch("https://api.strale.io/v1/do", { method: "POST", headers: { "Content-Type": "application/json" }, body: JSON.stringify({ capability_slug: "iban-validate", inputs: {"iban":"SE4550000000058398257466"}, max_price_cents: 1, }), }); const body = await res.json(); if (!res.ok) throw new Error(`${body.error_code}: ${body.message}`); console.log(body.result.output);import requests res = requests.post( "https://api.strale.io/v1/do", json={ "capability_slug": "iban-validate", "inputs": { "iban": "SE4550000000058398257466", }, "max_price_cents": 1, }, timeout=60, ) body = res.json() if not res.ok: raise RuntimeError(f"{body['error_code']}: {body['message']}") print(body["result"]["output"]) -
Read the response
A success is HTTP 200. The tool’s answer is in
result.output, the price charged inresult.price_cents(0for a free tool), and the source inresult.provenance. Keyless calls also returnfree_tier: trueand ausageblock. The full shape is on the Docs overview. -
Add a key for more
With a key,
max_price_centsis required and free tools never charge. The same call with a key:With an API keycurl -X POST https://api.strale.io/v1/do \ -H "Authorization: Bearer $STRALE_API_KEY" \ -H 'Content-Type: application/json' \ -d '{ "capability_slug": "iban-validate", "inputs": { "iban": "SE4550000000058398257466" }, "max_price_cents": 1 }'
Authenticate
Sign up for a key. It starts with sk_live_ and is shown once, so store it. Send it on every call.
Authorization: Bearer sk_live_your_key_here - A key may send 10 requests a second. Past that, calls return
rate_limitedwith aRetry-Afterheader. GET https://api.strale.io/v1/wallet/balancereturnsbalance_centsandcurrency.POST https://api.strale.io/v1/auth/api-key, called with your current key, issues a new key and ends the old one.
Add to your balance
Top up with a card. The call returns a checkout_url; open it to pay. The minimum is €10.00.
curl -X POST https://api.strale.io/v1/wallet/topup \
-H "Authorization: Bearer $STRALE_API_KEY" \
-H 'Content-Type: application/json' \
-d '{"amount_cents": 1000}' Call a paid tool
A paid tool takes the same request with a key and a price ceiling. The call is refused before it runs if the tool costs more than max_price_cents, and you are charged only when it succeeds.
# Needs an API key. max_price_cents caps what this call may cost.
curl -X POST https://api.strale.io/v1/do \
-H "Authorization: Bearer $STRALE_API_KEY" \
-H 'Content-Type: application/json' \
-d '{
"capability_slug": "address-geocode",
"inputs": {
"address": "Eiffel Tower, Paris"
},
"max_price_cents": 2
}' Each tool page shows the price, the inputs and a call you can copy. The response adds result.wallet_balance_cents, your balance after the call.
Use capability_slug when you know the tool. To describe the job in words, send task in its place and Strale picks a tool within your price ceiling.
Run a bundled check
A bundled check runs several tools as one call at one price. It has its own endpoint, POST https://api.strale.io/v1/solutions/{slug}/execute, and needs a key. The body takes inputs and an optional max_price_cents.
# Needs an API key. The whole check is charged once, at the listed price.
curl -X POST https://api.strale.io/v1/solutions/api-quality-check/execute \
-H "Authorization: Bearer $STRALE_API_KEY" \
-H 'Content-Type: application/json' \
-d '{
"inputs": {
"spec": "{\"openapi\":\"3.0.0\",\"info\":{\"title\":\"My API\",\"version\":\"1.0\"},\"paths\":{\"/users\":{\"get\":{\"summary\":\"List users\"}}}}"
},
"max_price_cents": 50
}' result.status | Meaning | Charge |
|---|---|---|
completed | Every step returned a result. | Charged in full. |
partial | Some steps returned results and some failed. result.errors lists the failures. | Charged in full. |
failed | Every step failed. | Refunded. |
Results are in result.steps, keyed by tool. If a step finds that the check cannot continue, result.gated says which step stopped it and why, and the call is not charged.
Next steps
- Handle errors and retries: every error code and what to do.
- Retry safely and cap spend:
Idempotency-Key, per-call ceilings and the hourly limit. - Retrieve a past call by its transaction ID.
- The OpenAPI document lists every endpoint.