Nano Studio Pro Editing API

AI edits of existing generations: one-click product placement, item recolor/remove/add, two-image merge, art-style transfer, and plain-text edits. Every edit saves as a NEW generation (the source is never modified) and costs credits like a fresh generation (`generate_*` by output resolution).

GitHub OpenAPI

Operations 3

POST /v1/restyle AI-edit an existing generation #
POST /v1/expand Outpaint a generation to a bigger canvas #
POST /v1/upscale Re-render a generation at a higher resolution #

Work with this as data

Every API here is available over the APIs.io API and to AI agents over MCP.

MCP server

One button, every client — Claude, Cursor, VS Code and the rest.

https://apis.io/mcp

Tools for apis

7 MCP tools reach this
  • find_apisBrowse and filter every API in the catalog.
  • get_api_artifactsOne API's artifacts, grouped by type.
  • get_openapiThe primary OpenAPI for this API.
  • find_similar_apisAPIs that look like this one.
  • apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.
  • resolveTurn a domain, URL or GitHub org into the provider it belongs to.
  • find_cohortsEvery scored population of providers in the catalog.
All 92 tools →

Call it yourself

curl for this page
This API
curl "https://apis.io/api/v1/apis/nanostudiopro-com:nanostudiopro-com-editing-api"
All apis
curl "https://apis.io/api/v1/apis?limit=25"

Calls without X-API-Key need no key. Calls with it need a paid plan — get a key.

Get an API key

Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. By signing up you are subscribing to the APIs.io and API Evangelist newsletters — you can unsubscribe from any issue. See our Privacy Policy and Terms.

A second provider on the same verified email joins the account you already have.

OpenAPI Specification

nanostudiopro-com-editing-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  title: Nano Studio Pro Editing API
  version: 1.0.0
  description: 'Programmatic access to **Nano Studio Pro** — generate AI fashion and product photography, manage projects and assets, and track storage from any client (scripts, CLIs, AI agents).


    ### How it works


    You group your work into **Projects**. Each generation belongs to a project. Reusable inputs (model photos, pose references, uploads) live in **Assets** and can be passed by ID into any generation. Generations cost credits by resolution (see `POST /v1/generations`); asset uploads count against your **storage quota**.


    ### Authentication


    All requests require a Bearer token. Create one at Settings · API keys. The token is shown once at creation — store it safely. If lost, revoke and create a new one.


    ```bash

    curl -H "Authorization: Bearer sk_sf_live_..." https://nanostudiopro.com/api/v1/me

    ```


    Two kinds of key share this header:


    - **Secret keys** (`sk_sf_live_...`) — full API access, governed by the token''s scopes. Never ship one in client-side code.

    - **Publishable keys** (`pk_sf_live_...`) — safe to embed in public HTML. They are created with the `read` scope only and work **exclusively on `GET /v1/search`**: authentication itself rejects them with `401 unauthorized` on every other endpoint. Each publishable key optionally carries a **`search_scope`** object (see the schema of that name) that narrows what it can see:

    - `projects` — the key sees only these project ids; absent = the whole library.

    - `types` — result types the key may return (`asset` / `generation`).

    - `max_image_size` — caps the `image_size` variant served; requests above the cap (the `preview` default included) are silently served the cap.

    - `origins` — exact-match browser `Origin` allowlist; a request from any other origin gets `403 forbidden`. Absent = any origin. Requests with no Origin header (curl, server-to-server) always pass — the origin lock is a soft, browser-only control; the hard controls are the read-only scope and the narrowing above.

    - `include_regions` — whether the key may request detection regions. Default false.

    - `include_narrative` — whether results carry the AI-written photo description (`narrative`). Default false: publishable-key results omit it unless the scope opts in.


    Scope narrowing is **silent by design**: a filter that falls entirely outside the key''s scope returns an empty 200 page, never an error, so a client can''t probe what exists outside its window.


    ### Rate limits


    Per-token rate limits are enforced; when exceeded you''ll get `429` with a `Retry-After` header. Secret keys get **60 requests/min per token**. Publishable keys (search-only) get **600/min per key** plus **60/min per key + client IP** — whichever is stricter wins, so one hot visitor can''t exhaust a whole site''s key. Search rate limits are durable — shared across server instances, so counts don''t reset on deploys or split between replicas.


    ### Errors


    All error responses use the same shape: `{ "error": { "code": "...", "message": "..." } }`. Common codes include `unauthorized`, `validation_error`, `not_found`, `insufficient_credits`, `token_cap_exceeded`, `storage_limit_exceeded`, `rate_limited`.


    ## Authorizing a device


    Two ways to get a token:


    1. **Manual** — create one in Settings · API Tokens. Returns a `sk_sf_live_...` token immediately.

    2. **Device flow (RFC 8628)** — for CLIs and headless tools. Run `curl -fsSL https://nanostudiopro.com/cli/nsp -o /usr/local/bin/nsp && chmod +x /usr/local/bin/nsp && nsp login`, or implement the protocol yourself (full walkthrough at /docs/device-auth; endpoints are listed under the **Device Auth** tag below).


    Each token can optionally have a **daily credit cap** — a rolling-24h spending limit independent of the wallet balance. Useful for limiting blast radius if a token leaks. Configure under Settings → API Tokens.'
  contact:
    url: https://nanostudiopro.com/settings?tab=api-tokens
