Principio API

A program synthesis + evaluation API for Principio expressions. Compose programs from IO, translate to readable forms, evaluate and decompose programs, and bootstrap domain primitives.

Synthesis
Evaluation
Translation
Parsing
Browser Automation

Program Synthesis

Generate Principio programs from input/output samples with the unification service.

Program Evaluation

Execute Principio programs and infer argument/output types.

Program Translation

Render programs as math or natural language with constant substitution.

Program Decomposition

Linearize and trace program execution into interpretable fragments.

Domain Bootstrapping

Register primitives and constants for domain-specific evaluation.

Parsing & Browser Tasks

Parse programs into fragments/constants or run browser synthesis tasks.

Interactive Docs

Explore full schemas and try requests live.

Endpoints & Example Payloads

Base URL: https://principio.byte-genie.com

GET /health
Health check.
No request body.
POST /unification/compose
Synthesize a program from IO samples.
{
  "samples": [
    { "inputs": [1, 2], "output": 3 },
    { "inputs": [5, 7], "output": 12 }
  ],
  "timeout_seconds": 5,
  "max_workers": 2,
  "use_pattern_seeds": true
}
POST /unification/enumerate
Enumerate candidate programs for one or more tasks.
{
  "primitive_names": ["add", "mul", "inc"],
  "tasks": [
    {
      "name": "add_example",
      "samples": [{ "inputs": [2, 3], "output": 5 }]
    }
  ],
  "enumeration_timeout": 3,
  "cpus": 1
}
POST /evaluation/run
Evaluate a Principio program on inputs.
{
  "program": "(lambda (x y) (+ x y))",
  "inputs": [4, 6]
}
POST /evaluation/run_batch
Evaluate the same program over multiple input sets.
{
  "program": "(lambda (x) (* x x))",
  "inputs_list": [[2], [3], [4]]
}
POST /evaluation/bootstrap/company_genie
Load company-genie primitives.
{}
POST /evaluation/bootstrap/company_genie_writer
Load company-genie writer primitives.
{}
POST /evaluation/bootstrap/expense_analysis
Load expense analysis primitives.
{}
POST /evaluation/bootstrap/nlp
Load NLP primitives.
{}
POST /evaluation/bootstrap/user_inputs
Load user input primitives.
{}
POST /evaluation/bootstrap/product_genie
Load product-genie primitives.
{}
POST /evaluation/bootstrap/customer_rewards
Load customer rewards primitives.
{}
POST /translation/render
Translate a program into math or natural language.
{
  "program": "(lambda (x) (+ x 10))",
  "modes": ["math", "natural_language"],
  "constants": { "ten": 10 }
}
POST /decomposition/linearize
Trace program execution into linear fragments.
{
  "program": "(lambda (x y) (+ (* x x) y))",
  "inputs": [3, 4],
  "max_fragments": 5
}
POST /registration/register
Register custom primitives, constants, or domains.
{
  "domains": ["arithmetic", "list"],
  "constants": [
    { "name": "tax_rate", "value": 0.07, "type": "treal" }
  ],
  "primitives": [
    { "name": "two", "value": 2, "type": "tint" }
  ]
}
POST /parse/program
Parse a program into fragments and dependencies.
{
  "program": "(lambda (x) (inc (inc x)))",
  "bootstrap": "nlp"
}
POST /parse/constants
Extract constant primitives used by a program.
{
  "program": "(lambda (x) (+ x discount_rate))",
  "bootstrap": "customer_rewards"
}
POST /browser/synthesize/get_page_source
Run the page-source synthesis pipeline.
{
  "session_id": "session-123",
  "client_id": "frontend-1",
  "timeout_s": 30,
  "use_mock": true
}
POST /browser/synthesize/web_search
Run the web-search synthesis pipeline.
{
  "session_id": "session-123",
  "client_id": "frontend-1",
  "timeout_s": 30,
  "queries": ["principio api", "program synthesis"]
}
POST /browser/synthesize/sales_dashboard
Run the sales dashboard synthesis pipeline.
{
  "session_id": "session-123",
  "client_id": "frontend-1",
  "timeout_s": 30
}
WS /browser/ws/{session_id}/{client_role}?client_id=frontend-1
Websocket bridge for browser automation sessions.
{
  "event": "connected",
  "role": "frontend",
  "session_id": "session-123",
  "client_id": "frontend-1"
}