API Creator · Script to API

NO MICROSERVICE

Quickly create dynamic, custom APIs in Groovy or JavaScript — without a dedicated server.

Write JavaScript or Groovy in the editor. Apinizer compiles it, deploys it across every Worker, and routes traffic — with the same auth, throttling, audit, and analytics as your hand-written services. Full flexibility and control without standing up a separate runtime.

  • LanguagesJavaScript · Groovy
  • EnginesGraalVM 24.2 · Groovy 3.0
  • Cold startPre-compiled at deploy — none

Capabilities · deep dive

Four properties that make code first-class on the gateway.

Two engines tuned for hot paths. Bindings already in scope. Save-to-live in under three seconds. Same auth, throttle, and audit pipeline as a hand-written service.

01 · JAVASCRIPT OR GROOVY

Write code. Save. Ship.

Pick a language. Type the function. Apinizer wires the route, compiles the script, and your endpoint is live across every Worker replica — usually in under three seconds.

  • Modern JavaScript (async/await, Date, JSON, fetch-style http client)
  • Groovy 3.0 with full Java interop and access to JDK libraries
  • Editor with syntax highlighting, error markers, and inline compile feedback
  • No CI/CD wait — deploy is part of save
  • JavaScript
  • Groovy
  • compile on save
Script-to-API editor with a Groovy endpoint enriching a customer record by reading a JWT claim and calling an internal service.

02 · TWO ENGINES, BOTH HOT

GraalVM for JS. Pre-compiled classes for Groovy.

JavaScript runs on GraalVM Polyglot — one shared Engine, fresh Context per request, full Java interop. Groovy compiles to a Class at deploy time and dispatches lock-free, so neither language pays a warm-up cost on the request path.

  • JavaScript: GraalJS 24.2.1 — shared Engine, per-request Context, HostAccess.ALL
  • Groovy: 3.0.25 — pre-compiled to Class at deploy, volatile lock-free dispatch
  • Automatic javax → jakarta migration so legacy Groovy code keeps compiling
  • Correlation-ID checked before/after execution — detects thread leaks in user code
  • GraalJS 24.2
  • Groovy 3.0
  • no warm-up
  • thread-leak guard
Two engine cards — GraalVM Polyglot for JavaScript at 1.4 ms p50, and pre-compiled Groovy class at 0.8 ms p50.

03 · BINDINGS

Everything your script needs is already in scope.

Apinizer hands the script the parsed request, an HTTP client tuned by the platform, a query helper for any registered datasource, and a shared variable bag that carries values across policies. No imports. No wiring.

  • request — url, method, body, headers, query/path params, JWT claim helpers
  • http — get / post / put with .asJson() / .asText() / .asBytes()
  • db — query a registered datasource by name, with named parameters
  • vars — shared variable bag readable by every policy in the request flow
  • request
  • http
  • db
  • vars

Same lane for AI

Script-to-API can also enrich AI traffic — a Groovy script can rewrite a prompt, attach a system message, or strip PII before the request hits an LLM provider.

Four binding cards — request, http, db, vars — each with the methods exposed to the script.

04 · SAVE → LIVE → AUDIT

Save to live URL in under three seconds. Audit trail is automatic.

Hit save. Apinizer compiles, syncs every Worker replica, and the endpoint serves traffic. Every save and every promotion is captured in an audit log keyed to the user, with full diffs — so 'who changed the script and when' is never a question for the security team.

  • Compile + deploy + serve in seconds, no pod scheduling
  • Audit log with user, timestamp, diff, and promoted-from version
  • Same auth, throttle, cache, and Elasticsearch analytics as a real proxy
  • APIops manifests so script endpoints ship through CI/CD if you want them to
  • audit log
  • diff
  • APIops
  • Elasticsearch
Deploy timeline — save, compile, deploy, live URL — followed by an audit trail listing user, timestamp, and change.

In the box

What's included

The capabilities below are part of the standard install — no add-on SKUs and no separate licenses.

Languages & engines

  • JavaScript on GraalJS 24.2.1 — async/await, JSON, Date, full ES support
  • Groovy 3.0.25 with full Java interop and JDK access
  • Pre-compiled at deploy — no warm-up cost on the request path
  • javax → jakarta auto-migration for legacy Groovy code

Bindings

  • request — url, method, body, headers, query/path params, JWT claims
  • http — get / post / put with JSON, text, or bytes responses
  • db — query any registered datasource with named parameters
  • vars — shared variable bag across the policy chain
  • Throw with status to halt the flow and return a custom error

Pipeline integration

  • Same auth surface as gateway proxies (OAuth 2.0, JWT, API key, mTLS)
  • Throttling, quotas, IP allow-lists, scope-based access
  • Audit log + Elasticsearch analytics + Prometheus metrics
  • APIops manifests so script endpoints ship through CI/CD like any other proxy

Skip the microservice

Twelve lines of code shouldn't ship as a service.

See Script to API — JavaScript and Groovy — running on a real gateway in a 20-minute walkthrough, including the audit trail and pipeline integration.