Skip to content
会nokai.studio

Architecture

nokai.studio sits between your application and the AI generation service. Your code calls a REST API; the platform manages queuing, retry logic, credit accounting, and output storage.

Request flow

Your app
  |
  |  POST /api/v1/jobs/createTask
  v
API server  (returns taskId immediately)
  |
  v
Job queue
  |
  v
Generation service  (runs the model)
  |
  v
Output storage  -->  resultJson URL
  |
  v
Webhook delivery  -->  Your webhook URL

The pieces

  • Your app -- holds the API key, makes HTTP requests, and (optionally) exposes a webhook URL.
  • API server -- the REST layer. Authenticates requests, validates inputs, reserves credits, enqueues jobs. Returns immediately with a taskId.
  • Job queue -- durable job store. Persists job state, tracks retries, routes to the next available worker.
  • Generation service -- runs the AI model. Reports progress, stores output, updates job state.
  • Output storage -- where generated files land. URLs in resultJson point here.
  • Webhook delivery -- POSTs signed events to your registered endpoints with retries.

Account model

customer
  +-- api key (one or more)
  +-- job (one per createTask call)
  |     +-- webhook delivery (one per registered endpoint)
  +-- webhook endpoint (one or more HTTPS URLs)

A customer is your account -- the billing and isolation boundary. All jobs, keys, and webhooks belong to a customer.

Trust boundaries

BoundaryWhat is enforced
API key -> customerKeys are stored hashed; the plaintext is shown exactly once at creation.
Outbound webhook URLsPublic DNS only -- loopback, private network, and cloud-metadata IPs are rejected.
Webhook signing secretsHMAC-SHA256 per-endpoint secrets.
Cross-customer accessEvery query is scoped to the authenticated customer.

What is deliberately not here

  • No SDK required -- the API is plain HTTP + JSON. curl is a first-class client.
  • No multi-region for v1. Single primary store keeps consistency simple.
  • No streaming output -- jobs complete fully before results are available.