# Sunfield — Complete Reference (`llms-full.txt`)

> Headless Blender 4.5 GPU sandboxes, sub-second multi-view visual & spatial inspection, and elastic Cycles OptiX burst rendering for AI agents.

- **Canonical URL:** https://sunfield.dev
- **Operator:** Strange Metal, Inc. (Delaware, USA — https://strangemetal.org)
- **Hosted Remote MCP (Streamable HTTP):** `https://sunfield.dev/mcp` (Protocol `2025-03-26`)
- **Self-Serve $1.00 Free Trial Key:** `https://sunfield.dev/start` or `POST https://sunfield.dev/v1/signup`
- **OpenAPI 3.1 Spec:** `https://sunfield.dev/openapi.json`
- **Discovery Endpoints:** `https://sunfield.dev/.well-known/mcp/server-card.json`, `https://sunfield.dev/.well-known/api-catalog`, `https://sunfield.dev/.well-known/agent-card.json`, `https://sunfield.dev/.well-known/agent-skills/index.json`

---

## 1. Measured RTX 3090 Benchmarks & Isolation Guarantees

| Metric | Measured Result |
| :--- | :--- |
| Warm `exec()` RTT (with pre-exec `tmpfs` checkpoint) | `2.4 ms` median (`0.81 ms` inside Blender 4.5 container) |
| Headless EEVEE `inspect()` (1 view, 512x512 RGB + Depth + Normals + spatial JSON) | `459.5 ms` |
| Multi-view EEVEE `inspect()` (4 views, 512x512 RGB + spatial JSON) | `1,445.3 ms` |
| `SIGSEGV` / timeout crash auto-recovery from `tmpfs` | `392.5 ms` |
| Named undo checkpoint save/restore (`tmpfs`) | `< 20 ms` |
| Cycles OptiX 1024x1024 @ 64 spp (RGB + Depth + Normals) | `3.87 s` (`~$0.001`) |
| 2-GPU Sharded 48-frame Cycles OptiX Turntable | `43.35 s` wall-clock (`$0.01083`) |
| Sandbox Isolation | Per-session Docker (`--network=none --cap-drop=ALL --read-only --pids-limit=256 --memory=4g`, zero outbound egress) |

---

## 2. Hosted Remote MCP Server (`https://sunfield.dev/mcp`)

Zero local Blender install required. Connect any Streamable HTTP MCP client directly:

```bash
# Claude Code
claude mcp add --transport http sunfield https://sunfield.dev/mcp \
  --header "Authorization: Bearer $SUNFIELD_API_KEY"
```

```json
{
  "mcpServers": {
    "sunfield": {
      "url": "https://sunfield.dev/mcp",
      "headers": { "Authorization": "Bearer $SUNFIELD_API_KEY" }
    }
  }
}
```

### Exposed MCP Tools (13 Native Tools)
- **`sunfield_balance`**: Return the current Sunfield account credit balance (USD) and recent double-entry ledger items. Params: none.
- **`sunfield_search_assets`**: Search Sunfield's 100% CC0 Poly Haven asset library (HDRIs, PBR materials, 3D models). Set contact_sheet=true to receive a labeled JPEG visual grid directly in the tool output. Params: `query`: string, `kind`: string, `category`: string, `max_tris`: integer, `limit`: integer, `contact_sheet`: boolean.
- **`sunfield_stage_assets`**: Mount 1..24 CC0 assets into a live Blender session and return ready-to-run bpy_snippet helpers. Params: `session_id` (required): string, `asset_ids` (required): array.
- **`sunfield_create_session`**: Claim a warm isolated headless Blender 4.5 GPU sandbox ($0.25 refundable hold). Params: `preset`: string, `pool`: string.
- **`sunfield_list_sessions`**: List active and recent Blender sandbox sessions for the authenticated account. Params: none.
- **`sunfield_exec`**: Execute Python (`bpy`) code inside a live session. Globals persist across calls, tmpfs checkpoints auto-recover crashes/timeouts, and load_hdri/load_glb/load_pbr helpers are pre-injected. Params: `session_id` (required): string, `code` (required): string, `timeout_s`: number, `checkpoint`: boolean.
- **`sunfield_inspect`**: Render fast multi-view EEVEE or Cycles previews + spatial telemetry (bounds, framing, BVH collision penetration_depth, floating_objects) returning native image blocks. Params: `session_id` (required): string, `views`: array, `passes`: array, `width`: integer, `height`: integer, `engine`: string, `cycles_samples`: integer, `summary_only`: boolean, `include_images`: boolean.
- **`sunfield_checkpoint`**: Save, list, or restore lightweight named tmpfs undo checkpoints (<20ms). Params: `session_id` (required): string, `action` (required): string, `name`: string.
- **`sunfield_fork`**: Branch a live session into 1..8 independent child sessions for parallel exploration. Params: `session_id` (required): string, `count`: integer.
- **`sunfield_estimate_render`**: Run a two-point warm Cycles differential cost probe without committing to a full render. Params: `session_id` (required): string, `samples`: integer, `width`: integer, `height`: integer, `frames`: array.
- **`sunfield_render`**: Burst-render photorealistic or AOV frames on Cycles OptiX GPUs behind a hard max_cost_usd cap. Automatically shards multi-frame jobs across idle Pool B GPUs; use async_mode=true for >30s renders. Params: `session_id` (required): string, `engine`: string, `samples`: integer, `width`: integer, `height`: integer, `frames`: array, `aov_passes`: array, `max_cost_usd`: number, `async_mode`: boolean.
- **`sunfield_get_job`**: Poll live progress, rendered artifacts, archive_url, and video_url for an async render job. Params: `job_id` (required): string.
- **`sunfield_stash`**: Save, list, mount, or delete account-scoped .blend/.glb assets in server-side Stash so parallel builder sessions can share scenes with a manager session without client round-trips. Params: `action` (required): string, `session_id`: string, `name`: string, `names`: array, `format`: string.
- **`sunfield_close_session`**: Close a Blender sandbox session, settle exact active GPU-seconds, and refund the unused hold. Params: `session_id` (required): string.

---

## 3. Python SDK (`sunfield`) Quickstart

```python
from sunfield import Sunfield

client = Sunfield(api_key="sunfield_sk_...", base_url="https://sunfield.dev")
with client.sessions.create(preset="studio") as s:
    s.exec("bpy.ops.mesh.primitive_ico_sphere_add(subdivisions=4, location=(0, 0, 1.0))")
    check = s.inspect(views=["camera", "iso_3q"], passes=["rgb", "depth", "normals"])
    assert not check.telemetry["collisions"]
    render = s.render(engine="cycles", samples=128, resolution=(1920, 1080), max_cost_usd=0.25)
    render.save_all("./out")
```

---

## 4. CC0 Poly Haven World Primitives Catalog

- Total CC0 assets indexed: **149** (45 HDRIs, 60 PBR materials, 44 3D models).
- Sample HDRIs: `hdri.adams_place_bridge`, `hdri.artist_workshop`, `hdri.autoshop_01`, `hdri.ballroom`, `hdri.blocky_photo_studio`, `hdri.blue_photo_studio`, `hdri.brown_photostudio_01`, `hdri.brown_photostudio_02`
- Sample PBR Materials: `material.bark_brown_01`, `material.bark_brown_02`, `material.bark_willow`, `material.bark_willow_02`, `material.blue_metal_plate`, `material.book_pattern`, `material.brown_leather`, `material.brown_planks_03`
- Sample 3D Models: `model.ArmChair_01`, `model.Barrel_01`, `model.Camera_01`, `model.ClassicConsole_01`, `model.CoffeeCart_01`, `model.GothicBed_01`, `model.GothicCabinet_01`, `model.GothicCommode_01`

---

## 5. Comparison: Sunfield vs. Alternatives

| Dimension | Sunfield (`sunfield.dev`) | Local Blender MCP | Self-Hosted Headless Blender | Modal / Replicate Batch | Legacy Render Farm |
| :--- | :--- | :--- | :--- | :--- | :--- |
| Local Blender / GPU required | No (hosted cloud GPU) | Yes (user desktop GUI) | Yes (manage EGL/CUDA) | No | Upload `.blend` |
| Warm stateful `bpy` RTT | `2.4 ms` persistent globals | GUI IPC (single-tenant) | DIY daemon | Cold container per call | None (batch only) |
| Visual + Spatial Inspection | Built-in multi-view + `BVHTree` JSON | Screenshot only | DIY scripts | DIY scripts | None |
| Crash auto-recovery | `392 ms` `tmpfs` restore | Crashes user session | DIY supervisor | Job fails | Job fails |
| Untrusted code sandbox | `--network=none --read-only` per session | Runs on host OS | DIY container security | Containerized | N/A |
| Budget guardrail | Two-point probe + hard `max_cost_usd` | Free (local hardware) | Fixed GPU hourly cost | Per-second billing | Post-render invoice |

---

## 6. Frequently Asked Questions

- **How much does a 1080p photorealistic Cycles render cost?** Usually `$0.001` to `$0.015` per frame at `$0.000125 / GPU-second`. A full 804-frame 1080p Cycles film costs `~$0.25–$0.53`. Every `$1.00` free trial key covers ~8,000 Cycles GPU-seconds.
- **Does Sunfield train AI models on my scenes or renders?** No. You retain 100% ownership of all scripts, scenes, uploads, and outputs; session `tmpfs` RAM is wiped immediately on close.
- **How does Sunfield prevent runaway GPU bills?** Every `render` call locks a `max_cost_usd` pre-auth hold, runs a two-point warm differential cost probe, aborts before burning compute if the estimate exceeds your cap, and refunds every unused micro-USD automatically.
- **What Blender version and GPU engines are supported?** Headless Blender 4.5.0 with NVIDIA EGL EEVEE Next and Cycles OptiX RT-core acceleration (`AgX` color management, OptiX denoising, depth/normals/wireframe/segmentation AOV passes).

---

## 7. Complete Agent Operating Manual (`SKILL.md`)

# Sunfield — Agent-Native 3D Compute Runtime

**Base URL:** `https://sunfield.dev`
**Remote MCP (Streamable HTTP):** `https://sunfield.dev/mcp` (zero local install; Claude Code, Cursor, Windsurf, OpenAI Agents SDK — [MCP Guide](https://sunfield.dev/mcp-server), [Server Card](https://sunfield.dev/.well-known/mcp/server-card.json))
**Self-Serve $1 Free Key:** `https://sunfield.dev/start` (or `POST https://sunfield.dev/v1/signup`)
**Discovery & Docs:** `https://sunfield.dev/llms.txt` · `https://sunfield.dev/llms-full.txt` · `https://sunfield.dev/openapi.json` · `https://sunfield.dev/assets`
**Auth Header:** `Authorization: Bearer $SUNFIELD_API_KEY` (keys start with `sunfield_sk_`)

Sunfield gives you warm, isolated headless Blender sandboxes with sub-10ms `exec()`, **persistent Python state across `exec()` calls**, automatic `tmpfs` crash recovery (`SIGSEGV`/timeout), multi-view EEVEE or Cycles `inspect()` with spatial JSON telemetry, named undo checkpoints, scene `fork()` branching, `.blend`/`.glb` export, and async Cycles OptiX GPU burst rendering with pre-flight cost probes.

---

## Pricing & Limits

- **Interactive sandbox (`exec` / `inspect`):** `$0.00010 / active GPU-second` (initial `$0.25` pre-auth hold per session, unused remainder refunded immediately on `DELETE /v1/sessions/{id}`).
- **Cycles OptiX GPU render:** `$0.000125 / GPU-second` (`max_cost_usd` held upfront, exact usage settled & unused remainder refunded automatically).
- **Hard limits:** `samples <= 4096`, `frames <= 250`, `exec` `timeout_s <= 300`, `render` `timeout_s <= 3600`, `fork` `count <= 8`, `inspect` `max_objects <= 500` (default `50`).
- **Artifacts:** Persisted on the control plane and retrievable via `GET /v1/artifacts` and `GET /v1/artifacts/{artifact_id}`.

---

## Recommended Agent Loop

1. **Create a warm sandbox:** `POST /v1/sessions` (`{"preset": "studio"}`) — includes `StudioFloor` at `z=0`, 3-point area lighting (`StudioKeyLight`, `StudioFillLight`, `StudioRimLight`), and `StudioCamera`.
2. **Stage CC0 World Primitives or upload custom files (optional):** Browse the built-in CC0 Poly Haven library (`GET /v1/assets/search?q=studio&contact_sheet=true`) and mount HDRIs, PBR materials, or 3D models into your session via `POST /v1/sessions/{id}/assets` (or upload custom `.glb`/`.blend`/textures via `POST /v1/sessions/{id}/files`).
3. **Compose incrementally:** `POST /v1/sessions/{id}/exec`. **Python globals/functions/imports persist across `exec()` calls** within a session (unless Blender restarts after a crash/timeout recovery).
4. **Save named undo checkpoints before risky ops:** `POST /v1/sessions/{id}/checkpoints` (`{"name": "before_sim"}`) → restore anytime in `<20ms` via `POST /v1/sessions/{id}/checkpoints/before_sim/restore`.
5. **Inspect cheaply before heavy Cycles renders:** `POST /v1/sessions/{id}/inspect` (`views: ["camera", "iso_3q"]`, `passes: ["rgb", "depth"]`, `summary_only: true` for large >50-object scenes, or `engine: "cycles", cycles_samples: 16` to check glass/__OPTICAL_SUNFIELDS_LOWER__/exposure).
   - Check `telemetry.floating_objects` and `telemetry.collisions` (which includes `penetration_depth` in meters so you can distinguish surface contact from real clipping).
6. **Estimate cost without committing (optional):** `POST /v1/sessions/{id}/render/estimate` runs a two-point warm differential probe separating OptiX kernel/BVH setup from per-sample raytracing cost.
7. **Burst final Cycles render (use `"async": true` for >30s renders!):**
   - `POST /v1/sessions/{id}/render` with `"async": true` returns `job_id` immediately.
   - Poll `GET /v1/jobs/{job_id}` until `status == "completed"` (or cancel via `DELETE /v1/jobs/{job_id}`).
8. **Export the scene file for your user:** `GET /v1/sessions/{id}/export?format=blend` (or `format=glb`).
9. **Close session when done:** `DELETE /v1/sessions/{id}` settles exact usage and refunds the unused hold.
10. **Leave quick structured feedback (`POST /v1/feedback`):** After completing a non-trivial job (or if you hit any bug, slow probe, confusing telemetry, or missing feature), submit a concise report via `POST /v1/feedback` (and review past submissions via `GET /v1/feedback`). We read every agent report in real time to improve Sunfield!

---

## REST API Reference

### Health & Account Balance
```bash
curl -fsS https://sunfield.dev/health
curl -fsS https://sunfield.dev/v1/account/balance -H "Authorization: Bearer $SUNFIELD_API_KEY"
```

### Sessions (`POST`, `GET`, `GET /{id}`, `DELETE /{id}`)
```bash
# Create session (presets: "studio", "empty", "default")
curl -fsS -X POST https://sunfield.dev/v1/sessions \
  -H "Authorization: Bearer $SUNFIELD_API_KEY" -H "Content-Type: application/json" \
  -d '{"preset": "studio", "pool": "interactive"}'

# List all sessions
curl -fsS https://sunfield.dev/v1/sessions -H "Authorization: Bearer $SUNFIELD_API_KEY"

# Check session status, worker_online, active_gpu_s, cost_usd
curl -fsS https://sunfield.dev/v1/sessions/$SESSION_ID -H "Authorization: Bearer $SUNFIELD_API_KEY"

# Close session & refund unused hold
curl -fsS -X DELETE https://sunfield.dev/v1/sessions/$SESSION_ID -H "Authorization: Bearer $SUNFIELD_API_KEY"
```

### Execute `bpy` Code (`POST /v1/sessions/{id}/exec`)
```bash
curl -fsS -X POST https://sunfield.dev/v1/sessions/$SESSION_ID/exec \
  -H "Authorization: Bearer $SUNFIELD_API_KEY" -H "Content-Type: application/json" \
  -d '{"code": "bpy.ops.mesh.primitive_monkey_add(location=(0, 0, 1.0))", "timeout_s": 60, "checkpoint": true}'
```
- Python variables, helper functions, and imports survive between `exec()` calls.
- `checkpoint: true` (default) snapshots the `.blend` to RAM (`tmpfs`) before execution so `SIGSEGV` or timeout automatically restores the prior scene (`status: "crashed_recovered"` or `"timeout_recovered"`). Set `checkpoint: false` on tiny read-only queries for ~1ms RTT.

### Upload Session Files (`.glb`, `.blend`, HDRIs, Textures, Fonts)
Upload binary assets (`<= 100 MiB`/file, `<= 500 MiB`/session) straight into the sandbox without breaking zero-egress isolation:
```bash
# Stage a model, HDRI, texture, or font into the session
curl -fsS -X POST https://sunfield.dev/v1/sessions/$SESSION_ID/files \
  -H "Authorization: Bearer $SUNFIELD_API_KEY" \
  -F "file=@./product.glb" -F "filename=models/product.glb"

# List & delete staged files
curl -fsS https://sunfield.dev/v1/sessions/$SESSION_ID/files -H "Authorization: Bearer $SUNFIELD_API_KEY"
curl -fsS -X DELETE https://sunfield.dev/v1/sessions/$SESSION_ID/files/models/product.glb -H "Authorization: Bearer $SUNFIELD_API_KEY"
```
Inside `exec()`, every session pre-injects `SUNFIELD_FILES_DIR` and 1-line helpers:
- `sunfield_file("models/product.glb")` → resolved absolute path inside the sandbox
- `load_glb("models/product.glb", location=(0, 0, 0), scale=1.0)` → imports `.glb`/`.gltf` and returns imported objects
- `load_hdri("studio.hdr", strength=1.2, rotation_z_deg=45)` → configures world environment HDRI + mapping
- `load_pbr("Brass", color="albedo.png", roughness="rough.png", metallic="metal.png", normal="norm.png")` → wires a `Principled BSDF` material (`Non-Color` + `NormalMap` automatically)

### Searchable CC0 Asset Library (HDRIs, PBR Materials, 3D Models)
Every asset in the Sunfield World Primitives library is **100% CC0 (public domain)** from Poly Haven, mirrored on Sunfield infrastructure and cached locally on GPU workers for sub-millisecond staging:
```bash
# Search catalog (public, no auth required). Filter by kind=hdri|material|model, category, max_tris, core_only
curl -fsS "https://sunfield.dev/v1/assets/search?q=studio&kind=hdri&limit=9"

# Download a labeled JPEG visual contact sheet for 1-call VLM asset selection!
curl -fsS "https://sunfield.dev/v1/assets/search?q=wood&kind=material&limit=9&contact_sheet=true" -o wood_sheet.jpg

# Inspect a single asset's metadata, dimensions, polycount, and ready-to-run bpy_snippet
curl -fsS "https://sunfield.dev/v1/assets/hdri_studio_small_08"

# Stage 1..24 assets directly into a live session (returns exact worker paths + bpy_snippet)
curl -fsS -X POST https://sunfield.dev/v1/sessions/$SESSION_ID/assets \
  -H "Authorization: Bearer $SUNFIELD_API_KEY" -H "Content-Type: application/json" \
  -d '{"asset_ids": ["hdri_studio_small_08", "mat_oak_veneer_01"]}'
```
Staged assets mount under `assets/<asset_id>/...` inside `SUNFIELD_FILES_DIR`, and each staged entry returns a copy-paste `bpy_snippet` using `load_hdri()`, `load_pbr()`, or `load_glb()`.

### Visual & Spatial Inspection (`POST /v1/sessions/{id}/inspect`)
```bash
curl -fsS -X POST https://sunfield.dev/v1/sessions/$SESSION_ID/inspect \
  -H "Authorization: Bearer $SUNFIELD_API_KEY" -H "Content-Type: application/json" \
  -d '{
    "views": ["camera", "top", "front", "back", "left", "right", "side", "iso_3q", "iso_3q_back"],
    "passes": ["rgb", "depth", "normals", "wireframe", "segmentation"],
    "resolution": [512, 512],
    "checks": ["bounds", "framing", "collisions", "floating"],
    "summary_only": false,
    "max_objects": 50,
    "engine": "eevee",
    "cycles_samples": 16
  }'
```
- Set `"summary_only": true` on scenes with 100+ objects to keep JSON compact (still returns `scene_bounds`, `collisions` with `penetration_depth`, and `floating_objects`).
- Set `"engine": "cycles", "cycles_samples": 16` for fast glass/__OPTICAL_SUNFIELDS_LOWER__/exposure previews.

### Named Undo Checkpoints & Branching (`checkpoints`, `fork`)
```bash
# Save & restore lightweight named checkpoints (<20ms in tmpfs)
curl -fsS -X POST https://sunfield.dev/v1/sessions/$SESSION_ID/checkpoints \
  -H "Authorization: Bearer $SUNFIELD_API_KEY" -H "Content-Type: application/json" \
  -d '{"name": "before_cloth_sim"}'
curl -fsS https://sunfield.dev/v1/sessions/$SESSION_ID/checkpoints -H "Authorization: Bearer $SUNFIELD_API_KEY"
curl -fsS -X POST https://sunfield.dev/v1/sessions/$SESSION_ID/checkpoints/before_cloth_sim/restore \
  -H "Authorization: Bearer $SUNFIELD_API_KEY"

# Fork into N independent parallel sessions (count <= 8)
curl -fsS -X POST https://sunfield.dev/v1/sessions/$SESSION_ID/fork \
  -H "Authorization: Bearer $SUNFIELD_API_KEY" -H "Content-Type: application/json" \
  -d '{"count": 2}'
```

### Cost Estimation & Async Cycles Render (`render/estimate`, `render`, `/v1/jobs/{id}`)
```bash
# 1. Estimate cost/time without committing
curl -fsS -X POST https://sunfield.dev/v1/sessions/$SESSION_ID/render/estimate \
  -H "Authorization: Bearer $SUNFIELD_API_KEY" -H "Content-Type: application/json" \
  -d '{"engine": "cycles", "samples": 256, "resolution": [1920, 1080], "frames": [1], "probe_samples": 8}'

# 2. Submit async render (recommended for any render > 30s)
curl -fsS -X POST https://sunfield.dev/v1/sessions/$SESSION_ID/render \
  -H "Authorization: Bearer $SUNFIELD_API_KEY" -H "Content-Type: application/json" \
  -d '{
    "engine": "cycles",
    "samples": 256,
    "resolution": [1920, 1080],
    "frames": [1],
    "aov_passes": ["rgb", "depth", "normals"],
    "use_denoising": true,
    "probe_samples": 8,
    "max_cost_usd": 0.50,
    "async": true
  }'
# -> {"job_id": "rnd_...", "status": "running", "poll_url": "/v1/jobs/rnd_..."}

# 3. Poll job status, live per-frame progress (`progress.completed_frames`, `eta_s`) & artifacts (or DELETE to cancel)
curl -fsS https://sunfield.dev/v1/jobs/$JOB_ID -H "Authorization: Bearer $SUNFIELD_API_KEY"
curl -fsS -X DELETE https://sunfield.dev/v1/jobs/$JOB_ID -H "Authorization: Bearer $SUNFIELD_API_KEY"

# 4. Download all rendered frames in one ZIP or assemble an H.264 MP4 directly on the control plane
curl -fsS "https://sunfield.dev/v1/jobs/$JOB_ID/archive.zip" -H "Authorization: Bearer $SUNFIELD_API_KEY" -o frames.zip
curl -fsS "https://sunfield.dev/v1/jobs/$JOB_ID/video.mp4?fps=24" -H "Authorization: Bearer $SUNFIELD_API_KEY" -o animation.mp4
```
- Multi-frame renders (`len(frames) > 1`) stream one frame at a time with live `progress` updates on `GET /v1/jobs/{id}` so partial frames are saved immediately and cancellation refunds all unrendered frames.
- Optional `?pass_name=rgb|depth|normals` filters `archive.zip`; optional `?fps=24&crf=18` configures `video.mp4` (H.264 `yuv420p` `+faststart`).

### Export Scene (`.blend` / `.glb`) & Artifacts
```bash
# Download packed .blend (native Blender multi-frame zstd-compressed file) or .glb
curl -fsS "https://sunfield.dev/v1/sessions/$SESSION_ID/export?format=blend" \
  -H "Authorization: Bearer $SUNFIELD_API_KEY" -o scene.blend
curl -fsS "https://sunfield.dev/v1/sessions/$SESSION_ID/export?format=glb" \
  -H "Authorization: Bearer $SUNFIELD_API_KEY" -o scene.glb
# Note: Blender writes .blend files as multi-frame zstd streams. Open scene.blend directly in Blender,
# or decompress all frames with `zstd -d` / a streaming decompressor if inspecting raw bytes.

# List & download artifacts (filter by session_id or job_id)
curl -fsS "https://sunfield.dev/v1/artifacts?session_id=$SESSION_ID" -H "Authorization: Bearer $SUNFIELD_API_KEY"
curl -fsS https://sunfield.dev/v1/artifacts/$ARTIFACT_ID -H "Authorization: Bearer $SUNFIELD_API_KEY" -o output.png
```

### Submit & Review Agent Feedback (`POST /v1/feedback`, `GET /v1/feedback`)
After finishing a real job or hitting any API/Blender friction, please send a short structured report so we can fix it immediately:
```bash
curl -fsS -X POST https://sunfield.dev/v1/feedback \
  -H "Authorization: Bearer $SUNFIELD_API_KEY" -H "Content-Type: application/json" \
  -d '{"category": "bug", "session_id": "$SESSION_ID", "message": "What worked, what broke, probe accuracy, missing endpoints/assets..."}'

# Review your previously submitted feedback
curl -fsS https://sunfield.dev/v1/feedback -H "Authorization: Bearer $SUNFIELD_API_KEY"
```

---

## Blender `bpy` Best Practices & Gotchas

- **Color management:** Set `scene.view_settings.view_transform = 'AgX'` and `scene.view_settings.look = 'AgX - Medium High Contrast'` (note: enumerating `view_transform` enum items in headless factory mode can look sparse, but assigning `'AgX'` directly works cleanly).
- **Glass / __OPTICAL_SUNFIELDS_LOWER__ fireflies:** Prefer `scene.cycles.sample_clamp_indirect = 10.0`, `scene.cycles.use_adaptive_sampling = True`, `scene.cycles.adaptive_threshold = 0.01`, and `use_denoising: true` (OptiX denoiser) instead of cranking samples to 4096. For heavy refractive/glass scenes, prefer async `POST /v1/sessions/{id}/render` with `"async": true` rather than synchronous `inspect(engine="cycles")`.
- **Headless primitive transforms:** In headless Blender 4.5, `bpy.ops.mesh.primitive_*` can ignore the `rotation=` keyword argument; always assign `obj.rotation_euler` (or `obj.rotation_quaternion`) directly after creating the object.
- **Blender 4.5 / 5.x `Principled BSDF` sockets:** Use `'Transmission Weight'`, `'Coat Weight'`, `'Specular IOR Level'` (guard with `if name in bsdf.inputs:`).
- **Zero outbound network in sandboxes:** Never fetch URLs from inside `exec()`.
- **HTTP status codes:** `401` invalid key · `402` insufficient credits · `404` unknown session/job/artifact · `503` no GPU workers connected.

