> ## Documentation Index
> Fetch the complete documentation index at: https://docs.nevermined.app/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/816P0WhT1WcQ-Koj/images/agents-and-plans/nevermined-login-page.png?fit=max&auto=format&n=816P0WhT1WcQ-Koj&q=85&s=e27c3744406b8260778956487438ebbb" 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/816P0WhT1WcQ-Koj/images/agents-and-plans/nevermined-dashboard-api-key.png?fit=max&auto=format&n=816P0WhT1WcQ-Koj&q=85&s=3b7240acbcc8f090618f00f6c352224b" 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/816P0WhT1WcQ-Koj/images/agents-and-plans/nevermined-api-key-new.png?fit=max&auto=format&n=816P0WhT1WcQ-Koj&q=85&s=f345de863d0f7c89a8552bc410deaf61" 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/816P0WhT1WcQ-Koj/images/agents-and-plans/nevermined-api-key-created.png?fit=max&auto=format&n=816P0WhT1WcQ-Koj&q=85&s=97e5eea85b3088ec85685dd6dd7ceef6" 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/816P0WhT1WcQ-Koj/images/buildship/buildship-integrations.png?fit=max&auto=format&n=816P0WhT1WcQ-Koj&q=85&s=161ca38ca90c15747e4985b886410567" 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/816P0WhT1WcQ-Koj/images/buildship/buildship-integrations.png?w=280&fit=max&auto=format&n=816P0WhT1WcQ-Koj&q=85&s=8aa7530185195c0aa961e0f7a6163b02 280w, https://mintcdn.com/neverminedag/816P0WhT1WcQ-Koj/images/buildship/buildship-integrations.png?w=560&fit=max&auto=format&n=816P0WhT1WcQ-Koj&q=85&s=c2222189820088cce13182cc33d9eec7 560w, https://mintcdn.com/neverminedag/816P0WhT1WcQ-Koj/images/buildship/buildship-integrations.png?w=840&fit=max&auto=format&n=816P0WhT1WcQ-Koj&q=85&s=3345a5af06f29ad14e2ef9e21c0e4c57 840w, https://mintcdn.com/neverminedag/816P0WhT1WcQ-Koj/images/buildship/buildship-integrations.png?w=1100&fit=max&auto=format&n=816P0WhT1WcQ-Koj&q=85&s=03343bb2869212df7bdabe6213cb5814 1100w, https://mintcdn.com/neverminedag/816P0WhT1WcQ-Koj/images/buildship/buildship-integrations.png?w=1650&fit=max&auto=format&n=816P0WhT1WcQ-Koj&q=85&s=04f6b97414c2f6b854c6497120627971 1650w, https://mintcdn.com/neverminedag/816P0WhT1WcQ-Koj/images/buildship/buildship-integrations.png?w=2500&fit=max&auto=format&n=816P0WhT1WcQ-Koj&q=85&s=10651eae686550f7a896cccca68e8fbf 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/816P0WhT1WcQ-Koj/images/buildship/buildship-new-integration.png?fit=max&auto=format&n=816P0WhT1WcQ-Koj&q=85&s=4ad820544682cab0d78489b091b972d7" 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/816P0WhT1WcQ-Koj/images/agents-and-plans/nevermined-dashboard-plan.png?fit=max&auto=format&n=816P0WhT1WcQ-Koj&q=85&s=87542222699b2904cd644ad1ab554154" 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/816P0WhT1WcQ-Koj/images/agents-and-plans/nevermined-plan-new.png?fit=max&auto=format&n=816P0WhT1WcQ-Koj&q=85&s=22fa9312cb6794532edea3a1df150ede" 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/816P0WhT1WcQ-Koj/images/agents-and-plans/nevermined-plan-new-2.png?fit=max&auto=format&n=816P0WhT1WcQ-Koj&q=85&s=d3f0667eb41a10e7db6b6c76961ef8d0" 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/816P0WhT1WcQ-Koj/images/agents-and-plans/nevermined-dashboard-agent.png?fit=max&auto=format&n=816P0WhT1WcQ-Koj&q=85&s=b7a1986fb4484e8367cd07fb02393c4f" 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/816P0WhT1WcQ-Koj/images/agents-and-plans/nevermined-agent-new.png?fit=max&auto=format&n=816P0WhT1WcQ-Koj&q=85&s=3c237cbec8bb10554d0d33209511ff1a" 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/816P0WhT1WcQ-Koj/images/agents-and-plans/nevermined-agent-plan.png?fit=max&auto=format&n=816P0WhT1WcQ-Koj&q=85&s=e677b8f415e4a228093d2c34239ef366" 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/816P0WhT1WcQ-Koj/images/buildship/buildship-select-agent.png?fit=max&auto=format&n=816P0WhT1WcQ-Koj&q=85&s=d8a248a7ede6ec46193c389e45b97e39" 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>
