curl --request POST \
--url https://inference.square1.dev/v1/images/nai/generate-image \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"input": "1girl, silver hair, looking at viewer, masterpiece",
"action": "generate",
"parameters": {
"negative_prompt": "lowres, bad anatomy",
"width": 832,
"height": 1216,
"steps": 28,
"seed": 1234567890,
"scale": 5
}
}
'import requests
url = "https://inference.square1.dev/v1/images/nai/generate-image"
payload = {
"input": "1girl, silver hair, looking at viewer, masterpiece",
"action": "generate",
"parameters": {
"negative_prompt": "lowres, bad anatomy",
"width": 832,
"height": 1216,
"steps": 28,
"seed": 1234567890,
"scale": 5
}
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
input: '1girl, silver hair, looking at viewer, masterpiece',
action: 'generate',
parameters: {
negative_prompt: 'lowres, bad anatomy',
width: 832,
height: 1216,
steps: 28,
seed: 1234567890,
scale: 5
}
})
};
fetch('https://inference.square1.dev/v1/images/nai/generate-image', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://inference.square1.dev/v1/images/nai/generate-image",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'input' => '1girl, silver hair, looking at viewer, masterpiece',
'action' => 'generate',
'parameters' => [
'negative_prompt' => 'lowres, bad anatomy',
'width' => 832,
'height' => 1216,
'steps' => 28,
'seed' => 1234567890,
'scale' => 5
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://inference.square1.dev/v1/images/nai/generate-image"
payload := strings.NewReader("{\n \"input\": \"1girl, silver hair, looking at viewer, masterpiece\",\n \"action\": \"generate\",\n \"parameters\": {\n \"negative_prompt\": \"lowres, bad anatomy\",\n \"width\": 832,\n \"height\": 1216,\n \"steps\": 28,\n \"seed\": 1234567890,\n \"scale\": 5\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://inference.square1.dev/v1/images/nai/generate-image")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"input\": \"1girl, silver hair, looking at viewer, masterpiece\",\n \"action\": \"generate\",\n \"parameters\": {\n \"negative_prompt\": \"lowres, bad anatomy\",\n \"width\": 832,\n \"height\": 1216,\n \"steps\": 28,\n \"seed\": 1234567890,\n \"scale\": 5\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://inference.square1.dev/v1/images/nai/generate-image")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"input\": \"1girl, silver hair, looking at viewer, masterpiece\",\n \"action\": \"generate\",\n \"parameters\": {\n \"negative_prompt\": \"lowres, bad anatomy\",\n \"width\": 832,\n \"height\": 1216,\n \"steps\": 28,\n \"seed\": 1234567890,\n \"scale\": 5\n }\n}"
response = http.request(request)
puts response.read_body"<string>"{
"statusCode": 123,
"message": "<string>"
}{
"statusCode": 123,
"message": "<string>"
}{
"statusCode": 123,
"message": "<string>"
}{
"statusCode": 123,
"message": "<string>"
}{
"statusCode": 123,
"message": "<string>"
}{
"statusCode": 123,
"message": "<string>"
}{
"statusCode": 123,
"message": "<string>"
}Generate an illustration (NovelAI-compatible)
A synchronous, NovelAI-protocol image endpoint — point any client
that speaks NovelAI’s /ai/generate-image (e.g. RisuAI’s
Lightboard) at this path with your Square1 key as the Bearer token.
Checkpoint, LoRAs, sampler, and quality settings come from your
active illustration preset (dashboard → Images →
ILLUSTRATION), not from the request — the NAI model field is
accepted and ignored. See the Illustration API guide for the full
parameter-precedence rules.
The response is a ZIP archive containing one PNG (exactly what a
NovelAI client expects). Errors use NovelAI’s
{statusCode, message} shape, not the OpenAI envelope used by
the rest of this API. Generated images are private — they never
enter the public gallery.
Members-only: requires an active account (and a registered email when email enforcement is on). Image generation draws from the image queue capacity, not from your LLM token quota.
curl --request POST \
--url https://inference.square1.dev/v1/images/nai/generate-image \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"input": "1girl, silver hair, looking at viewer, masterpiece",
"action": "generate",
"parameters": {
"negative_prompt": "lowres, bad anatomy",
"width": 832,
"height": 1216,
"steps": 28,
"seed": 1234567890,
"scale": 5
}
}
'import requests
url = "https://inference.square1.dev/v1/images/nai/generate-image"
payload = {
"input": "1girl, silver hair, looking at viewer, masterpiece",
"action": "generate",
"parameters": {
"negative_prompt": "lowres, bad anatomy",
"width": 832,
"height": 1216,
"steps": 28,
"seed": 1234567890,
"scale": 5
}
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
input: '1girl, silver hair, looking at viewer, masterpiece',
action: 'generate',
parameters: {
negative_prompt: 'lowres, bad anatomy',
width: 832,
height: 1216,
steps: 28,
seed: 1234567890,
scale: 5
}
})
};
fetch('https://inference.square1.dev/v1/images/nai/generate-image', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://inference.square1.dev/v1/images/nai/generate-image",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'input' => '1girl, silver hair, looking at viewer, masterpiece',
'action' => 'generate',
'parameters' => [
'negative_prompt' => 'lowres, bad anatomy',
'width' => 832,
'height' => 1216,
'steps' => 28,
'seed' => 1234567890,
'scale' => 5
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://inference.square1.dev/v1/images/nai/generate-image"
payload := strings.NewReader("{\n \"input\": \"1girl, silver hair, looking at viewer, masterpiece\",\n \"action\": \"generate\",\n \"parameters\": {\n \"negative_prompt\": \"lowres, bad anatomy\",\n \"width\": 832,\n \"height\": 1216,\n \"steps\": 28,\n \"seed\": 1234567890,\n \"scale\": 5\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://inference.square1.dev/v1/images/nai/generate-image")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"input\": \"1girl, silver hair, looking at viewer, masterpiece\",\n \"action\": \"generate\",\n \"parameters\": {\n \"negative_prompt\": \"lowres, bad anatomy\",\n \"width\": 832,\n \"height\": 1216,\n \"steps\": 28,\n \"seed\": 1234567890,\n \"scale\": 5\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://inference.square1.dev/v1/images/nai/generate-image")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"input\": \"1girl, silver hair, looking at viewer, masterpiece\",\n \"action\": \"generate\",\n \"parameters\": {\n \"negative_prompt\": \"lowres, bad anatomy\",\n \"width\": 832,\n \"height\": 1216,\n \"steps\": 28,\n \"seed\": 1234567890,\n \"scale\": 5\n }\n}"
response = http.request(request)
puts response.read_body"<string>"{
"statusCode": 123,
"message": "<string>"
}{
"statusCode": 123,
"message": "<string>"
}{
"statusCode": 123,
"message": "<string>"
}{
"statusCode": 123,
"message": "<string>"
}{
"statusCode": 123,
"message": "<string>"
}{
"statusCode": 123,
"message": "<string>"
}{
"statusCode": 123,
"message": "<string>"
}Authorizations
A Square1 API key: Authorization: Bearer sq-arca-... (legacy ws-... keys remain valid). Create and rotate keys from the dashboard.
Body
The prompt, in NovelAI syntax (converted server-side).
8000Accepted for protocol compatibility and ignored — the checkpoint comes from your active illustration preset.
128If present, must be generate.
Show child attributes
Show child attributes
Response
A ZIP archive containing the generated PNG.
The response is of type file.