Nerdit Replace API

The replace API from Nerdit — 6 operation(s) for replace.

GitHub OpenAPI

Operations 7

POST /api/replace/teaser Sketch your version of the SaaS at a URL #
GET /api/replace/templates/{slug} Show one template's public spec #
GET /api/replace/templates/{slug}/preview/{file} Serve one file of a template's static preview #
GET /api/replace/examples The approved templates the landing page shows #
GET /api/replace/claim Show where the signed-in account's claim stands #
POST /api/replace/claim Book a trial box for a template and queue its generation #
POST /api/replace/milestone/{allocation_id} Record a delivered app's first record #

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/nerdit-ai:nerdit-ai-replace-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

nerdit-ai-replace-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  title: Nerdit Cloud (web) Replace API
  version: 0.1.0
tags:
- name: replace
paths:
  /api/replace/teaser:
    post:
      tags:
      - replace
      summary: Sketch your version of the SaaS at a URL
      description: 'Return the spec of a host, from the cache or freshly extracted.


        With ``Accept: text/event-stream`` the answer is a stream of events

        the front draws the app from as they arrive; otherwise one JSON body.

        Both have the same shape on a hit and on a miss and never say which

        (spec-v1 §15); the stream replays a hit at a fresh extraction''s pace.'
      operationId: teaser_api_replace_teaser_post
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/TeaserRequest'
        required: true
      responses:
        '200':
          description: 'JSON, or with `Accept: text/event-stream` the events `fetching {page}`, `spec_partial {…}`, `spec {TeaserView}`, `preview {url}`, `error {code, message}` and `done`'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TeaserView'
            text/event-stream:
              schema:
                type: string
              example: 'event: fetching

                data: {"page":"/"}


                '
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorEnvelope'
        '422':
          description: Unprocessable Content
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorEnvelope'
        '429':
          description: Too Many Requests
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorEnvelope'
        '503':
          description: Service Unavailable
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorEnvelope'
  /api/replace/templates/{slug}:
    get:
      tags:
      - replace
      summary: Show one template's public spec
      description: The spec behind a shared ``/replace/t/`` link.
      operationId: template_api_replace_templates__slug__get
      parameters:
      - name: slug
        in: path
        required: true
        schema:
          type: string
          title: Slug
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TemplateView'
        '404':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorEnvelope'
          description: Not Found
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /api/replace/templates/{slug}/preview/{file}:
    get:
      tags:
      - replace
      summary: Serve one file of a template's static preview
      description: 'The kit''s read-only render of the v0, for the sketch''s sandboxed iframe.


        Only names ``preview.json`` vouches for are served, under a CSP that

        allows inline styles and data: images and nothing else.'
      operationId: preview_file_api_replace_templates__slug__preview__file__get
      parameters:
      - name: slug
        in: path
        required: true
        schema:
          type: string
          title: Slug
      - name: file
        in: path
        required: true
        schema:
          type: string
          title: File
      responses:
        '200':
          description: Successful Response
          content:
            text/html: {}
            application/json: {}
        '404':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorEnvelope'
          description: Not Found
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /api/replace/examples:
    get:
      tags:
      - replace
      summary: The approved templates the landing page shows
      description: '``replace_examples`` in order, keeping only approved templates.'
      operationId: examples_api_replace_examples_get
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ExamplesView'
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorEnvelope'
  /api/replace/claim:
    get:
      tags:
      - replace
      summary: Show where the signed-in account's claim stands
      description: Polled by the front; also queues a build the daily cap held back.
      operationId: claim_status_api_replace_claim_get
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ClaimView'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorEnvelope'
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorEnvelope'
    post:
      tags:
      - replace
      summary: Book a trial box for a template and queue its generation
      description: 'Create or find the account''s box, record the lead, queue the build.


        Idempotent on the account and the slug: a repeat answers ``200``. A

        second, different slug is refused ``409 replace.already_claimed``. Box

        refusals are the managed ones (``trial_quota_used``,

        ``trial_boxes_busy``, ``plan_limit_exceeded``). ``config`` (the

        sketch''s answers) is kept on the delivery until it is put on the box.'
      operationId: claim_api_replace_claim_post
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ClaimRequest'
        required: true
      responses:
        '201':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ClaimCreated'
        '200':
          description: The account already claimed it
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ClaimCreated'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorEnvelope'
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorEnvelope'
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorEnvelope'
        '409':
          description: Conflict
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorEnvelope'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /api/replace/milestone/{allocation_id}:
    post:
      tags:
      - replace
      summary: Record a delivered app's first record
      description: 'Called once by the app on the box (``NERDIT_MILESTONE_URL``), not by a browser.


        The bearer is the token delivery gave that app; an unknown box and a

        wrong token get the same 401. A repeat is a 204 that writes nothing.

        ``method: sample`` (the empty state''s "Load sample data") is audited

        as ``replace.sample_loaded`` and is never a first record.'
      operationId: milestone_api_replace_milestone__allocation_id__post
      parameters:
      - name: allocation_id
        in: path
        required: true
        schema:
          type: string
          format: uuid
          title: Allocation Id
      responses:
        '204':
          description: Successful Response
        '401':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorEnvelope'
          description: Unauthorized
        '404':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorEnvelope'
          description: Not Found
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
components:
  schemas:
    ClaimView:
      properties:
        slug:
          type: string
          title: Slug
        function_name:
          type: string
          title: Function Name
        state:
          type: string
          enum:
          - provisioning
          - building
          - deploying
          - ready
          - failed
          title: State
        app_url:
          anyOf:
          - type: string
          - type: 'null'
          title: App Url
        mcp_url:
          type: string
          title: Mcp Url
        invite_url:
          anyOf:
          - type: string
          - type: 'null'
          title: Invite Url
        expires_at:
          anyOf:
          - type: string
            format: date-time
          - type: 'null'
          title: Expires At
        records:
          anyOf:
          - type: integer
          - type: 'null'
          title: Records
        people:
          anyOf:
          - type: integer
          - type: 'null'
          title: People
      additionalProperties: false
      type: object
      required:
      - slug
      - function_name
      - state
      - app_url
      - mcp_url
      - invite_url
      - expires_at
      title: ClaimView
      description: 'Where the account''s claim stands; the front polls it every five seconds.


        ``app_url`` and ``invite_url`` stay ``null`` until delivery (lot L4) has

        put the app on the box; ``invite_url`` is the console page where the owner

        lets other people in. ``function_name`` names the v0 on the console''s home

        card (onboarding P0); ``records`` and ``people`` are the app''s own numbers

        when the box is up and answered, ``null`` otherwise.'
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
            - type: string
            - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
        input:
          title: Input
        ctx:
          type: object
          title: Context
      type: object
      required:
      - loc
      - msg
      - type
      title: ValidationError
    ErrorDetail:
      properties:
        code:
          $ref: '#/components/schemas/ErrorCode'
        message:
          type: string
          title: Message
        status:
          type: integer
          title: Status
        request_id:
          anyOf:
          - type: string
          - type: 'null'
          title: Request Id
        details:
          anyOf:
          - additionalProperties: true
            type: object
          - type: 'null'
          title: Details
      additionalProperties: false
      type: object
      required:
      - code
      - message
      - status
      title: ErrorDetail
      description: The stable body nested under the envelope's ``error`` key.
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    TeaserSource:
      properties:
        utm_source:
          anyOf:
          - type: string
            maxLength: 100
          - type: 'null'
          title: Utm Source
        utm_medium:
          anyOf:
          - type: string
            maxLength: 100
          - type: 'null'
          title: Utm Medium
        utm_campaign:
          anyOf:
          - type: string
            maxLength: 100
          - type: 'null'
          title: Utm Campaign
        utm_content:
          anyOf:
          - type: string
            maxLength: 100
          - type: 'null'
          title: Utm Content
        utm_term:
          anyOf:
          - type: string
            maxLength: 100
          - type: 'null'
          title: Utm Term
        ref:
          anyOf:
          - type: string
            maxLength: 100
          - type: 'null'
          title: Ref
      additionalProperties: false
      type: object
      title: TeaserSource
      description: Where the visitor came from; every field optional and bounded.
    ErrorCode:
      type: string
      enum:
      - bad_request
      - unauthorized
      - forbidden
      - not_found
      - method_not_allowed
      - conflict
      - validation_failed
      - rate_limited
      - internal_error
      - service_unavailable
      - not_implemented
      - plan_limit_exceeded
      - link_code_invalid
      - link_code_expired
      - link_code_consumed
      - link_code_attempts_exceeded
      - link_code_limit_exceeded
      - link_code_denied
      - link_key_invalid
      - preauth_key_limit_exceeded
      - node_not_found
      - node_already_linked
      - node_offline
      - machine_waking
      - node_revoked
      - entitlement_required
      - organisation_has_members
      - trial_quota_used
      - trial_boxes_busy
      - trial_archived
      - replace.bad_url
      - replace.extractor_unavailable
      - replace.already_claimed
      - csrf_failed
      - auth_transaction_invalid
      - auth_transaction_expired
      - auth_identity_invalid
      - auth_identity_deleting
      - session_invalid
      - session_expired
      - navigation_ticket_invalid
      - navigation_ticket_expired
      - navigation_ticket_consumed
      - proxy_session_invalid
      - proxy_session_expired
      - origin_forbidden
      - hosted_private
      - hosted_disabled
      - visitor_session_required
      - custom_domains.pro_required
      - custom_domains.limit_reached
      - custom_domains.apex_unsupported
      - custom_domains.taken
      - custom_domains.not_found
      - access_revoked
      - webhook_signature_invalid
      - already_subscribed
      - billing_account_missing
      - oauth_invalid_request
      - oauth_invalid_client
      - oauth_invalid_grant
      - oauth_unsupported_grant_type
      - oauth_invalid_scope
      - oauth_access_denied
      - oauth_server_error
      - oauth_temporarily_unavailable
      - oauth_invalid_token
      - oauth_insufficient_scope
      - protocol_version_unsupported
      - node_authentication_failed
      - relay_frame_invalid
      - relay_destination_invalid
      - relay_stream_unknown
      - relay_stream_limit_exceeded
      - relay_body_too_large
      - relay_response_too_large
      - relay_bandwidth_exceeded
      - relay_backpressure
      - relay_draining
      - relay_stream_timeout
      title: ErrorCode
      description: Codes clients may branch on independently of human-readable messages.
    ClaimConfig:
      properties:
        audience:
          anyOf:
          - type: string
            enum:
            - me
            - team
            - clients
          - type: 'null'
          title: Audience
        has_data:
          anyOf:
          - type: string
            enum:
            - csv
            - none
          - type: 'null'
          title: Has Data
      additionalProperties: false
      type: object
      title: ClaimConfig
      description: The sketch's two optional answers (spec-v1 §18.3); never touch the spec.
    TeaserRequest:
      properties:
        url:
          type: string
          maxLength: 2048
          minLength: 1
          title: Url
        source:
          anyOf:
          - $ref: '#/components/schemas/TeaserSource'
          - type: 'null'
      additionalProperties: false
      type: object
      required:
      - url
      title: TeaserRequest
      description: '``POST /api/replace/teaser``.'
    ClaimCreated:
      properties:
        allocation_id:
          type: string
          format: uuid
          title: Allocation Id
        state:
          type: string
          enum:
          - provisioning
          - building
          - deploying
          - ready
          - failed
          title: State
        eta_seconds:
          type: integer
          title: Eta Seconds
      additionalProperties: false
      type: object
      required:
      - allocation_id
      - state
      - eta_seconds
      title: ClaimCreated
    ClaimRequest:
      properties:
        slug:
          type: string
          pattern: ^[a-z][a-z0-9-]{2,40}$
          title: Slug
        config:
          anyOf:
          - $ref: '#/components/schemas/ClaimConfig'
          - type: 'null'
      additionalProperties: false
      type: object
      required:
      - slug
      title: ClaimRequest
    ExampleView:
      properties:
        slug:
          type: string
          title: Slug
        function_name:
          type: string
          title: Function Name
        summary:
          type: string
          title: Summary
      additionalProperties: false
      type: object
      required:
      - slug
      - function_name
      - summary
      title: ExampleView
    ExamplesView:
      properties:
        examples:
          items:
            $ref: '#/components/schemas/ExampleView'
          type: array
          title: Examples
      additionalProperties: false
      type: object
      required:
      - examples
      title: ExamplesView
    TemplateView:
      properties:
        slug:
          type: string
          title: Slug
        spec_public:
          additionalProperties: true
          type: object
          title: Spec Public
        status_public:
          type: string
          enum:
          - ready
          - building
          - new
          title: Status Public
        preview_url:
          anyOf:
          - type: string
          - type: 'null'
          title: Preview Url
        screenshots_public:
          items:
            type: string
          type: array
          title: Screenshots Public
      additionalProperties: false
      type: object
      required:
      - slug
      - spec_public
      - status_public
      - screenshots_public
      title: TemplateView
      description: '``GET /api/replace/templates/{slug}``; captures only once approved.'
    TeaserView:
      properties:
        slug:
          type: string
          title: Slug
        spec_public:
          additionalProperties: true
          type: object
          title: Spec Public
        status_public:
          type: string
          enum:
          - ready
          - building
          - new
          title: Status Public
        preview_url:
          anyOf:
          - type: string
          - type: 'null'
          title: Preview Url
      additionalProperties: false
      type: object
      required:
      - slug
      - spec_public
      - status_public
      title: TeaserView
      description: 'A spec ready to render, the same whether it was cached or just written.


        ``preview_url`` is the same-origin path of the static preview''s

        ``index.html`` (its siblings sit next to it), ``null`` when none rendered.'
    ErrorEnvelope:
      properties:
        error:
          $ref: '#/components/schemas/ErrorDetail'
      additionalProperties: false
      type: object
      required:
      - error
      title: ErrorEnvelope
      description: Response model used by all cloud API errors.