DEV3 Opalframe
Sign inGet started

DEV3 Opalframe REST API

Base URL /api/v1 · Authenticate with Authorization: Bearer n3k_… · OpenAPI 3.1 JSON

get/api/v1/mescope: read

The workspace this key belongs to

get/api/v1/membersscope: read

List members

Parameters: role (query)

get/api/v1/usagescope: read

Usage for the current billing period

post/api/v1/eventsscope: write

Record 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
}
get/api/v1/creditsscope: read

Credit balance and recent ledger entries

get/api/v1/modelsscope: read

Models you can use (simulated tiers and configured adapters)

get/api/v1/stylesscope: read

Style presets

post/api/v1/generationsscope: write

Start 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
}
get/api/v1/generationsscope: read

List jobs

Parameters: status (query), limit (query)

get/api/v1/jobs/{id}scope: read

Get a job with its images

post/api/v1/jobs/{id}/cancelscope: write

Cancel 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
}
post/api/v1/editsscope: write

Image-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
}
post/api/v1/tools/remove-backgroundscope: write

Remove 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
}
post/api/v1/tools/upscalescope: write

Upscale 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
}
get/api/v1/imagesscope: read

List library images

Parameters: q (query), style (query), model (query), tag (query), boardId (query), favourite (query), trash (query), limit (query), skip (query)

get/api/v1/images/{id}scope: read

Get an image with signed URLs and its edit chain

patch/api/v1/images/{id}scope: write

Favourite, 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
}
delete/api/v1/images/{id}scope: write

Move an image to the trash (30 days)

get/api/v1/boardsscope: read

List boards

post/api/v1/boardsscope: write

Create 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
}
post/api/v1/boards/{id}/imagesscope: write

Add 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
}
post/api/v1/share-linksscope: write

Create a share link for an image or a board

{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "kind": {
      "type": "string",
      "enum": [
        "image",
        "board"
      ]
    },
    "targetId": {
      "type": "string",
      "pattern": "^[0-9a-f]{24}$"
    },
    "ttlDays": {
      "type": "integer",
      "minimum": 1,
      "maximum": 365
    },
    "allowDownload": {
      "type": "boolean"
    }
  },
  "required": [
    "kind",
    "targetId"
  ],
  "additionalProperties": false
}
delete/api/v1/share-links/{id}scope: write

Revoke a share link

post/api/v1/batchesscope: write

Create 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
}
get/api/v1/batches/{id}scope: read

Batch progress