Sign In
Guide10 min read

Generate Mock Data

Describe what you need in plain English. RadMah AI generates production-realistic data with a cryptographic evidence bundle — in seconds, not hours.

What you'll build

By the end of this guide you will have generated 1,000 realistic restaurant order records complete with customer names, menu items, prices, and payment methods — plus a signed evidence bundle proving the data's integrity.

Prerequisites

RequirementDetails
RadMah AI accountFree tier is sufficient. Sign up here.
API keyCreate one in Settings → API Keys. See Authentication guide.
Language runtimePython 3.10+ (or any HTTP client for the REST API)
1

Install the SDK

Choose your language and install the RadMah AI SDK.

Install
pip install radmah-sdk
2

Authenticate

Initialize the client with your API key. All requests are authenticated via the X-API-Key header.

Initialize client
from radmah_sdk import RadMahClient

client = RadMahClient(
    api_key="sl_live_your_key_here",
    base_url="https://api.radmah.ai"  # optional
)

Keep your API key secret

Never commit API keys to source control. Use environment variables or a secrets manager in production.

3

Create a session and describe your data

Open a chat session and describe the data you need in plain English. The AI orchestrator translates your description into a typed sealed contract specification automatically.

Create session and send request
# Create a chat session
session = client.create_chat_session()

# Describe what you need — the AI handles the rest
response = client.send_chat_message(
    session.id,
    "Generate 1000 records of restaurant orders with "
    "customer names, menu items, prices, quantities, "
    "payment methods, and order dates"
)

# The orchestrator creates an agent project
project_id = response["results"][0]["data"]["project_id"]
print(f"Project created: {project_id}")
4

Review and approve the execution plan

Before generating data, RadMah AI shows you exactly what it will do and the estimated cost. You review the plan and approve or reject it. Nothing runs without your explicit consent.

Approve execution plan
import time, json

# Wait for the plan to be ready
while True:
    project = client.get_agent_project(project_id)
    if project.status != "planning":
        break
    time.sleep(2)

# Inspect the plan
plan = json.loads(project.plan) if isinstance(project.plan, str) else project.plan
for step in plan:
    print(f"  Step {step['step_index']}: {step['tool_name']}")

# Review cost estimate
print(f"Estimated cost: {project.cost_summary}")

# Approve — this starts execution
if project.status == "awaiting_approval":
    client.approve_agent_project(project_id)
    print("Plan approved — generation starting")

Execution Pipeline

fabricate_contractcreate_sealmock_dataverify

The orchestrator runs this pipeline automatically. Each step produces artifacts that feed into the next.

5

Wait for generation to complete

Poll the project status until it reaches complete. Typical mock generation finishes in 5-30 seconds depending on row count.

Poll for completion
# Poll until complete
for i in range(120):
    project = client.get_agent_project(project_id)
    steps = " | ".join(
        f"{s.tool_name}={s.status}" for s in (project.steps or [])
    )
    if i % 4 == 0:
        print(f"  [{project.status}] {steps}")

    if project.status in ("complete", "failed", "blocked"):
        break
    time.sleep(3)

print(f"Final status: {project.status}")
6

Download your data

Once complete, download the generated CSV files and evidence bundle. Each generation produces a signed, cryptographically-chained evidence bundle — this is unconditional and cannot be disabled.

Download artifacts
import os

os.makedirs("output", exist_ok=True)

for step in project.steps or []:
    job_id = getattr(step, "job_run_id", None)
    if not job_id:
        continue

    # List artifacts for this step
    artifacts = client.list_artifacts(str(job_id))
    for artifact in artifacts:
        data = client.download_artifact(str(job_id), str(artifact.id))
        filename = f"output/{step.tool_name}_{artifact.name}"
        with open(filename, "wb" if isinstance(data, bytes) else "w") as f:
            f.write(data)
        print(f"Saved: {filename}")

    # Download evidence bundle
    evidence = client.get_evidence_data(str(job_id))
    print(f"Evidence: {evidence.get('seal_status')}")
    print(f"Artifacts: {len(evidence.get('artifact_index', {}).get('artifacts', []))}")

Evidence Bundle

Every generation job produces a signed evidence bundle. A cryptographic seal binds every artefact together — tampering with any one invalidates the entire bundle.

#ArtifactPurpose
1sealed contractMachine-readable generation specification
2Run ManifestExecution telemetry — rows, timing, entity counts
3Constraint ReportHard/soft violation counts and details
4Determinism ProofCryptographic hash proving reproducibility (same seed = same output)
5Privacy ReportDifferential privacy and re-identification risk analysis
6Utility MetricsStatistical fidelity — distribution accuracy, correlation preservation
7Artifact ManifestIndex of every artefact with cryptographic hashes
8Timing TelemetryPer-step execution timing and resource usage
9Evidence SealCryptographic seal binding every artefact

What you get

CSV Data Files

Production-realistic records with domain-appropriate names, values, and relationships. Ready for testing, demos, or development.

Evidence Bundle

Signed evidence bundle proving integrity, determinism, privacy, and constraint compliance. Audit-ready.

REST API (cURL)

Prefer raw HTTP? Every SDK method maps directly to a REST endpoint.

REST API
# 1. Create a chat session
curl -X POST https://api.radmah.ai/v1/client/chat/sessions \
  -H "X-API-Key: sl_live_your_key_here" \
  -H "Content-Type: application/json"

# 2. Send your request
curl -X POST https://api.radmah.ai/v1/client/chat/sessions/{session_id}/messages \
  -H "X-API-Key: sl_live_your_key_here" \
  -H "Content-Type: application/json" \
  -d '{"content": "Generate 1000 records of restaurant orders"}'

# 3. Approve the plan
curl -X POST https://api.radmah.ai/v1/client/agent/projects/{project_id}/approve \
  -H "X-API-Key: sl_live_your_key_here"

# 4. Poll status
curl https://api.radmah.ai/v1/client/agent/projects/{project_id} \
  -H "X-API-Key: sl_live_your_key_here"

# 5. Download artifacts
curl https://api.radmah.ai/v1/client/jobs/{job_id}/artifacts \
  -H "X-API-Key: sl_live_your_key_here"

Next steps