Important
The NexArt Canonical Renderer is not a free public service. All certified execution requires an authenticated account.
TL;DR for Agents
- Local execution is free. No account required.
- Canonical renderer always requires an account + API key.
- There is no anonymous or public node.
- Output is binary PNG, not JSON.
- Certification is what is metered and billed.
Execution Model
NexArt supports two execution paths:
1. Local Deterministic Execution
- Uses
@nexart/codemode-sdkor@nexart/cli - Free, unlimited, no account required
- Deterministic output on your machine
- No network calls, no metering
2. Canonical Certified Execution
- Uses
POST /api/renderon the canonical renderer - Requires an authenticated account and valid API key
- Produces auditable, verifiable proof artifacts
- Metered against account quota
Canonical Renderer API
POST /api/renderAuthentication
All requests require a valid API key:
Authorization: Bearer nx_live_...All canonical access is authenticated. There is no public endpoint, no anonymous mode, and no way to render without a valid API key.
Request Payload (Strict)
{
"code": "function setup() { background(50); }",
"seed": "12345",
"VAR": [50, 50, 50, 0, 0, 0, 0, 0, 0, 0],
"protocolVersion": "1.2.0"
}| Field | Type | Required | Notes |
|---|---|---|---|
code | string | Yes | The generative sketch code |
seed | string | Yes | Random seed for deterministic output |
VAR | number[] | Yes | Exactly 10 values (VAR[0..9]) |
protocolVersion | string | Recommended | Defaults to current if omitted |
Recommendation
Agents should always send protocolVersion explicitly. This ensures reproducibility and prevents output drift when the renderer updates.
Output Format (Critical)
- Content-Type:
image/png - Resolution: 1950×2400 pixels (fixed, non-configurable)
- Body: Binary PNG data
Critical Warning
Do NOT call response.json() on this endpoint. The response is binary image data, not JSON.
Correct Handling (JavaScript)
const response = await fetch('/api/render', {
method: 'POST',
headers: {
'Authorization': 'Bearer nx_live_...',
'Content-Type': 'application/json'
},
body: JSON.stringify({ code, seed, VAR, protocolVersion })
});
// CORRECT: Handle as binary
const buffer = await response.arrayBuffer();
const blob = new Blob([buffer], { type: 'image/png' });
// WRONG: Do not do this
// const data = await response.json(); // ❌ Will throw errorArtifact vs Proof
| Type | Format | Purpose |
|---|---|---|
| Artifact | PNG (binary) | The rendered image at canonical resolution |
| Proof | Snapshot (JSON) | Metadata for verification: hashes, inputs, protocol version |
The PNG is portable and viewable. The snapshot enables verification by re-rendering and comparing hashes.
// Snapshot structure
{
"protocolVersion": "1.2.0",
"seed": "12345",
"VAR": [...],
"codeHash": "sha256:...",
"outputHash": "sha256:...",
"timestamp": "2025-01-27T..."
}Quotas & Metering
- Quotas are enforced at the account level
- All API keys under one account share the same quota
- Only successful renders (HTTP 200) count toward usage
- Quota is checked before rendering begins
- When quota is exceeded, the renderer returns HTTP 429 and does not render
Quota Headers
Successful responses include:
| Header | Meaning |
|---|---|
X-Quota-Limit | Monthly quota for the account |
X-Quota-Used | Renders used this month |
X-Quota-Remaining | Renders remaining this month |
Error Semantics
Stable HTTP status codes for programmatic handling:
| Code | Meaning | Agent Action |
|---|---|---|
400 | Protocol violation (e.g., wrong canvas size, invalid VAR) | Fix request payload |
401 | Missing or invalid API key | Check Authorization header |
403 | API key disabled or account suspended | Contact account owner |
429 | Quota exceeded or rate limited | Wait or upgrade plan |
503 | Service temporarily unavailable | Retry with backoff |
What NexArt Never Charges For
@nexart/codemode-sdk, Free@nexart/cli, Free- Local deterministic execution, Free
- Verification of existing snapshots, Free
- Reading documentation, Free
Only certified renders via the canonical renderer are metered.
One-Line Rule for Agents
Rule
If you need a verifiable proof that the output is canonical, call the canonical renderer with a valid API key. Otherwise, execute locally for free.
Related Documentation
- NexArt Documentation, Full API and SDK documentation
- CLI Documentation, Local execution commands
- Protocol Compliance, Acceptance checklist for renderers
- Pricing, Plan limits and certified run quotas