JsonFabrica

Getting Started

This guide walks through the whole first-use flow: signing up, getting an API key, creating a template, and generating your first piece of synthetic JSON data.

Base URL

This documentation currently shows examples against a local/self-hosted gateway (http://localhost:4000). A hosted production API endpoint is not yet publicly available — check back once it's announced, or run the gateway yourself per the repo's self-hosting instructions.

1. Sign up and get your API key

Signing up is a single API call — no dashboard step required. You'll need:

  • An email address.
  • A plan tier: starter, growth, or business (larger enterprise plans are arranged directly with sales, not via self-serve signup). There is no free tier. Only starter starts with a 30-day free trial, then converts to the plan's monthly rate; growth and business are billed immediately at signup, with no trial.
  • A payment method reference (required at signup for every tier — this is used for account verification and abuse prevention). On starter, your card is not charged during the 30-day trial; if you don't cancel first, it is automatically charged the Starter monthly rate on day 31. On growth and business, your card is charged the plan's monthly rate immediately at signup.
curl
curl -s -X POST http://localhost:4000/v1/signup \
  -H 'content-type: application/json' \
  -d '{
        "email": "[email protected]",
        "tier": "starter",
        "paymentMethodId": "pm_card_visa"
      }'

A successful response looks like this:

201 response
{
  "apiKey": "sk_...",
  "tenantId": "tenant_...",
  "tier": "starter",
  "status": "active"
}

Save the apiKey value immediately. For security, it is only ever shown once, at signup time — there is no way to retrieve it again later if you lose it.

If signup is blocked (for example, because of a declined card), you'll get a response like:

{
  "apiKey": "",
  "tenantId": "tenant_...",
  "tier": "starter",
  "status": "blocked",
  "blockReason": "card-declined"
}

2. Authenticate your requests

Every API call after signup must include your API key in the Authorization header:

Authorization: Bearer sk_...

You can sanity-check that your key works with:

curl
curl -s http://localhost:4000/v1/whoami \
  -H 'Authorization: Bearer sk_...'

which returns:

{ "tenantId": "tenant_...", "role": "user" }

3. Understand template syntax

Templates are plain JSON documents with placeholders inside them. Placeholders call a data-generation function using angle brackets:

<functionName(arg1, arg2, ...)>

For example, a minimal template that generates a random full name and an auto-incrementing user id looks like this:

{ "name": "<getRandomFullName()>", "id": "<createSeq('userId')>" }

Templates also support loops and conditionals, for example:

<for(i, 1, 3)><if(getVar(i) == 1)>first<else>rest<endIf><end_for>

See the Function Reference for the full list of available functions.

4. Create your first template

Create a template by sending its name and body to the API:

curl
curl -s -X POST http://localhost:4000/v1/templates \
  -H 'Authorization: Bearer sk_...' \
  -H 'content-type: application/json' \
  -d '{
        "name": "user-profile",
        "body": "{ \"id\": \"<createSeq(\"users\")>\" }"
      }'

A template must contain at least one placeholder — a template made up of plain literal text only will be rejected. Every function you reference in a template must be one of the built-in supported functions.

5. Generate data

Once your template is saved, generate data from it at any time:

curl
curl -s -X POST http://localhost:4000/v1/templates/<templateId>/generate \
  -H 'Authorization: Bearer sk_...' \
  -H 'content-type: application/json' \
  -d '{}'

A successful response looks like this:

200 response
{
  "data": { "id": 1 },
  "meta": {
    "seed": 12345,
    "templateId": "tpl_...",
    "generatedAt": "2026-08-08T00:00:00.000Z"
  }
}
  • data is your generated JSON document.
  • meta.seed is the random seed used for this generation run — pass the same seed back in on your next call to reproduce identical output.
  • meta.generatedAt is the timestamp of generation.

If you'd rather generate data without saving a template first, you can send the template body directly to a one-off endpoint:

curl
curl -s -X POST http://localhost:4000/v1/templates/generate \
  -H 'Authorization: Bearer sk_...' \
  -H 'content-type: application/json' \
  -d '{"body":"{ \"n\": \"<getRandomNumber(1,10)>\" }"}'

This still counts toward your usage, but nothing is saved to your account.

What's next