Base URL: https://json.flyingfishspace.com
Last Updated: November 18, 2026
Pass your API key in the
X-API-Key
header on every programmatic request. No login, no OAuth, no cookies.
For better security, store your API key in an environment variable instead of hardcoding it into your code. Never expose your key in public repositories or frontend code, or share it publicly. If your key is accidentally exposed, revoke it and generate a new one.
Check your current credit balance and key status. Useful for scripts and integrations that need to confirm a key is still active before making billed calls, without spending a credit on a real processing request.
curl https://json.flyingfishspace.com/api/v1/status \ -H "X-API-Key: ffs_live_YOUR_KEY"
Response (200 — success)
{
"key": "ffs_live_YOUR_KEY",
"balance": 97,
"status": "active",
"platform_uuid": "8f14e45f-...-9d3c",
"module_id": "json_pipeline"
}
Response (401 — invalid key)
{ "error": "Invalid API key" }
status "active".
A revoked key is rejected here with 401 and
{ "error": "Invalid API key" }. After you reissue via
/billing, call this endpoint with the new key value.
Every tool on this platform shares the same underlying safety principle: reject rather than silently corrupt. If we can't guarantee a repair is accurate and complete, we return a clear error instead of a plausible-looking but wrong result. Closing a truncated document is the exception: missing quotes and brackets may be appended, and the last value may still be incomplete. See Truncation below.
Some numbers cannot be held exactly by a JavaScript Number (an IEEE 754
double): integers above Number.MAX_SAFE_INTEGER (9007199254740991), decimals
with more than 15 significant digits, and values whose size overflows or underflows a
double. The JSON syntax itself puts no limit on the number of digits (RFC 8259); the limit
comes from the parser that reads the text. A plain JSON.parse rounds such a
number silently, with no warning. This platform calls these numbers unsafe
and never lets them pass through a plain Number.
Exact preservation: a number you did not ask to change is returned with exactly the digits you sent. It is not turned into a string, and a number that is safe is returned as before. How each tool treats an unsafe number:
clean: the number is kept as exact text, and the repair is listed in
repairs as "Preserved N numeric literal(s) beyond double precision as exact text".transform: flatten, unflatten,
renameKeys and jsonToCsv keep the number as exact text.
csvToJson keeps cells as strings by default; with
typeInference: true an unsafe cell becomes the exact number, and a safe one
becomes a plain number as before.schema: numbers in data are checked by their exact value (see
Known limits below). Unsafe numbers inside the schema itself are still
rejected (422, not charged).ai-clean: the number is kept only when the rule-based repair can fix the
input. A number beyond double precision is never sent to the AI model; if the AI would
be needed, the request is rejected (422, no AI call, not charged).Where preservation is not switched on, an unsafe number is rejected with 422 and is not charged, as in the 422 examples further down this page. Those examples show that rejection; they do not apply to an endpoint where preservation is on.
Your own parser: this API writes the exact digits, but a client that reads
the response with a plain JSON.parse (or res.json()) rounds them
again. Read the response with a parser that keeps the digits, or ask for those fields as
strings in your own data.
Underflow: a non-zero decimal too small for a 64-bit float (below about
2.47×10-324, e.g. 1e-400) would silently become 0
when parsed, so it is rejected the same way (422, not charged). Tiny values that are still
representable are accepted. When a request contains many violations, only the first 100 are
listed.
Note for transform's csvToJson operation:
the CSV text you submit is itself a JSON string field, so numbers inside it are
checked separately from the surrounding request. Without exact preservation, both
precision checks apply to values inside the CSV (422, not charged). With it, cells stay
strings by default and are returned as written; with typeInference: true a
cell that is an unsafe number becomes the exact number, and a safe one a plain number.
Leading zeros are dropped before the check, so 007 becomes 7 and
00123456789012345678 becomes the exact number 123456789012345678.
Known limitation for ai-clean: before any repair,
rawInput is scanned as raw text, because a number that a parser has
already rounded can no longer be detected. That scan only understands double-quoted
strings, so a long digit sequence in a single-quoted string, in an unquoted word, or
in prose around the JSON can be rejected as if it were a number. Such a rejection is
a 422 and is never charged. Putting the value inside a double-quoted string avoids it.
When exact preservation is switched on, the same scan decides whether the number is
kept: only a request that the rule-based repair can fix keeps it, and the AI model
never receives it.
The table states what is implemented and tested today. It describes endpoints where exact preservation is switched on; where it is not, unsafe numbers are rejected as described in Precision Guard above.
Known limits
Number, multipleOf keeps the tolerance of the upstream validator, which treats 1e-8 as a multiple of 3e-8. Only exact numbers are compared exactly.schema itself are still rejected (422, not charged).multipleOf of 0, and operands of more than 2000 digits (a provisional value).uniqueItems on exact numbers took about 400 ms for 1000 items in a local test (Node 22).JSON.parse rounds the numbers again.JSON.rawJSON shows no data rather than a rounded result.
When a baseline of your original data exists, value-lock compares the AI output
with that baseline. A scalar change is allowed when the two values are loosely
equal (==, or the same text after String()). A change is also allowed when the schema marks that path as an enum. Any other scalar change
rejects the repair (422; 1 credit, because the model already ran — see the
billing summary in the AI-Assisted JSON Repair section). The walk follows
properties and items only. A key the AI deletes or
renames is left unflagged. A required field the AI invents is rejected only
when that name is listed in the schema's top-level required array.
$ref, allOf, anyOf, and oneOf
are not expanded for this check.
Known limitation: value-lock compares the AI output against a baseline
of your original data, taken from the rule-based repair or a direct parse of
rawInput. If neither can parse your input (typical for severely malformed
text), no baseline exists and value-lock cannot run for that request. The JSON-validity
check and the schema check (if you supplied a schema) still apply. This is a known
limitation and has not been resolved yet.
ai-clean accepts at most 3072 bytes of rawInput per request,
well below the platform-wide 1 MiB limit. Larger input is rejected before any AI call
is made (413, not charged); to repair a larger document, split it into smaller batches.
schema is also size-capped for this endpoint (currently 8192 bytes, a
provisional value that may change) and complexity-checked before any AI call; failures
return 413 or 422 and are never charged.
Every POST under /api/json/v1/ (all tool endpoints and
workflows) accepts a request body of at most 1 MiB (1,048,576 bytes),
measured in UTF-8 bytes: a body of exactly 1,048,576 bytes is accepted, one byte more
is rejected. A larger request is rejected with 413 and is never charged.
To process a larger document, split it into smaller requests. ai-clean
has tighter limits of its own (see AI Repair Size Limits above), which are checked
in addition to this one.
Response (413 — request body too large, not charged)
{
"success": false,
"error": "Request body exceeds the maximum size of 1048576 bytes (received 1048577 bytes). Please split the input into smaller requests; no credits were charged."
}
Submit raw or broken JSON for repair. The engine runs up to 11 repair stages
and returns the cleaned object. Charged 1 credit on success only. If your text has prose
around the JSON, the first complete, parseable {...} or [...]
block is extracted; input that is already valid JSON is never altered by that step.
repairs lists at most the first 100 repairs; repairs_total is
the exact number performed and repairs_truncated is true when
the list was cut.
Control characters: non-printable control characters (U+0000 to U+001F,
other than tab, line feed and carriage return) are removed when they appear between
values. A raw line feed, carriage return or tab typed inside a string value is escaped
the way JSON requires: the string keeps exactly the same characters, and the repair is
listed in repairs as "Escaped raw line breaks and tabs inside string values".
Any other control character inside a string value is never silently removed: input
containing one is rejected (422, not charged) rather than altered. A backslash followed
directly by a raw line break is rejected as well, because its meaning is ambiguous, and
raw line breaks or tabs inside single-quoted strings are not repaired.
Truncation: an unclosed object or array may be closed by appending the missing quote and brackets. That repair is recorded as “Completed truncated structure: appended … The last value may be incomplete.” That sentence is a warning, not proof that the last value was the part cut off.
curl -X POST https://json.flyingfishspace.com/api/json/v1/clean \
-H "X-API-Key: ffs_live_YOUR_KEY" \
-H "Content-Type: application/json" \
-d '{"name": "Alice", "age": 30,}'
Response (200 — success)
{
"success": true,
"data": { "name": "Alice", "age": 30 },
"repairs": ["Removed trailing comma before '}'"],
"repairs_total": 1,
"repairs_truncated": false,
"remaining_balance": 99
}
Response (422 — unrecoverable, not charged)
{
"success": false,
"error": "JSON structure could not be repaired. Please check the input manually.",
"repairs": ["Removed UTF-8 BOM"],
"repairs_total": 1,
"repairs_truncated": false,
"remaining_balance": 99
}
Response (422 — numeric precision would be lost, not charged)
{
"success": false,
"error": "Input contains numeric literal(s) exceeding safe precision (max 15 significant digits): \"1234567890.123456\" (16 significant digits). Encode high-precision numbers as strings instead (e.g. \"amount\": \"1234567890.123456789012\") to preserve exact values.",
"repairs": [],
"repairs_total": 0,
"repairs_truncated": false,
"remaining_balance": 99
}
Response (422 — large-integer precision would be lost, not charged)
{
"success": false,
"error": "Input contains integer literal(s) exceeding safe precision (max 16 digits, Number.MAX_SAFE_INTEGER = 9007199254740991): \"22233344455566677788\" (20 digits). Encode large integers as strings instead (e.g. \"id\": \"22233344455566677788\") to preserve exact values.",
"repairs": [],
"repairs_total": 0,
"repairs_truncated": false,
"remaining_balance": 99
}
Number cannot hold more than about 15 significant digits
exactly, and a plain JSON.parse rounds anything beyond that without a
warning. Where exact preservation is not switched on for this endpoint, the request
is rejected outright (422, not charged) instead of returning a rounded value. Where
it is switched on, the number is kept with exactly the digits you sent (see Precision
Guard above). To be safe in either case, you can also send high-precision values
(financial amounts, coordinates, scientific data) as JSON strings.
Flatten, unflatten, rename keys, or convert between JSON and CSV. Charged 3 credits on success only.
curl -X POST https://json.flyingfishspace.com/api/json/v1/transform \
-H "X-API-Key: ffs_live_YOUR_KEY" \
-H "Content-Type: application/json" \
-d '{"operation": "flatten", "input": {"user": {"name": "Alice"}}}'
Body parameters
Response (200 — success)
{
"success": true,
"data": { "user.name": "Alice" },
"remaining_balance": 97
}
Response (422 — numeric precision would be lost, not charged)
{
"success": false,
"error": "Input contains numeric literal(s) exceeding safe precision (max 15 significant digits): \"1234567890.123456\" (16 significant digits). Encode high-precision numbers as strings instead (e.g. \"amount\": \"1234567890.123456789012\") to preserve exact values."
}
Number cannot hold more than about 15 significant digits
exactly, and a plain JSON.parse rounds anything beyond that without a
warning. Where exact preservation is not switched on for this endpoint, the request
is rejected outright (422, not charged) instead of returning a rounded value. Where
it is switched on, the number is kept with exactly the digits you sent (see Precision
Guard above). To be safe in either case, you can also send high-precision values
(financial amounts, coordinates, scientific data) as JSON strings.
Response (422 — large-integer precision would be lost, not charged)
{
"success": false,
"error": "Input contains integer literal(s) exceeding safe precision (max 16 digits, Number.MAX_SAFE_INTEGER = 9007199254740991): \"22233344455566677788\" (20 digits). Encode large integers as strings instead (e.g. \"id\": \"22233344455566677788\") to preserve exact values."
}
Response (422 — precision violation inside CSV text for csvToJson, not charged)
{
"success": false,
"error": "CSV input contains integer value(s) exceeding safe precision (max 16 digits, Number.MAX_SAFE_INTEGER = 9007199254740991): \"22233344455566677788\" (20 digits). Encode large integers as quoted strings in the CSV instead to preserve exact values."
}
csvToJson, both precision checks run twice: once against the
overall request body, and once against the raw CSV text in input
specifically — the CSV text is itself a JSON string field, so numeric values
inside it need a separate scan. Errors from this second scan are prefixed
"CSV input contains..." to distinguish them from a violation in the outer
request structure.
Response (422 — key collision, not charged)
{
"success": false,
"error": "flattenObject: path collision at \"a.b\" — two different input paths flatten to the same key."
}
flatten and jsonToCsv reject input where two different paths would
produce the same key (for example {"a.b":1,"a":{"b":2}}), and
renameKeys rejects a mapping that makes two keys collide, instead of silently
overwriting one value.
"operation": "calculate" computes add, subtract, multiply, modulo, divide, round and sum
on decimal numbers of any size, without passing them through a JavaScript Number
(computed with bignumber.js 11.1.5). Add, subtract, multiply, modulo and sum are exact. Divide and
round need an explicit number of decimal places (scale) and a rounding mode;
there is no default for either. Charged 3 credits on success only, like the other transform operations.
It is available only on endpoints where exact preservation is switched on; otherwise it is rejected
with 422 and not charged.
curl -X POST https://json.flyingfishspace.com/api/json/v1/transform \
-H "X-API-Key: ffs_live_YOUR_KEY" \
-H "Content-Type: application/json" \
-d '{"operation":"calculate","input":{"data":{"a":22233344455566677788,"b":0.1},"expressions":[{"op":"add","a":{"path":["a"]},"b":{"path":["b"]}},{"op":"divide","a":1,"b":3,"scale":5,"mode":"ROUND_HALF_UP"}]}}'
Response (200)
{
"success": true,
"data": [22233344455566677788.1, 0.33333],
"remaining_balance": 754
}
Expressions
input is { "data": ..., "expressions": [...] }; the result is an array with one
number per expression, in the same order. An operand is a JSON number or
{ "path": [...] }, which reads a number from data. A path is an array whose items are
object keys (strings) or array indexes (integers), so a key that contains a dot is addressed exactly.
A number written as a string is not accepted. Fields that do not belong to the operation are rejected.
mode is one of ROUND_UP (away from zero), ROUND_DOWN (toward zero),
ROUND_HALF_UP, ROUND_HALF_EVEN, ROUND_FLOOR, ROUND_CEIL.
scale or mode, division or modulo by zero, a non-number operand, an unknown
op, or a request over a limit. The limits are provisional values, not measured ones: 1000
expressions, 1000 values in a sum, scale from 0 to 1000, operands of at most 1000 digits and an
exponent of at most 1000, and results of at most 5000 characters. Results are written without trailing zeros
(1.50 + 0 gives 1.5), and a result of zero is never written as -0.
Numbers you did not pass to a calculation are returned as they are by the other operations. Calculation results are
computed values: they are exact for the numbers you sent, which says nothing about whether those numbers are
correct for your business. A client that reads the response with a plain JSON.parse rounds large results again.
Validate JSON data against a JSON Schema (Draft 7). Returns a structured error report with path, keyword, and message for every violation. Charged 2 credits on success only.
curl -X POST https://json.flyingfishspace.com/api/json/v1/schema \
-H "X-API-Key: ffs_live_YOUR_KEY" \
-H "Content-Type: application/json" \
-d '{"schema": {"type":"object","required":["name"]}, "data": {"age":30}}'
Response (200 — validation ran, data is invalid)
{
"success": true,
"data": {
"valid": false,
"errors": [
{ "path": "#", "keyword": "required",
"message": "Instance does not have required property \"name\"." }
]
},
"remaining_balance": 95
}
Response (422 — numeric precision would be lost, not charged)
{
"success": false,
"error": "Input contains numeric literal(s) exceeding safe precision (max 15 significant digits): \"1234567890.123456\" (16 significant digits). Encode high-precision numbers as strings instead (e.g. \"amount\": \"1234567890.123456789012\") to preserve exact values."
}
Response (422 — large-integer precision would be lost, not charged)
{
"success": false,
"error": "Input contains integer literal(s) exceeding safe precision (max 16 digits, Number.MAX_SAFE_INTEGER = 9007199254740991): \"22233344455566677788\" (20 digits). Encode large integers as strings instead (e.g. \"id\": \"22233344455566677788\") to preserve exact values."
}
200 response with valid: false is a successful validation run
that correctly found the data non-conformant — you are charged for performing the check,
not for the data happening to pass. If your schema uses uniqueItems,
arrays in the data are limited to 1000 items (a provisional limit); larger arrays are
rejected with 422 and not charged. The schema itself is also rejected, with 422 and
no charge, when it exceeds nesting depth 5, when a pattern or a
patternProperties key is longer than 200 characters, or when a pattern
repeats a group that itself contains *, +, or {n,}.
Only local JSON Pointers of the form #/… are resolved. An external
reference and a bare # are rejected.
Repairs severely malformed JSON that rule-based cleaning cannot recover, and
optionally maps semantically non-conforming values (e.g. enum mismatches)
against a target schema. Powered by gpt-oss-20b on Cloudflare Workers AI
(@cf/openai/gpt-oss-20b).
This is the only endpoint that sends your data to a third party: your content is sent to that model for processing.
Under Cloudflare's Workers AI terms, the content sent for the repair is not used to train the model.
We do not store the document. We keep request metadata (endpoint, time, duration, status, size, credits charged, token counts) for billing and operations, and we may keep an anonymized, structured record of the outcome to improve the product.
None of these records include the document, and they are not used as training material for a large language model.
/clean). If that alone succeeds, you are charged
1 credit — identical to calling /clean directly. Only when the
rule-based pass is insufficient and the AI model is actually invoked (for structural repair,
or semantic remapping against a supplied schema) are you charged the full
10 credits. If you supplied a schema, output that reached the model
must validate against it. Value-lock runs only when a baseline of your original data
exists. When it runs, a scalar change is rejected unless the values are loosely equal
or that path is an enum. The walk follows properties and
items only. A deleted or renamed key is left unflagged, and an invented
required field is rejected only when its name is in the schema's top-level
required array. See Value-Lock above for the same limits.
remaining_balance in the response is your
final balance. With fewer than 10 credits the request is rejected with 402 and nothing is charged.
curl -X POST https://json.flyingfishspace.com/api/json/v1/ai-clean \
-H "X-API-Key: ffs_live_YOUR_KEY" \
-H "Content-Type: application/json" \
-d '{
"rawInput": "{status: '"'"'ok'"'"', user_id: 42,}",
"schema": {
"type": "object",
"required": ["status", "user_id"],
"properties": {
"status": { "type": "string", "enum": ["active","inactive","pending"] },
"user_id": { "type": "integer" }
}
}
}'
Body parameters
Response (200 — repaired via rule engine only, 1 credit)
{
"success": true,
"data": { "status": "active", "user_id": 42 },
"changes": [],
"schema_valid": true,
"used_ai": false,
"baseline": true,
"remaining_balance": 99
}
Response (200 — AI invoked for semantic remapping, 10 credits)
{
"success": true,
"data": { "status": "active", "user_id": 42 },
"changes": [
{ "path": "status", "before": "ok", "after": "active", "type": "modified", "detail": "value-changed" }
],
"schema_valid": true,
"used_ai": true,
"baseline": true,
"usage": { "total_tokens": 255, "neurons": 5.05 },
"remaining_balance": 90
}
Response (422 — AI fabricated a top-level required field, 1 credit charged)
{
"success": false,
"error": "AI repair rejected: changed protected value(s) at accountType",
"usage": { "total_tokens": 201, "neurons": 4.1 },
"ai_charged_credits": 1
}
Response (422 — AI output rejected by value-lock, 1 credit charged)
{
"success": false,
"error": "AI repair rejected: changed protected value(s) at status",
"usage": { "total_tokens": 189, "neurons": 3.72 },
"ai_charged_credits": 1
}
Response (422 — AI returned an empty or non-JSON output, 1 credit charged)
{
"success": false,
"error": "AI returned an empty or malformed response",
"usage": { "total_tokens": 4300, "neurons": 60.2 },
"ai_charged_credits": 1
}
Billing summary
ai-clean step inside a workflow.
required array only.
If one of those fields is genuinely absent from rawInput, the model is
instructed to leave it absent rather than invent a placeholder — and if it does anyway,
this guardrail rejects the repair. Nested required arrays are not checked
here. A missing top-level field should surface as missing, not as a fabricated value.
Response (413 — schema too large for AI repair, not charged)
{
"success": false,
"error": "Schema exceeds the AI repair size limit (8192 bytes; received 12034 bytes). Simplify the schema or split the work; no AI call was made and no credits were charged."
}
Response (413 — rawInput too large for AI repair, not charged)
{
"success": false,
"error": "Input exceeds the AI repair size limit (3072 bytes; received 5880 bytes). Please split large inputs into smaller batches and repair them separately. This limit is specific to /ai-clean — the rule-based /clean endpoint supports much larger payloads."
}
Response (402 — balance below the 10 credits reserved up front, not charged)
{
"error": "Insufficient credits",
"required": 10,
"remaining_balance": 4
}
Response (503 — service or balance unavailable, nothing charged)
{
"success": false,
"error": "Service error",
"message": "This module is temporarily experiencing issues.",
"details": "Module returned 503"
}
The platform gateway replaces the body of every 5xx response with this generic message, so
the specific reason is not visible to you. The 503 responses this endpoint produces on
purpose (balance unreadable before anything is reserved, or the service unreachable after
the reserved credits were refunded and the refund confirmed) never charge you. An
unexpected internal error is delivered the same way and cannot be told apart, so check your
balance with GET /api/v1/status before retrying. If the billing outcome cannot
be confirmed you get a 409 instead; see "When the Billing Outcome Cannot Be Confirmed" below.
rawInput is capped at 3072 bytes (UTF-8) and schema
at a provisional 8192 bytes for this endpoint —
much smaller than the platform-wide 1 MiB limit. Oversized input is rejected outright,
before any AI call is made, so it is never charged. If you need to repair
a larger document, split it into smaller batches (e.g. per-record for arrays) and call this
endpoint separately for each.
A successful /api/json/v1/ai-clean response lists in changes how the
repaired data differs from your original data, path by path, and says in baseline
whether there was an original to compare against. In a workflow response, the
ai-clean step carries the same two fields in its entry in steps; the
other steps do not. For a workflow step they compare that step's own input with its output,
not your original request.
Fields of a change
What baseline means
used_ai is false),
baseline is true and changes is empty: no comparison is run
on that path, and rule-based syntax fixes (including NaN or Infinity
replaced by null) are not listed. Arrays are compared by position (index): an
inserted or removed element shifts every later element, so later positions can be reported as
changed.
report,
version, tool, generatedAt, status
(compared or no-baseline), limitations,
summary and changes. For a repair that used only the rule-based pass,
the report says compared with no changes, because no comparison was run. In Rename
Keys, a renamed key appears as one removed and one added entry. Compare is not offered for the
Clean page or for the other Transform operations.
Runs a predefined sequence of tools against your input in a single request, instead of
calling each endpoint separately. Each successfully-completed step is billed individually —
the total charge is the sum of each step's own cost, identical to calling those endpoints
one at a time. A step that fails, or a schema-validation step that reports the data as
invalid, halts the chain immediately: no further steps run, and steps after the halt point
are never charged.
The ai-clean step follows the same tiered billing as the standalone
endpoint — 1 credit if rule-based repair alone succeeds, 10 credits if the AI model
is invoked — so a workflow containing it may cost less than its listed maximum.
Balance requirement: the largest possible total (the larger figure under
"Total cost" below) is reserved before the first step runs, so your balance must cover it even
if the actual charge turns out lower. For example, ai-validate needs at least 12
credits available although a run where rule-based repair suffices costs 3. What is not used is
refunded within the same request, and remaining_balance is your final balance.
Available workflows
The full, current list — including maintenance status — is always available at
GET /api/v1/modules
(workflow entries are marked with "type": "workflow").
Body parameters
curl -X POST https://json.flyingfishspace.com/api/json/v1/workflow/clean-validate \
-H "X-API-Key: ffs_live_YOUR_KEY" \
-H "Content-Type: application/json" \
-d '{
"input": "{name: \"Alice\", age: 30,}",
"schema": {"type": "object", "required": ["name", "age"]}
}'
Response (200 — every step completed)
{
"success": true,
"combo": "clean-validate",
"steps": [
{ "segment": "clean", "success": true, "repairs": ["Removed trailing comma before '}'"] },
{ "segment": "schema", "success": true, "valid": true, "errors": [] }
],
"data": { "name": "Alice", "age": 30 },
"charged_credits": 3,
"remaining_balance": 746,
"operation_id": "3f6c2a9e-1d4b-4c7a-9e21-5b8d0a7c4e12"
}
Response (422 — halted partway through, e.g. schema invalid)
{
"success": false,
"combo": "full-pipeline",
"steps": [
{ "segment": "clean", "success": true, "repairs": [] },
{ "segment": "schema", "success": true, "valid": false, "errors": [
{ "path": "#", "keyword": "required", "message": "Instance does not have required property \"name\"." }
] }
],
"data": { "age": 30 },
"abort_reason": "Schema validation failed; workflow halted before remaining steps.",
"charged_credits": 3,
"remaining_balance": 748,
"operation_id": "3f6c2a9e-1d4b-4c7a-9e21-5b8d0a7c4e13"
}
charged_credits reflects what this specific call actually billed: the sum of the
steps that ran and succeeded (including a schema step that reported invalid data),
plus a small charge if a step (most commonly ai-clean) consumed real AI compute
before being rejected by a guardrail. See the AI-Assisted JSON
Repair section above for when that applies (a guardrail rejection, or an empty or non-JSON
model output: 1 credit; anything rejected before the AI is called: 0).
clean
(1 credit) and schema (2 credits) were billed, while transform (which never ran) was not. data always reflects
the document as of the last step that transformed it; a schema step never changes
data, since its own output is a validation report, not a document.
input over 3072 bytes for a workflow that contains ai-clean (413),
and a numeric precision violation anywhere in the request, including schema (422).
Every response from a workflow that got as far as the reservation carries an
operation_id that identifies this specific run.
Response (402 — balance below the reserved maximum, not charged)
{
"error": "Insufficient credits",
"required": 12,
"remaining_balance": 5,
"operation_id": "3f6c2a9e-1d4b-4c7a-9e21-5b8d0a7c4e14"
}
Response (409 — reservation could not be confirmed, no step ran)
{
"error": "billing_unconfirmed",
"retryable": false,
"message": "Whether this request was billed could not be confirmed. Do not retry automatically. Check your balance with GET /api/v1/status first, and quote operation_id if it looks wrong.",
"operation_id": "3f6c2a9e-1d4b-4c7a-9e21-5b8d0a7c4e15"
}
The reservation may or may not have been taken from your balance, and no step ran. Do not
retry automatically: check your balance with GET /api/v1/status first, and
quote the operation_id to support if it looks lower than expected. See "When
the Billing Outcome Cannot Be Confirmed" below.
Response (409 — billing settlement unavailable, do not retry)
{
"error": "billing_settlement_unavailable",
"retryable": false,
"message": "Billing for this run could not be settled. Do not retry automatically. Check your balance with GET /api/v1/status and quote operation_id if it looks wrong.",
"operation_id": "3f6c2a9e-1d4b-4c7a-9e21-5b8d0a7c4e16"
}
GET /api/v1/status, and if it looks lower than expected,
contact support (Contact Us → Open Support Chat) and include the
operation_id so the run can be reconciled.
If the platform cannot confirm a change to your balance, it does not guess. It tells you
the outcome is unknown and gives you an operation_id to quote. These
responses use HTTP 409 rather than 503 on purpose: the platform gateway
replaces the body of every 5xx response with a generic message, which would hide
everything below. They can occur on every billed endpoint (clean,
schema, transform, ai-clean, and workflows), and no
result is returned with them.
{
"error": "billing_unconfirmed",
"retryable": false,
"message": "Whether this request was billed could not be confirmed. Do not retry automatically. Check your balance with GET /api/v1/status first, and quote operation_id if it looks wrong.",
"operation_id": "3f6c2a9e-1d4b-4c7a-9e21-5b8d0a7c4e12"
}
What to do: do not retry automatically (for a workflow, a retry runs it
again and reserves the maximum a second time). Check your balance with
GET /api/v1/status. If it looks lower than expected, contact support
(Contact Us → Open Support Chat) and include the operation_id so the run can
be reconciled.
Successful response with refund_pending
{
"success": true,
"data": { "a": 1 },
"changes": [],
"schema_valid": null,
"used_ai": false,
"remaining_balance": null,
"refund_pending": true,
"operation_id": "3f6c2a9e-1d4b-4c7a-9e21-5b8d0a7c4e17"
}
Here the result is valid and is returned (the HTTP status is whatever the processing
returned, usually 200). What could not be confirmed is the refund of the unused part of
the credits reserved up front. refund_pending means the outcome is unconfirmed,
not that the refund definitely failed. Currently this applies to /ai-clean.
remaining_balance is null when your balance could not be read at
that moment; otherwise it is the balance read right after the failed refund. Check your
balance and quote the operation_id if it looks wrong.
Generic 5xx responses
Any 5xx response from this API, including an unexpected internal error (500), reaches you
as HTTP 503 with a generic body; the details field names the upstream status:
{
"success": false,
"error": "Service error",
"message": "This module is temporarily experiencing issues.",
"details": "Module returned 503"
}
The 503 responses this API produces on purpose (maintenance, balance unreadable before
anything is reserved, or a service unreachable after the reserved credits were refunded
and the refund confirmed) never charge you. An unexpected internal error looks the same,
so before retrying ai-clean or a workflow, check your balance with
GET /api/v1/status. Clients that retry 5xx automatically should not do so
for these endpoints, and must never retry a 409.
const res = await fetch(
'https://json.flyingfishspace.com/api/json/v1/clean',
{
method: 'POST',
headers: {
'X-API-Key': 'ffs_live_YOUR_KEY',
'Content-Type': 'application/json',
},
body: brokenJsonString,
}
);
const { success, data, repairs, remaining_balance } = await res.json();
if (success) console.log(data);
import requests
res = requests.post(
"https://json.flyingfishspace.com/api/json/v1/clean",
headers={"X-API-Key": "ffs_live_YOUR_KEY"},
data=broken_json_string,
)
result = res.json()
if result["success"]:
print(result["data"])
req, _ := http.NewRequest("POST",
"https://json.flyingfishspace.com/api/json/v1/clean",
strings.NewReader(brokenJSON))
req.Header.Set("X-API-Key", "ffs_live_YOUR_KEY")
req.Header.Set("Content-Type", "application/json")
client := &http.Client{}
resp, _ := client.Do(req)
401 and are not counted.
Per-account limits
429 and
does not charge any credits. The response carries X-RateLimit-Limit,
X-RateLimit-Remaining and X-RateLimit-Reset (seconds until the
window resets); the same headers are included on successful responses. Wait for
X-RateLimit-Reset seconds before retrying, and back off further if you keep
receiving 429. A rate limit is not a ban: once the window resets you can
continue normally.
GET /api/v1/status is limited to 20
requests per 60 seconds per IP address (accounts behind a shared IP address share this
counter); exceeding it returns 429 and can lead to a temporary block of that IP address on
account and billing endpoints, so check your balance when you need it rather than in a
tight loop. Account and payment endpoints (creating a UUID, issuing or
revoking API keys, checkout) have separate, stricter protections against abuse. Traffic that
looks abusive, such as a flood of invalid requests, may also be throttled or blocked by the
platform's security layer.
Payload size