servers:
- url: /api
  description: Same origin as docs (auto-detects local vs prod)
- url: https://nanostudiopro.com/api
  description: Production
security:
- BearerAuth: []
tags:
- name: Editing
  description: 'AI edits of existing generations: one-click product placement, item recolor/remove/add, two-image merge, art-style transfer, and plain-text edits. Every edit saves as a NEW generation (the source is never modified) and costs credits like a fresh generation (`generate_*` by output resolution).'
paths:
  /v1/restyle:
    post:
      tags:
      - Editing
      summary: AI-edit an existing generation
      description: 'Edits an existing generation and saves the result as a **new** generation (the source is never modified). One synchronous model call; costs credits like a fresh generation (`generate_*` by output resolution).


        ### Modes


        | Mode | How |

        |---|---|

        | Plain-text edit | `instructions` only — "make the sky stormy" |

        | Product placement | `action: "bring"` + `reference_id` — the reference''s product is placed into the scene at true real-world scale, relit to match, worn/held/placed naturally |

        | Swap/add specific items | `action: "bring"` + `reference_id` + `items` (names from `GET /v1/detections`) |

        | Recolor items | `action: "recolor"` + `reference_id` + optional `items` |

        | Remove items | `action: "remove"` + `items` (no reference needed). `{ "name": "person" }` removes every person; `{ "id": 2 }` (a detection id from `GET /v1/detections` on the base) removes only that one, located by its box |

        | Add subjects to scene | `action: "add"` + `reference_id` + optional `blend_level` 0-100 |

        | Merge two images | `action: "merge"` + `reference_id` + `merge_bias` (0 = reference dominates, 100 = base dominates) + `merge_scope` scene\|items |

        | Art-style transfer | `action: "style"` + `reference_id` + `style_intensity` 0-100 |


        `reference_id` accepts an **asset or generation** you own.


        The base photo is `generation_id` **or** `asset_id` (an image uploaded with `POST /v1/assets`), never both. An asset base is only read: the result is a new generation with `parent_id: null` that records the asset as its source, and the upload is never changed or copied.'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
              - project_id
              properties:
                generation_id:
                  type: string
                  description: 'The base photo to edit: a generation. Pass this or `asset_id`.'
                asset_id:
                  type: string
                  description: 'The base photo to edit: an uploaded asset (upload, product, background or reference). Mutually exclusive with `generation_id`.'
                project_id:
                  type: string
                  description: Project for the resulting generation.
                action:
                  type: string
                  enum:
                  - bring
                  - recolor
                  - remove
                  - add
                  - merge
                  - style
                  default: bring
                reference_id:
                  type: string
                  description: Asset or generation providing the product/colors/style/content.
                entity_ids:
                  type: array
                  items:
                    type: string
                  maxItems: 12
                  description: Saved characters, props or places (ids from `GET /v1/entities`) whose baked reference sheet to attach. Writing `@slug` in the prompt does the same — a look is `@parent/look` or its own slug — and the prompt is rewritten so the model knows which picture is whom. Sheets go after your own references, within the model's reference limit; the response's `entities` says which went in and which were dropped. Unknown `@words` are left as typed. To leave something out, write `-@slug` (that prop comes off every items sheet the request sends, and the words are removed from the prompt) or pass `-<id>` here; `@slug/alone` or `<id>/alone` sends the entity without its items sheet. The response's `entities.excluded` lists what was left out.
                items:
                  type: array
                  description: Each item needs a `name` or an `id`.
                  items:
                    type: object
                    properties:
                      id:
                        type: integer
                        description: 'remove only: a detection id of the BASE photo (GET /v1/detections). Removes just that instance, located by its box; other items with the same name stay.'
                      name:
                        type: string
                        description: Item name (see GET /v1/detections). Acts on every instance with that name.
                      description:
                        type: string
                      color:
                        type: string
                      style_mode:
                        type: string
                        enum:
                        - keep
                        - adapt
                        description: keep = reference's look; adapt = re-render in the base's own style.
                scan_id:
                  type: string
                  description: 'With item `id`s: the `scan_id` they were read from (GET /v1/detections). Default: the base''s newest scan.'
                instructions:
                  type: string
                  description: Free-text edit instructions.
                blend_level:
                  type: number
                  minimum: 0
                  maximum: 100
                  description: 'add: integration depth. Default 50.'
                merge_bias:
                  type: number
                  minimum: 0
                  maximum: 100
                  description: 'merge: 0 reference dominates, 100 base dominates. Default 50.'
                merge_scope:
                  type: string
                  enum:
                  - scene
                  - items
                  description: merge only. Default scene.
                style_intensity:
                  type: number
                  minimum: 0
                  maximum: 100
                  description: 'style: 0 subtle tint, 100 full reimagine. Default 75.'
                aspect_ratio:
                  type: string
                  enum:
                  - '1:1'
                  - '4:5'
                  - '3:4'
                  - '9:16'
                  - '16:9'
                  - '3:2'
                  - '2:3'
                  description: 'Default: the source''s.'
                resolution:
                  type: string
                  enum:
                  - 1K
                  - 2K
                  - 4K
                  description: 'Default: the source''s. Drives credit cost.'
            examples:
              product-placement:
                summary: One-click product placement
                value:
                  generation_id: cmgen_base
                  project_id: cmprj_1
                  action: bring
                  reference_id: cmast_product
              text-edit:
                summary: Plain-text edit
                value:
                  generation_id: cmgen_base
                  project_id: cmprj_1
                  instructions: make it golden hour, warm rim light
              asset-base:
                summary: Edit an uploaded photo
                value:
                  asset_id: cmast_upload
                  project_id: cmprj_1
                  instructions: make it golden hour, warm rim light
              remove-items:
                summary: Remove detected items
                value:
                  generation_id: cmgen_base
                  project_id: cmprj_1
                  action: remove
                  items:
                  - name: sunglasses
              remove-one-instance:
                summary: Remove one of two people, by detection id
                value:
                  generation_id: cmgen_base
                  project_id: cmprj_1
                  action: remove
                  scan_id: cmscan123
                  items:
                  - id: 2
      responses:
        '200':
          description: Edit complete; the new generation with a signed image URL.
          content:
            application/json:
              example:
                id: cmgen_new
                project_id: cmprj_1
                parent_id: cmgen_base
                action: bring
                aspect_ratio: '4:5'
                resolution: 1K
                created_at: '2026-07-20T12:00:00.000Z'
                image_url: https://nanostudiopro.com/api/file?path=...&sig=...
                task_id: task_xyz
                credits_remaining: 412
        '400':
          description: Missing/invalid fields, or nothing to do
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                error:
                  code: validation_error
                  message: Missing/invalid fields, or nothing to do
        '401':
          description: Missing or invalid token
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                error:
                  code: unauthorized
                  message: Missing or invalid token
        '402':
          description: Insufficient credits or token cap exceeded
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '404':
          description: Generation, asset, project, reference, or scan not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                error:
                  code: not_found
                  message: Generation, asset, project, reference, or scan not found
        '429':
          description: Rate limit exceeded
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                error:
                  code: rate_limited
                  message: Rate limit exceeded
        '503':
          description: Pricing not configured
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                error:
                  code: feature_unavailable
                  message: Pricing not configured
      operationId: postV1Restyle
      x-operation-id-source: derived
  /v1/expand:
    post:
      tags:
      - Editing
      summary: Outpaint a generation to a bigger canvas
      description: 'Extends an existing generation''s scene beyond its original edges to reach a new aspect ratio — the model re-renders the whole scene bigger and blends the seam itself. Saves as a **new** generation in the source''s own project. Costs credits at the output resolution (`generate_*`).


        - `extend` restricts which sides grow (default: all four).

        - `zoom` below 1 zooms out symmetrically (the subject shrinks, more scene appears).

        - The base is `generation_id` **or** `asset_id` (an uploaded image), never both. An asset is only read: the result is a new generation in `project_id` (default: the asset''s own project; required when the asset has none).'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
              - target_aspect_ratio
              properties:
                generation_id:
                  type: string
                  description: 'The base: a generation. Pass this or `asset_id`.'
                asset_id:
                  type: string
                  description: 'The base: an uploaded asset. Mutually exclusive with `generation_id`.'
                project_id:
                  type: string
                  description: '`asset_id` only: project for the result. Default: the asset''s own project. Ignored for a generation, whose result joins its own project.'
                target_aspect_ratio:
                  type: string
                  enum:
                  - '1:1'
                  - '4:5'
                  - '3:4'
                  - '9:16'
                  - '16:9'
                  - '3:2'
                  - '2:3'
                resolution:
                  type: string
                  enum:
                  - 1K
                  - 2K
                  - 4K
                  description: 'Default: the source''s.'
                extend:
                  type: object
                  properties:
                    left:
                      type: boolean
                      default: true
                    right:
                      type: boolean
                      default: true
                    top:
                      type: boolean
                      default: true
                    bottom:
                      type: boolean
                      default: true
                zoom:
                  type: number
                  exclusiveMinimum: 0
                  maximum: 1
            examples:
              landscape-banner:
                summary: Turn a 4:5 shot into a 16:9 banner
                value:
                  generation_id: cmgen_base
                  target_aspect_ratio: '16:9'
      responses:
        '200':
          description: Expanded generation with a signed image URL.
          content:
            application/json:
              example:
                id: cmgen_new
                op: expand
                project_id: cmprj_1
                parent_id: cmgen_base
                aspect_ratio: '16:9'
                resolution: 1K
                width: 1600
                height: 900
                created_at: '2026-07-20T12:00:00.000Z'
                image_url: https://nanostudiopro.com/api/file?path=...&sig=...
                task_id: task_xyz
                credits_remaining: 412
        '400':
          description: Missing base or target_aspect_ratio, or invalid fields
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                error:
                  code: validation_error
                  message: Missing base or target_aspect_ratio, or invalid fields
        '401':
          description: Missing or invalid token
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                error:
                  code: unauthorized
                  message: Missing or invalid token
        '402':
          description: Not enough credits (or token cap exceeded)
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                error:
                  code: insufficient_credits
                  message: Not enough credits (or token cap exceeded)
        '404':
          description: Generation, asset or project not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                error:
                  code: not_found
                  message: Generation, asset or project not found
        '429':
          description: Rate limit exceeded
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                error:
                  code: rate_limited
                  message: Rate limit exceeded
        '503':
          description: Pricing not configured
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                error:
                  code: feature_unavailable
                  message: Pricing not configured
      operationId: postV1Expand
      x-operation-id-source: derived
  /v1/upscale:
    post:
      tags:
      - Editing
      summary: Re-render a generation at a higher resolution
      description: 'Re-renders an existing generation at the target resolution for sharper detail. Saves as a **new** generation in the source''s own project. Costs credits at the **target** resolution (`generate_*`). The base is `generation_id` **or** `asset_id` (an uploaded image), never both; an asset is only read and its result lands in `project_id` (default: the asset''s own project).'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
              - resolution
              properties:
                generation_id:
                  type: string
                  description: 'The base: a generation. Pass this or `asset_id`.'
                asset_id:
                  type: string
                  description: 'The base: an uploaded asset. Mutually exclusive with `generation_id`.'
                project_id:
                  type: string
                  description: '`asset_id` only: project for the result. Default: the asset''s own project.'
                resolution:
                  type: string
                  enum:
                  - 1K
                  - 2K
                  - 4K
                  description: Target resolution; drives cost.
      responses:
        '200':
          description: Upscaled generation with a signed image URL.
          content:
            application/json:
              example:
                id: cmgen_new
                op: upscale
                project_id: cmprj_1
                parent_id: cmgen_base
                aspect_ratio: '4:5'
                resolution: 4K
                width: 3584
                height: 4480
                created_at: '2026-07-20T12:00:00.000Z'
                image_url: https://nanostudiopro.com/api/file?path=...&sig=...
                task_id: task_xyz
                credits_remaining: 396
        '400':
          description: Missing base or resolution
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                error:
                  code: validation_error
                  message: Missing base or resolution
        '401':
          description: Missing or invalid token
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                error:
                  code: unauthorized
                  message: Missing or invalid token
        '402':
          description: Not enough credits (or token cap exceeded)
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                error:
                  code: insufficient_credits
                  message: Not enough credits (or token cap exceeded)
        '404':
          description: Generation, asset or project not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                error:
                  code: not_found
                  message: Generation, asset or project not found
        '429':
          description: Rate limit exceeded
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                error:
                  code: rate_limited
                  message: Rate limit exceeded
        '503':
          description: Pricing not configured
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                error:
                  code: feature_unavailable
                  message: Pricing not configured
      operationId: postV1Upscale
      x-operation-id-source: derived
components:
  schemas:
    Error:
      type: object
      required:
      - error
      properties:
        error:
          type: object
          required:
          - code
          - message
          properties:
            code:
              type: string
              example: validation_error
            message:
              type: string
              example: '`prompt` is required'
            needed:
              type: integer
              nullable: true
              description: '402 only: what the operation costs in credits, when known.'
            balance:
              type: integer
              nullable: true
              description: '402 only: what the account has (for `token_cap_exceeded`, what the token may still spend today), when known.'
            purchase_url:
              type: string
              format: uri
              description: '402 only: where the person adds credits. Every 402 (`insufficient_credits`, `token_cap_exceeded`, `video_requires_purchase`, `audio_requires_purchase`, `storage_limit_exceeded`, `trial_required`) carries the same fields, so one handler can show the notice. `trial_required` answers an upload from an account that has not started its free trial: nothing was stored, and the upload goes through once the trial is on.'
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      description: 'Personal access token from `/settings?tab=api-tokens`. Send as `Authorization: Bearer sk_sf_live_...` — or a publishable `pk_sf_live_...` key, which authenticates on `GET /v1/search` only.'