This document is for Unity engineers deciding how to integrate ZPL AIN / stability analysis. It describes F1 — architecture only. A thin C# client package (F2) is a separate mandate.
- AIN runs on the ZPL Engine over HTTPS. The engine holds API keys, quotas, and rate limits.
- Unity does not embed the mathematical engine, WASM rebuilds of proprietary cores, or copied
zpl-corelogic. That matches product policy (trade secret, server-side certification). - Unity is a consumer of the same public HTTP API documented in openapi.yaml.
- Secrets: Keep
ZPL_API_KEYon a game server or backend you control (same as any mobile game with a paid API). Avoid shipping long-lived keys in client builds players can extract. - Transport: Server uses
HttpClient(orUnityWebRequeston a headless worker) →POST /computewith JSON body (d,bias,samples). There is nomatrixparameter —dis the matrix dimension. - Gameplay: Clients receive derived results only (e.g.
ain,ain_status,tokens_usedas allowed by your UX). Do not log raw engine internals.
- Use
HttpClientorUnityWebRequestagainsthttps://engine.zeropointlogic.io(or your proxy). - Set browser-like
User-Agentand the ADR 0002 headers (X-ZPL-Client,X-ZPL-Client-Version) once your channel slug is registered (e.g.sdk-csharpreserved for a future package, or a custom slug for an internal tool). - Respect timeouts and retries; surface “data unavailable” if the API fails — no fabricated scores.
- OpenAPI-driven C# generation is optional; see OPENAPI_GENERATOR.md. Review generated code before shipping.
- F2 (C# SDK package) is backlog until explicitly approved — do not treat generated stubs as a supported product without that mandate.
- ADR 0001 — future
usage_logattribution on the engine (Alex / Rust). - ADR 0002 —
X-ZPL-Clientregistry shared across SDKs and channels. - games/README.md — docs comune jocuri (Godot/Unreal snippets, catalog demo, gap-uri vs acest fișier în
games/UNITY_ENGINE_GAP.md).