Nano Studio Pro Account API

Inspect your authenticated identity and storage usage. Useful as a health check after generating a new token.

GitHub OpenAPI

Operations 10

GET /v1/me Get the authenticated user #
GET /v1/storage Get storage usage #
GET /v1/account/credits Get current credit balance #
GET /v1/pricing Get current operation prices #
GET /v1/account/credits/history List credit transactions #
GET /v1/account/usage Get usage counts #
GET /v1/account/tokens List your API tokens #
DELETE /v1/account/tokens/{id} Revoke an API token #
GET /v1/account/connected_apps List connected apps #
GET /v1/meta Server version + capability flags #

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-account-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-account-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  title: Nano Studio Pro Account 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: Account
  description: Inspect your authenticated identity and storage usage. Useful as a health check after generating a new token.
paths:
  /v1/me:
    get:
      tags:
      - Account
      summary: Get the authenticated user
      description: Returns the user the token belongs to, plus their remaining credits. The fastest way to verify a new token works — call this first when integrating.
      responses:
        '200':
          description: Current user
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Me'
        '401':
          description: Missing or invalid token
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                error:
                  code: unauthorized
                  message: Missing or invalid token
        '429':
          description: Rate limit exceeded
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                error:
                  code: rate_limited
                  message: Rate limit exceeded
      operationId: getV1Me
      x-operation-id-source: derived
  /v1/storage:
    get:
      tags:
      - Account
      summary: Get storage usage
      description: Total bytes used (originals + variants + uploads) versus your plan's quota. Generations and asset uploads both count against this. Use it to surface a usage meter in your client, or to gate uploads when you're approaching the limit.
      responses:
        '200':
          description: Storage stats
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Storage'
        '401':
          description: Missing or invalid token
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                error:
                  code: unauthorized
                  message: Missing or invalid token
        '429':
          description: Rate limit exceeded
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                error:
                  code: rate_limited
                  message: Rate limit exceeded
      operationId: getV1Storage
      x-operation-id-source: derived
  /v1/account/credits:
    get:
      tags:
      - Account
      summary: Get current credit balance
      description: Returns the wallet balance for the user the token belongs to. If the calling token has a per-token daily cap configured, also returns rolling-24h spend through that token (`token_daily_spent`) and remaining headroom (`token_daily_remaining`). When the cap is hit, generation requests start returning HTTP 402 with code `token_cap_exceeded` even though the wallet itself isn't empty — useful as a leak-mitigation for tokens that get stolen and discovered hours later.
      responses:
        '200':
          description: Credit balance plus optional cap fields
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CreditBalance'
        '401':
          description: Missing or invalid token
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                error:
                  code: unauthorized
                  message: Missing or invalid token
        '429':
          description: Rate limit exceeded
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                error:
                  code: rate_limited
                  message: Rate limit exceeded
      operationId: getV1AccountCredits
      x-operation-id-source: derived
  /v1/pricing:
    get:
      tags:
      - Account
      summary: Get current operation prices
      description: Returns the credit cost of each operation the API supports (e.g. `generate_1k`, `generate_2k`, `kling_v3_5s`). Use this to render approximate costs in your client before kicking off work — though the actual deduction at request time is what wins, since prices can change. The list reflects whatever the admin has currently configured.
      responses:
        '200':
          description: Pricing list
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PricingList'
        '401':
          description: Missing or invalid token
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                error:
                  code: unauthorized
                  message: Missing or invalid token
        '429':
          description: Rate limit exceeded
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                error:
                  code: rate_limited
                  message: Rate limit exceeded
      operationId: getV1Pricing
      x-operation-id-source: derived
  /v1/account/credits/history:
    get:
      tags:
      - Account
      summary: List credit transactions
      description: Paginated transaction log for the user's wallet — every charge, refund, refill, or trial-credit bump. Each row carries the running balance after the transaction so you can render a spend timeline without recomputing.
      parameters:
      - name: limit
        in: query
        schema:
          type: integer
          minimum: 1
          maximum: 200
          default: 50
      - name: offset
        in: query
        schema:
          type: integer
          minimum: 0
          default: 0
      responses:
        '200':
          description: Transactions, newest first.
          content:
            application/json:
              schema:
                type: object
                properties:
                  items:
                    type: array
                    items:
                      type: object
                      properties:
                        id:
                          type: string
                        type:
                          type: string
                          description: '`charge` | `refund` | `refill` | `trial` | etc.'
                        amount:
                          type: integer
                          description: Negative for charges, positive for credits added.
                        balance_after:
                          type: integer
                        description:
                          type: string
                          nullable: true
                        reference_id:
                          type: string
                          nullable: true
                          description: Related entity id (a Generation, an Asset, etc.) when applicable.
                        token_id:
                          type: string
                          nullable: true
                          description: Set when the spend was triggered by an API token. Useful for attributing usage per integration.
                        created_at:
                          type: string
                          format: date-time
                  total:
                    type: integer
                  limit:
                    type: integer
                  offset:
                    type: integer
        '401':
          description: Missing or invalid token
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                error:
                  code: unauthorized
                  message: Missing or invalid token
        '429':
          description: Rate limit exceeded
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                error:
                  code: rate_limited
                  message: Rate limit exceeded
      operationId: getV1AccountCreditsHistory
      x-operation-id-source: derived
  /v1/account/usage:
    get:
      tags:
      - Account
      summary: Get usage counts
      description: Operation counts for today, the current calendar month, and lifetime. Counts every chargeable AI call the account has made. Pass `days=30` (max 90) to also receive a per-day timeseries — gap-filled so the series is always exactly `days` entries long, ordered oldest first. Useful for rendering charts.
      parameters:
      - name: days
        in: query
        description: If set (1–90), the response includes a `daily` array with one entry per day for the past N days, including zeros for days with no activity.
        schema:
          type: integer
          minimum: 1
          maximum: 90
      responses:
        '200':
          description: Usage stats.
          content:
            application/json:
              schema:
                type: object
                properties:
                  today:
                    type: object
                    properties:
                      operation_count:
                        type: integer
                  month:
                    type: object
                    properties:
                      operation_count:
                        type: integer
                  total:
                    type: object
                    properties:
                      operation_count:
                        type: integer
                  daily:
                    type: array
                    description: Present only when `days` is set. Oldest first.
                    items:
                      type: object
                      properties:
                        date:
                          type: string
                          example: '2026-04-15'
                        operation_count:
                          type: integer
                  as_of:
                    type: string
                    format: date-time
        '401':
          description: Missing or invalid token
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                error:
                  code: unauthorized
                  message: Missing or invalid token
        '429':
          description: Rate limit exceeded
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                error:
                  code: rate_limited
                  message: Rate limit exceeded
      operationId: getV1AccountUsage
      x-operation-id-source: derived
  /v1/account/tokens:
    get:
      tags:
      - Account
      summary: List your API tokens
      description: 'Returns every Personal Access Token attached to the caller''s account, including expired and revoked ones, sorted by creation date. The hashed token value is never returned — only the `token_prefix` (visible to humans for recognition). The token currently authenticating this request is marked `is_current: true`.'
      responses:
        '200':
          description: Token list.
          content:
            application/json:
              schema:
                type: object
                properties:
                  items:
                    type: array
                    items:
                      type: object
                      properties:
                        id:
                          type: string
                        name:
                          type: string
                        token_prefix:
                          type: string
                          example: sk_sf_live_AbCd…
                        scopes:
                          type: array
                          items:
                            type: string
                            enum:
                            - read
                            - write
                        last_used_at:
                          type: string
                          format: date-time
                          nullable: true
                        created_at:
                          type: string
                          format: date-time
                        expires_at:
                          type: string
                          format: date-time
                          nullable: true
                        revoked_at:
                          type: string
                          format: date-time
                          nullable: true
                        daily_credit_cap:
                          type: integer
                          nullable: true
                        source:
                          type: string
                          description: '`manual` (created in settings) | `device_flow` (issued through OAuth device authorization) | `oauth` (issued to a connected app via the OAuth authorization-code flow)'
                        user_agent:
                          type: string
                          nullable: true
                        oauth_app_id:
                          type: string
                          nullable: true
                        token_type:
                          type: string
                          enum:
                          - secret
                          - publishable
                          description: '`secret` (sk_sf_live_, full API) | `publishable` (pk_sf_live_, embeddable, search-only).'
                        search_scope:
                          allOf:
                          - $ref: '#/components/schemas/SearchScope'
                          nullable: true
                          description: Narrowing config for publishable keys. `null` for secret keys and unscoped publishable keys.
                        is_current:
                          type: boolean
        '401':
          description: Missing or invalid token
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                error:
                  code: unauthorized
                  message: Missing or invalid token
        '429':
          description: Rate limit exceeded
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                error:
                  code: rate_limited
                  message: Rate limit exceeded
      operationId: getV1AccountTokens
      x-operation-id-source: derived
  /v1/account/tokens/{id}:
    delete:
      tags:
      - Account
      summary: Revoke an API token
      description: 'Marks the token as revoked. Idempotent — calling it on an already-revoked token still returns 204. Note: the request you''re making *right now* completes normally even if you revoke the token you''re using; the next request with that token returns 401.'
      parameters:
      - name: id
        in: path
        required: true
        schema:
          type: string
        description: Token id from `/v1/account/tokens`.
      responses:
        '204':
          description: Token revoked (or already was).
        '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: Token not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                error:
                  code: not_found
                  message: Token not found
        '429':
          description: Rate limit exceeded
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                error:
                  code: rate_limited
                  message: Rate limit exceeded
      operationId: deleteV1AccountTokensById
      x-operation-id-source: derived
  /v1/account/connected_apps:
    get:
      tags:
      - Account
      summary: List connected apps
      description: OAuth apps that currently have at least one non-revoked token on this account. Use this to show "apps with access to your account" in your client. Distinct from apps the user has *registered* (built themselves).
      responses:
        '200':
          description: Connected apps.
          content:
            application/json:
              schema:
                type: object
                properties:
                  items:
                    type: array
                    items:
                      type: object
                      properties:
                        id:
                          type: string
                        name:
                          type: string
                        icon_url:
                          type: string
                          nullable: true
                        homepage_url:
                          type: string
                          nullable: true
                        is_first_party:
                          type: boolean
                        tokens:
                          type: array
                          items:
                            type: object
                            properties:
                              id:
                                type: string
                              name:
                                type: string
                              scopes:
                                type: array
                                items:
                                  type: string
                              daily_credit_cap:
                                type: integer
                                nullable: true
                              last_used_at:
                                type: string
                                format: date-time
                                nullable: true
                              created_at:
                                type: string
                                format: date-time
        '401':
          description: Missing or invalid token
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                error:
                  code: unauthorized
                  message: Missing or invalid token
        '429':
          description: Rate limit exceeded
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                error:
                  code: rate_limited
                  message: Rate limit exceeded
      operationId: getV1AccountConnectedApps
      x-operation-id-source: derived
  /v1/meta:
    get:
      tags:
      - Account
      summary: Server version + capability flags
      description: 'Public — no auth required. Returns the server''s version, build info, and a capability matrix so clients can do feature detection without parsing the OpenAPI spec. Capabilities are stable strings: new flags get added, existing ones never removed without bumping `api_version`.'
      security: []
      responses:
        '200':
          description: Server metadata.
          content:
            application/json:
              schema:
                type: object
                properties:
                  version:
                    type: string
                    example: 0.42.1
                  build_hash:
                    type: string
                    example: a1b2c3d
                  build_date:
                    type: string
                    format: date-time
                    nullable: true
                  api_version:
                    type: string
                    example: v1
                  capabilities:
                    type: object
                    description: Nested feature flags keyed by area.
      operationId: getV1Meta
      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.'
    PricingList:
      type: object
      properties:
        items:
          type: array
          items:
            type: object
            properties:
              operation:
                type: string
                description: Operation key (e.g. `generate_1k`, `generate_2k`, `kling_v3_5s`).
              credits:
                type: integer
                description: Credit cost per call.
        note:
          type: string
    Me:
      type: object
      properties:
        id:
          type: string
        name:
          type: string
          nullable: true
        email:
          type: string
          format: email
        role:
          type: string
          example: user
        credits:
          type: integer
          description: Generation credits remaining.
        plan:
          type: string
          example: free
        storage_used_bytes:
          type: integer
        storage_limit_bytes:
          type: integer
        quotas:
          type: object
          description: Plan limits the user is bound by. Use these to gate UI affordances ('upgrade to unlock 200GB') or compute remaining headroom.
          properties:
            storage_bytes:
              type: integer
            monthly_credits:
              type: integer
              description: Credit allotment refilled each billing period.
    CreditBalance:
      type: object
      properties:
        balance:
          type: integer
          description: Credits remaining in the user's wallet.
          example: 1240
        token_daily_cap:
          type: integer
          nullable: true
          description: If the calling token has a daily-spend cap configured, this is its value. Absent otherwise.
        token_daily_spent:
          type: integer
          nullable: true
          description: Credits spent through the calling token in the last 24 hours.
        token_daily_remaining:
          type: integer
          nullable: true
          description: '`token_daily_cap` minus `token_daily_spent`, floored at 0.'
    SearchScope:
      type: object
      description: 'Per-key narrowing carried by publishable (`pk_sf_live_`) keys. Every field is optional; an absent field means no restriction on that axis. Enforcement is silent — filters outside the scope produce an empty 200 page, oversized `image_size` requests are served the cap, and `include_regions` is ignored unless allowed. The one hard rejection is `origins`: a browser request from an origin not on the list gets `403 forbidden`.'
      properties:
        projects:
          type: array
          items:
            type: string
          maxItems: 50
          description: The key sees ONLY these project ids. Absent = the whole library.
        types:
          type: array
          items:
            type: string
            enum:
            - asset
            - generation
          description: Result types the key may return. Absent (or both) = no restriction.
        max_image_size:
          type: string
          enum:
          - xs
          - thumb
          - preview
          - large
          - original
          description: Largest `image_size` variant the key may be served. Requests above it — the `preview` default included — are silently clamped down to this rung.
        origins:
          type: array
          items:
            type: string
            example: https://shop.example.com
          maxItems: 20
          description: Exact-match browser `Origin` allowlist. Entries must be bare http(s) origins (no path, no default port). Absent = any origin. Requests with no Origin header (curl, server-to-server) always pass.
        include_regions:
          type: boolean
          description: Whether the key may request detection regions via `include_regions=true`. Default false — the request flag is silently ignored without it.
        include_narrative:
          type: boolean
          description: Whether results carry `narrative` (the AI-written photo description). Default false — publishable-key results omit the field unless the scope opts in. Secret keys always get it.
    Storage:
      type: object
      properties:
        used_bytes:
          type: integer
          example: 2147483648
        limit_bytes:
          type: integer
          example: 10737418240
        used_percentage:
          type: number
          example: 20
          description: Percentage 0–100 with 2 decimal places.
        plan:
          type: string
          example: free
  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.'