> ## Documentation Index
> Fetch the complete documentation index at: https://neverminedag-sync-api-errors-9d14109.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# BuildShip

> Protect your BuildShip workflows and monetize access with Nevermined Payments

Integrating Nevermined's access control and payment system with your existing BuildShip workflows is the quickest way to turn your low-code backend logic into a fully monetized API. This process requires setting up an **AI Agent** in Nevermined and configuring the **Nevermined Trigger** in BuildShip.

<Note>
  This guide assumes you have an active BuildShip account and have signed up for a Nevermined account.
</Note>

## The Nevermined BuildShip Trigger

The Nevermined Trigger is a specialized node in BuildShip that is placed at the beginning of your workflow. Its function is to act as a security layer and payment middleware, validating subscriber access before your workflow logic executes.

<CardGroup cols={2}>
  <Card title="Primary Purpose" icon="plug">
    To secure HTTP access to a BuildShip workflow endpoint for monetization.
  </Card>

  <Card title="Security Mechanism" icon="shield">
    It validates the user's **Access Token** (Bearer Token) and verifies their subscription status against a Nevermined plan.
  </Card>
</CardGroup>

## Step-by-step Tutorial: Monetizing a BuildShip Workflow

The goal is to secure a BuildShip endpoint so it is only accessible by users who have purchased a **Payment Plan** and provide a valid **Access Token**.

