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
resultJsonpoint 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
| Boundary | What is enforced |
|---|---|
| API key -> customer | Keys are stored hashed; the plaintext is shown exactly once at creation. |
| Outbound webhook URLs | Public DNS only -- loopback, private network, and cloud-metadata IPs are rejected. |
| Webhook signing secrets | HMAC-SHA256 per-endpoint secrets. |
| Cross-customer access | Every query is scoped to the authenticated customer. |
What is deliberately not here
- No SDK required -- the API is plain HTTP + JSON.
curlis 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.