DEV3 Opalframe REST API
Base URL /api/v1 · Authenticate with Authorization: Bearer n3k_… · OpenAPI 3.1 JSON
/api/v1/mescope: readThe workspace this key belongs to
/api/v1/membersscope: readList members
Parameters: role (query)
/api/v1/usagescope: readUsage for the current billing period
/api/v1/eventsscope: writeRecord a metered usage event
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "object",
"properties": {
"metric": {
"type": "string",
"pattern": "^[a-z0-9._-]+$"
},
"quantity": {
"type": "integer",
"exclusiveMinimum": 0,
"maximum": 1000000
}
},
"required": [
"metric",
"quantity"
],
"additionalProperties": false
}/api/v1/creditsscope: readCredit balance and recent ledger entries
/api/v1/modelsscope: readModels you can use (simulated tiers and configured adapters)
/api/v1/stylesscope: readStyle presets
/api/v1/generationsscope: writeStart a text-to-image generation job
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "object",
"properties": {
"prompt": {
"type": "string",
"minLength": 1,
"maxLength": 2000
},
"negative": {
"type": "string",
"maxLength": 1000
},
"style": {
"type": "string",
"maxLength": 40
},
"ratio": {
"default": "1:1",
"type": "string",
"enum": [
"1:1",
"3:2",
"2:3",
"4:3",
"3:4",
"16:9",
"9:16",
"21:9"
]
},
"count": {
"default": 1,
"type": "integer",
"minimum": 1,
"maximum": 4
},
"seed": {
"type": "integer",
"minimum": 0,
"maximum": 2147483648
},
"model": {
"default": "draft",
"type": "string",
"maxLength": 40
},
"brandKitId": {
"type": "string",
"pattern": "^[0-9a-f]{24}$"
},
"boardId": {
"type": "string",
"pattern": "^[0-9a-f]{24}$"
},
"idempotencyKey": {
"type": "string",
"minLength": 8,
"maxLength": 80,
"pattern": "^[A-Za-z0-9._:-]+$"
}
},
"required": [
"prompt",
"ratio",
"count",
"model"
],
"additionalProperties": false
}/api/v1/generationsscope: readList jobs
Parameters: status (query), limit (query)
/api/v1/jobs/{id}scope: readGet a job with its images
/api/v1/jobs/{id}/cancelscope: writeCancel a queued or running job (send an empty JSON object; unrendered images are refunded)
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "object",
"properties": {},
"additionalProperties": false
}/api/v1/editsscope: writeImage-to-image, inpaint, outpaint or variations
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "object",
"properties": {
"mode": {
"type": "string",
"enum": [
"img2img",
"inpaint",
"outpaint",
"variations"
]
},
"imageId": {
"type": "string",
"pattern": "^[0-9a-f]{24}$"
},
"imageBase64": {
"type": "string",
"maxLength": 30000000
},
"maskBase64": {
"type": "string",
"maxLength": 30000000
},
"prompt": {
"default": "",
"type": "string",
"maxLength": 2000
},
"negative": {
"type": "string",
"maxLength": 1000
},
"style": {
"type": "string",
"maxLength": 40
},
"strength": {
"type": "number",
"minimum": 0.05,
"maximum": 1
},
"outpaint": {
"type": "object",
"properties": {
"ratio": {
"type": "string",
"enum": [
"1:1",
"3:2",
"2:3",
"4:3",
"3:4",
"16:9",
"9:16",
"21:9"
]
},
"width": {
"type": "integer",
"minimum": 64,
"maximum": 4096
},
"height": {
"type": "integer",
"minimum": 64,
"maximum": 4096
},
"anchor": {
"type": "string",
"enum": [
"center",
"top",
"bottom",
"left",
"right"
]
}
},
"additionalProperties": false
},
"count": {
"default": 1,
"type": "integer",
"minimum": 1,
"maximum": 4
},
"seed": {
"type": "integer",
"minimum": 0,
"maximum": 2147483648
},
"model": {
"default": "draft",
"type": "string",
"maxLength": 40
},
"brandKitId": {
"type": "string",
"pattern": "^[0-9a-f]{24}$"
},
"idempotencyKey": {
"type": "string",
"minLength": 8,
"maxLength": 80,
"pattern": "^[A-Za-z0-9._:-]+$"
}
},
"required": [
"mode",
"prompt",
"count",
"model"
],
"additionalProperties": false
}/api/v1/tools/remove-backgroundscope: writeRemove the background (transparent PNG)
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "object",
"properties": {
"imageId": {
"type": "string",
"pattern": "^[0-9a-f]{24}$"
},
"imageBase64": {
"type": "string",
"maxLength": 30000000
},
"model": {
"default": "draft",
"type": "string",
"maxLength": 40
},
"idempotencyKey": {
"type": "string",
"minLength": 8,
"maxLength": 80,
"pattern": "^[A-Za-z0-9._:-]+$"
}
},
"required": [
"model"
],
"additionalProperties": false
}/api/v1/tools/upscalescope: writeUpscale 2x or 4x
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "object",
"properties": {
"imageId": {
"type": "string",
"pattern": "^[0-9a-f]{24}$"
},
"imageBase64": {
"type": "string",
"maxLength": 30000000
},
"factor": {
"default": 2,
"anyOf": [
{
"type": "number",
"const": 2
},
{
"type": "number",
"const": 4
}
]
},
"model": {
"default": "draft",
"type": "string",
"maxLength": 40
},
"idempotencyKey": {
"type": "string",
"minLength": 8,
"maxLength": 80,
"pattern": "^[A-Za-z0-9._:-]+$"
}
},
"required": [
"factor",
"model"
],
"additionalProperties": false
}/api/v1/imagesscope: readList library images
Parameters: q (query), style (query), model (query), tag (query), boardId (query), favourite (query), trash (query), limit (query), skip (query)
/api/v1/images/{id}scope: readGet an image with signed URLs and its edit chain
/api/v1/images/{id}scope: writeFavourite, tag or restore an image
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "object",
"properties": {
"favourite": {
"type": "boolean"
},
"tags": {
"maxItems": 20,
"type": "array",
"items": {
"type": "string",
"maxLength": 32
}
},
"restore": {
"type": "boolean"
}
},
"additionalProperties": false
}/api/v1/images/{id}scope: writeMove an image to the trash (30 days)
/api/v1/boardsscope: readList boards
/api/v1/boardsscope: writeCreate a board
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "object",
"properties": {
"name": {
"type": "string",
"minLength": 1,
"maxLength": 120
}
},
"required": [
"name"
],
"additionalProperties": false
}/api/v1/boards/{id}/imagesscope: writeAdd images to a board
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "object",
"properties": {
"imageIds": {
"minItems": 1,
"maxItems": 200,
"type": "array",
"items": {
"type": "string",
"pattern": "^[0-9a-f]{24}$"
}
}
},
"required": [
"imageIds"
],
"additionalProperties": false
}/api/v1/batchesscope: writeCreate a batch from CSV text (prompt,style,ratio,seed)
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "object",
"properties": {
"csv": {
"type": "string",
"minLength": 1,
"maxLength": 200000
},
"name": {
"type": "string",
"maxLength": 120
},
"model": {
"default": "draft",
"type": "string",
"maxLength": 40
},
"style": {
"type": "string",
"maxLength": 40
},
"ratio": {
"type": "string",
"enum": [
"1:1",
"3:2",
"2:3",
"4:3",
"3:4",
"16:9",
"9:16",
"21:9"
]
},
"brandKitId": {
"type": "string",
"pattern": "^[0-9a-f]{24}$"
},
"idempotencyKey": {
"type": "string",
"minLength": 8,
"maxLength": 80,
"pattern": "^[A-Za-z0-9._:-]+$"
}
},
"required": [
"csv",
"model"
],
"additionalProperties": false
}/api/v1/batches/{id}scope: readBatch progress