Nano Studio Pro Cutouts API

Production-grade transparent cutouts, grayscale mattes, and subject-removed background plates from any image. Each call processes one image synchronously and costs credits (operation key `alpha_extract_*`; see `/v1/pricing`). Pass a file upload, an existing generation ID, or an existing asset ID as the source.

GitHub OpenAPI

Operations 2

POST /v1/cutouts Create a subject cutout (inline) #
GET /v1/cutouts/{generation_id} Get a cutout's status and signed URLs #

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-cutouts-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-cutouts-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  title: Nano Studio Pro Cutouts 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: Cutouts
  description: Production-grade transparent cutouts, grayscale mattes, and subject-removed background plates from any image. Each call processes one image synchronously and costs credits (operation key `alpha_extract_*`; see `/v1/pricing`). Pass a file upload, an existing generation ID, or an existing asset ID as the source.
paths:
  /v1/cutouts:
    post:
      tags:
      - Cutouts
      summary: Create a subject cutout (inline)
      description: 'Generates a production-grade transparent cutout of an image''s subject, plus a grayscale matte and a subject-removed background plate. Processes **one image per call**, synchronously.


        ### Source — exactly one required


        | Field | Type | Description |

        |---|---|---|

        | `file` | binary (multipart only) | Raw image upload |

        | `generation_id` | string (JSON only) | Use an existing generation |

        | `asset_id` | string (JSON only) | Use an existing asset |


        Pass the source as **multipart/form-data** (with a `file` field) or as **JSON** (with `generation_id` **or** `asset_id`). Supplying zero sources or more than one returns `400 validation_error`.


        ### Outputs


        - **`cutout_url`** — transparent-background WebP of the subject. Omitted if compositing produced no foreground.

        - **`matte_url`** — grayscale alpha matte PNG (white = subject, black = background).

        - **`bg_plate_url`** — subject-removed background plate PNG.


        All URLs are signed and expire in ~1 hour. Re-fetch `GET /v1/cutouts/{generation_id}` for fresh URLs.


        ### Cost


        Charged per call (operation key `alpha_extract_*`). See `GET /v1/pricing` for the current credit amount.'
      requestBody:
        required: true
        content:
          multipart/form-data:
            schema:
              type: object
              required:
              - file
              - project_id
              properties:
                file:
                  type: string
                  format: binary
                  description: Image to extract the subject from.
                project_id:
                  type: string
                  description: Project to associate the resulting generation with.
          application/json:
            schema:
              type: object
              required:
              - project_id
              properties:
                project_id:
                  type: string
                  description: Project to associate the resulting generation with.
                generation_id:
                  type: string
                  description: ID of an existing generation to use as the source. Mutually exclusive with `asset_id`.
                asset_id:
                  type: string
                  description: ID of an existing asset to use as the source. Mutually exclusive with `generation_id`.
            examples:
              from-generation:
                summary: Extract cutout from an existing generation
                value:
                  project_id: cmod4q3op00011dod8a0omywd
                  generation_id: cmod7xy9z00031do84a1bcde2
              from-asset:
                summary: Extract cutout from an existing asset
                value:
                  project_id: cmod4q3op00011dod8a0omywd
                  asset_id: cmod7xy9z00031do84a1bcde3
      responses:
        '200':
          description: Cutout created and ready.
          content:
            application/json:
              schema:
                allOf:
                - $ref: '#/components/schemas/Cutout'
                - type: object
                  properties:
                    task_id:
                      type: string
                      description: ID of the Task row tracking this operation. The task is already `complete` when this response is returned.
              example:
                generation_id: cmod7xy9z00031do84a1bcde2
                status: ready
                cutout_url: https://nanostudiopro.com/storage/cutouts/gen_abc.webp?sig=...
                matte_url: https://nanostudiopro.com/storage/cutouts/gen_abc_matte.png?sig=...
                bg_plate_url: https://nanostudiopro.com/storage/cutouts/gen_abc_bg.png?sig=...
                task_id: task_xyz
        '400':
          description: Zero or multiple sources provided, or missing project_id
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                error:
                  code: validation_error
                  message: Zero or multiple sources provided, or missing project_id
        '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'
              examples:
                insufficient_credits:
                  value:
                    error:
                      code: insufficient_credits
                      message: Not enough credits
                token_cap_exceeded:
                  value:
                    error:
                      code: token_cap_exceeded
                      message: Token daily credit cap reached
        '404':
          description: generation_id or asset_id not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                error:
                  code: not_found
                  message: generation_id or asset_id 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: Cutout feature is not available at this time
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                error:
                  code: feature_unavailable
                  message: Cutout feature is not available at this time
      operationId: postV1Cutouts
      x-operation-id-source: derived
  /v1/cutouts/{generation_id}:
    parameters:
    - name: generation_id
      in: path
      required: true
      description: Generation ID whose cutout you want to inspect.
      example: cmod7xy9z00031do84a1bcde2
      schema:
        type: string
    get:
      tags:
      - Cutouts
      summary: Get a cutout's status and signed URLs
      description: Returns the current cutout state for a generation and fresh signed URLs for all output files. URLs are time-limited (~1 hour) — re-fetch this endpoint when they expire rather than caching them long-term. If the cutout is still processing, `status` will be `pending` and the URL fields will be absent.
      responses:
        '200':
          description: Cutout state and signed URLs.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Cutout'
              example:
                generation_id: cmod7xy9z00031do84a1bcde2
                status: ready
                cutout_url: https://nanostudiopro.com/storage/cutouts/gen_abc.webp?sig=...
                matte_url: https://nanostudiopro.com/storage/cutouts/gen_abc_matte.png?sig=...
                bg_plate_url: https://nanostudiopro.com/storage/cutouts/gen_abc_bg.png?sig=...
        '401':
          description: Missing or invalid token
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                error:
                  code: unauthorized
                  message: Missing or invalid token
        '404':
          description: Generation not found or no cutout exists for it
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                error:
                  code: not_found
                  message: Generation not found or no cutout exists for it
        '429':
          description: Rate limit exceeded
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                error:
                  code: rate_limited
                  message: Rate limit exceeded
      operationId: getV1CutoutsByGenerationId
      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.'
    Cutout:
      type: object
      description: Cutout result for a generation. URLs are signed and time-limited (~6-hour signing window) — re-fetch this resource to get fresh ones.
      properties:
        generation_id:
          type: string
          description: ID of the generation this cutout belongs to.
        status:
          type: string
          enum:
          - pending
          - ready
          - failed
          description: '`ready` once all outputs are stored; `pending` while processing; `failed` on unrecoverable error.'
        cutout_url:
          type: string
          format: uri
          nullable: true
          description: Signed URL for the transparent-background WebP subject cutout. Omitted if compositing produced no foreground.
        matte_url:
          type: string
          format: uri
          nullable: true
          description: Signed URL for the grayscale alpha matte (PNG). White = subject, black = background.
        bg_plate_url:
          type: string
          format: uri
          nullable: true
          description: Signed URL for the subject-removed background plate (PNG).
  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.'