OpenAPI 3.1 Specification
Full OpenAPI 3.1.0 schema for the PixelKit SDK hardware & AI surface, automatically synchronized from
data/hooks.
PixelKit exports an OpenAPI 3.1.0 specification defining every sensor, radio, compute, and AI capability across all 51 typed React hooks and hardware actuators. It provides a standard REST/RPC interface for developer tooling, the <PixelKitDevTools /> HUD, local Metro bridges, and AI tool-calling agents.
Interactive Viewers
Section titled “Interactive Viewers”Explore, search, and test all 250 hardware endpoints and 505 schemas directly in your browser alongside the documentation:
| Viewer | Description | Direct Link |
|---|---|---|
| 🚀 Scalar API Reference | Modern OpenAPI 3.1 explorer featuring fast search, code generation across 10+ languages (TypeScript, cURL, Python, Go), and schema tree inspection. | Open Scalar Explorer → |
| 🛠️ Swagger UI Sandbox | Classic Swagger UI interactive console with collapsible categories, parameter inspectors, and JSON/YAML raw payload views. | Open Swagger UI → |
Downloads
Section titled “Downloads”| Format | Link | Description |
|---|---|---|
| JSON | openapi.json |
Complete OpenAPI 3.1.0 specification in JSON format. |
| YAML | openapi.yaml |
Complete OpenAPI 3.1.0 specification in YAML format. |
Embedded API Explorer
Section titled “Embedded API Explorer”(Prefer full screen? Launch the Fullscreen Scalar Explorer or Swagger UI Sandbox)
Automated Parity & Zero Drift
Section titled “Automated Parity & Zero Drift”The OpenAPI specification automatically stays up to date:
- SDK Build Pipeline: In
PixelKit-Labs/pixelkit-sdk,npm run buildrunsexport:openapion every compilation. - Version Synchronization: Bumping the SDK version via
node scripts/sync-versions.js <version>automatically regenerates the specification with the updated version number. - CI Verification Gate:
npm run verifyrunsscripts/check-openapi.js, which verifies that the OpenAPI specification strictly matches the hook contracts indata/hooks/*.jsonwith zero drift. - Docs Pipeline: Every docs build (
npm run buildinpixelkit-docs) executesscripts/build-openapi.mjsto refresh the hostedopenapi.jsonandopenapi.yamlfiles.
Core API Structure
Section titled “Core API Structure”1. Zero-Simulation Principle
Section titled “1. Zero-Simulation Principle”Every telemetry schema references TelemetrySource:
{ "type": "string", "enum": ["hardware", "derived", "unavailable"]}Fabricated readings cannot be represented in the schema. Unreadable sensor readings return null.
2. Endpoints
Section titled “2. Endpoints”GET /api/state: Returns an instantaneous atomic snapshot of all 51 hardware telemetry states simultaneously.GET /api/hooks: Returns the catalog of all 51 hooks, category metadata, and hardware badges.GET /api/hooks/{hookName}: Queries the telemetry state of an individual hook (e.g.,GET /api/hooks/useThermometer,GET /api/hooks/useCPU,GET /api/hooks/useWifi7MLO).POST /api/hooks/{hookName}/actions/{actionName}: Invokes physical hardware actuators and AI routines:POST /api/hooks/useTorch/actions/setTorch: Sets rear LED flashlight level or toggles strobe.POST /api/hooks/useHaptics/actions/playEnvelope: Drives custom Android 16 LRA vibration waveforms.POST /api/hooks/useBatteryShare/actions/setBatteryShare: Toggles reverse wireless Qi charging.POST /api/hooks/useMicrophoneArray/actions/setDirection: Steers acoustic beamforming.POST /api/hooks/useWifiRTT/actions/startRanging: Triggers 802.11mc/az indoor positioning.POST /api/hooks/useKeyAgreement/actions/deriveSharedSecret: Derives hardware-isolated ECDH secrets on Titan M2.
Usage with AI Agents & Tool Calling
Section titled “Usage with AI Agents & Tool Calling”Because OpenAPI 3.1.0 is based on JSON Schema 2020-12, this specification can be loaded directly into Gemini, Claude, or OpenAI as a tool/function catalog:
# Fetch the spec directlycurl -s https://pixelkit-labs.github.io/pixelkit-docs/openapi.json