<Steps>
  <Step title="Get Your API Key">
    To interact with the Nevermined API, you need an API key.

    1. Go to the [Nevermined App](https://nevermined.app/).
           <img src="https://mintcdn.com/neverminedag-sync-api-errors-9d14109/BZb-MNNKdxxkC8FY/images/agents-and-plans/nevermined-login-page.png?fit=max&auto=format&n=BZb-MNNKdxxkC8FY&q=85&s=1f5037f3c986df9ab8c4c89005a2dcb5" alt="Nevermined Login Page" width="1267" height="750" data-path="images/agents-and-plans/nevermined-login-page.png" />
    2. Log in with your preferred method.
    3. In the dashboard, click on the **API Keys** menu item.
           <img src="https://mintcdn.com/neverminedag-sync-api-errors-9d14109/BZb-MNNKdxxkC8FY/images/agents-and-plans/nevermined-dashboard-api-key.png?fit=max&auto=format&n=BZb-MNNKdxxkC8FY&q=85&s=a0ceb7ad4cce259a6fd9dede50d8ffef" alt="Nevermined API Key Generation (1)" width="1205" height="696" data-path="images/agents-and-plans/nevermined-dashboard-api-key.png" />
    4. Click on **New API Key** button, generate a new key, give it a descriptive name, and copy it.
           <img src="https://mintcdn.com/neverminedag-sync-api-errors-9d14109/BZb-MNNKdxxkC8FY/images/agents-and-plans/nevermined-api-key-new.png?fit=max&auto=format&n=BZb-MNNKdxxkC8FY&q=85&s=c6be90ec756ac7f8dc1550b35df2557b" alt="Nevermined API Key Generation (2)" width="1201" height="695" data-path="images/agents-and-plans/nevermined-api-key-new.png" />
    5. **Copy the generated key** and store it securely.
           <img src="https://mintcdn.com/neverminedag-sync-api-errors-9d14109/BZb-MNNKdxxkC8FY/images/agents-and-plans/nevermined-api-key-created.png?fit=max&auto=format&n=BZb-MNNKdxxkC8FY&q=85&s=d456b576a1940ffa46df4b8c3a82bcb0" alt="Nevermined API Key Generation (3)" width="1206" height="695" data-path="images/agents-and-plans/nevermined-api-key-created.png" />
  </Step>

  <Step title="Configure Nevermined Integration in BuildShip">
    You must configure the API key as a secure integration in your BuildShip workspace.

    1. In your BuildShip Workspace, go to **Settings** > **Integrations**.
    2. Search for **Nevermined** and click to add a new integration.
           <img src="https://mintcdn.com/neverminedag-sync-api-errors-9d14109/BZb-MNNKdxxkC8FY/images/buildship/buildship-integrations.png?fit=max&auto=format&n=BZb-MNNKdxxkC8FY&q=85&s=facb0499bb464f7d08f37305452b7a1f" alt="Buildship Settings > Integrations" data-og-width="1202" width="1202" data-og-height="695" height="695" data-path="images/buildship/buildship-integrations.png" data-optimize="true" data-opv="3" srcset="https://mintcdn.com/neverminedag-sync-api-errors-9d14109/BZb-MNNKdxxkC8FY/images/buildship/buildship-integrations.png?w=280&fit=max&auto=format&n=BZb-MNNKdxxkC8FY&q=85&s=56f6b556b1ad26001bec0b7d722c21e2 280w, https://mintcdn.com/neverminedag-sync-api-errors-9d14109/BZb-MNNKdxxkC8FY/images/buildship/buildship-integrations.png?w=560&fit=max&auto=format&n=BZb-MNNKdxxkC8FY&q=85&s=85255e66adec99ccc7ef6e52351035ce 560w, https://mintcdn.com/neverminedag-sync-api-errors-9d14109/BZb-MNNKdxxkC8FY/images/buildship/buildship-integrations.png?w=840&fit=max&auto=format&n=BZb-MNNKdxxkC8FY&q=85&s=19eb1a0f236246492239280026dbd935 840w, https://mintcdn.com/neverminedag-sync-api-errors-9d14109/BZb-MNNKdxxkC8FY/images/buildship/buildship-integrations.png?w=1100&fit=max&auto=format&n=BZb-MNNKdxxkC8FY&q=85&s=23018b79826b6d3c061993cd713f9a2b 1100w, https://mintcdn.com/neverminedag-sync-api-errors-9d14109/BZb-MNNKdxxkC8FY/images/buildship/buildship-integrations.png?w=1650&fit=max&auto=format&n=BZb-MNNKdxxkC8FY&q=85&s=fb17cefe924dc2b6e57737a6061243e7 1650w, https://mintcdn.com/neverminedag-sync-api-errors-9d14109/BZb-MNNKdxxkC8FY/images/buildship/buildship-integrations.png?w=2500&fit=max&auto=format&n=BZb-MNNKdxxkC8FY&q=85&s=0f3517aa368062e03287463fa9e3cdb6 2500w" />
    3. Provide a **Key Name** (e.g., `NVM_API_KEY`). This name will be selectable in the Trigger later.
    4. Paste your Nevermined API Key (from Step 1) into the **Value** field.
           <img src="https://mintcdn.com/neverminedag-sync-api-errors-9d14109/BZb-MNNKdxxkC8FY/images/buildship/buildship-new-integration.png?fit=max&auto=format&n=BZb-MNNKdxxkC8FY&q=85&s=1e75897865d3eef10a9a5a9292be41c9" alt="Buildship New Integration" width="1203" height="693" data-path="images/buildship/buildship-new-integration.png" />
    5. Save the integration to activate it in your workspace.
  </Step>

  <Step title="3. Initial Trigger Setup in BuildShip (Part 1)">
    Now, set up the entry point of your workflow using the configured integration.

    * Add the **Nevermined Trigger** node as the first node in your workflow.
    * **Authentication Key**: In the trigger's configuration, select the **Key Name** you defined in Step 2 (e.g., `NVM_API_KEY`) from the dropdown menu.
    * Define your desired endpoint: set the **`Path`** (e.g., `/my-backend-logic`) and the **`Method`** (e.g., `POST`).
    * Connect the **`prompt`** output of the trigger to the input of the next node (your core logic).

    <Note>
      The user's JSON request body, including the prompt, will be passed through the **`prompt`** output. Leave the **`Agent ID`** parameter empty for now.
    </Note>
  </Step>

  <Step title="4. Create the Payment Plan and Agent in Nevermined">
    Define the monetization rules and register your service as an AI Agent in Nevermined.

    1. **Create Plan**: Create a **Payment Plan** that defines the pricing and consumption model for your service.
           <img src="https://mintcdn.com/neverminedag-sync-api-errors-9d14109/BZb-MNNKdxxkC8FY/images/agents-and-plans/nevermined-dashboard-plan.png?fit=max&auto=format&n=BZb-MNNKdxxkC8FY&q=85&s=f8c9eac7f9c96178e33c496dc6d9a932" alt="Nevermined Plan Creation (1)" width="1125" height="717" data-path="images/agents-and-plans/nevermined-dashboard-plan.png" />
           <img src="https://mintcdn.com/neverminedag-sync-api-errors-9d14109/BZb-MNNKdxxkC8FY/images/agents-and-plans/nevermined-plan-new.png?fit=max&auto=format&n=BZb-MNNKdxxkC8FY&q=85&s=5b39b7bda40da7284be983fd0a866745" alt="Nevermined Plan Creation (2)" width="1114" height="889" data-path="images/agents-and-plans/nevermined-plan-new.png" />
           <img src="https://mintcdn.com/neverminedag-sync-api-errors-9d14109/BZb-MNNKdxxkC8FY/images/agents-and-plans/nevermined-plan-new-2.png?fit=max&auto=format&n=BZb-MNNKdxxkC8FY&q=85&s=664606f9186dfc72dec8965ff402fc45" alt="Nevermined Plan Creation (3)" width="1118" height="885" data-path="images/agents-and-plans/nevermined-plan-new-2.png" />
    2. **Register Agent**: Create a new **AI Agent**.
           <img src="https://mintcdn.com/neverminedag-sync-api-errors-9d14109/BZb-MNNKdxxkC8FY/images/agents-and-plans/nevermined-dashboard-agent.png?fit=max&auto=format&n=BZb-MNNKdxxkC8FY&q=85&s=ce26c74a77e6f403831ed337abd7af83" alt="Nevermined Agent Registration" width="1107" height="674" data-path="images/agents-and-plans/nevermined-dashboard-agent.png" />
    3. **Register Endpoint**: In the Agent configuration, register the BuildShip endpoint. Ensure the **Path** and **Method** match exactly what you configured in BuildShip (Step 3).
           <img src="https://mintcdn.com/neverminedag-sync-api-errors-9d14109/BZb-MNNKdxxkC8FY/images/agents-and-plans/nevermined-agent-new.png?fit=max&auto=format&n=BZb-MNNKdxxkC8FY&q=85&s=c3db981986005e66914d2aa117ca1ad6" alt="Nevermined Agent Endpoint Registration" width="1203" height="967" data-path="images/agents-and-plans/nevermined-agent-new.png" />
    4. **Associate Plan**: Attach the new Payment Plan to this Agent.
           <img src="https://mintcdn.com/neverminedag-sync-api-errors-9d14109/BZb-MNNKdxxkC8FY/images/agents-and-plans/nevermined-agent-plan.png?fit=max&auto=format&n=BZb-MNNKdxxkC8FY&q=85&s=b0379999da8df3fca858705f1373955a" alt="Nevermined Agent and Plan" width="1203" height="961" data-path="images/agents-and-plans/nevermined-agent-plan.png" />
  </Step>

  <Step title="5. Finalize the Trigger Setup in BuildShip (Part 2)">
    Link the configured Agent back to your BuildShip workflow.

    * Return to your BuildShip workflow and open the **Nevermined Payment Trigger** configuration.
    * In the **`Agent Name`** field, select the **Agent Name** you just registered in Nevermined from the dropdown list.
          <img src="https://mintcdn.com/neverminedag-sync-api-errors-9d14109/BZb-MNNKdxxkC8FY/images/buildship/buildship-select-agent.png?fit=max&auto=format&n=BZb-MNNKdxxkC8FY&q=85&s=39cfeb85514d71cacb28fd7f5fa702bc" alt="Buildship Trigger configuration" width="1020" height="1154" data-path="images/buildship/buildship-select-agent.png" />

    *If the ID does not appear*, close the configuration panel and reopen it to refresh the list of available Agents.

    * Click **Ship 🚀** to deploy the workflow.
  </Step>
</Steps>

## User Access Flow

Once deployed, this is the complete process a subscriber must follow to successfully access your secured workflow.

<Steps>
  <Step title="1. Purchase and Token Generation">
    The user must purchase the Payment Plan associated with your AI Agent. Upon purchase, they **generate an Access Token** (Bearer Token) from their Nevermined profile.
  </Step>

  <Step title="2. Call the Secured Endpoint">
    The user sends an HTTP request to the deployed BuildShip endpoint with two key components:

    * **Header**: The **Access Token** must be included in the `Authorization` header:
      ` Authorization: Bearer [User's Access Token]   `
    * **Body**: The input data (*prompt*) for your workflow must be sent in the request body as a **JSON object** using the key **`prompt`**:

    `json  {  "prompt": "PROMPT_TO_THE_BUILDSHIP_AGENT"  }  `
  </Step>

  <Step title="3. Validation and Execution">
    The **Nevermined Trigger** intercepts the request, validates the token, checks the subscription status, deducts the necessary credits, and allows the JSON `prompt` data to flow into your BuildShip logic for processing.
  </Step>
</Steps>
