Skip to main content
feedback

N8N

n8n is a powerful open-source low-code workflow automation tool.
It provides an intuitive visual interface that lets you connect various applications and services simply by dragging and dropping “nodes,” like building a flowchart — allowing you to create powerful automated workflows.
Whether you are a developer or a business user, n8n is easy to use.

The Serverless API supports invocation within N8N, following these steps:

Obtain Access Token

  1. Log in to the MoArk official website and complete account registration (log in directly if you already have an account).
  2. Go to the Workbench, click the top-right Settings, and select Access Tokens.
  3. Generate and copy your dedicated access token for later use.

Integrate MoArk Models into N8N

MoArk’s API is compatible with OpenAI’s SDK, meaning you can access MoArk models using the built-in OpenAI Chat Model node in N8N.

OpenAI Chat Model Node

Configure the MoArk model endpoint and access token through the OpenAI Chat Model node to quickly enable the model for application development.

tip

This node is used for text-generation models such as DeepSeek-V3 and GLM 4.6.
For image or audio generation models, you can use OpenAI’s Generate audio, Generate an image, or HTTP Request nodes.

  1. Open and log in to N8N, then create or enter a Workflow.

    Access the Workflow in N8N

  2. Add a new node: OpenAI Chat Model.

    Select the OpenAI Chat Model node

  3. Enter the node and click Create new credential to create a new API provider.

    • API KEY: Enter the access token copied earlier.
    • Base URL: Enter MoArk’s model endpoint: https://api.moark.ai/v1/.

    Add MoArk token and model endpoint

  4. Choose the desired model.

    Model selection display

  5. Exit the node and go to the Chat panel to start interacting — you now have an Agent built on MoArk’s platform.

    Start chatting

OpenAI Generate Audio / Generate Image Nodes

To use MoArk’s image or audio generation models, call them via OpenAI’s Generate audio or Generate an image nodes.

  1. Search for the OpenAI node, then select the Generate an image node.

    Select OpenAI node

    Select Actions

  2. Enter the node and click Create new credential to create a new API provider.

    • API KEY: Enter the previously copied access token.
    • Base URL: Enter MoArk’s model endpoint https://api.moark.ai/v1/.

    Add MoArk token and model endpoint

  3. Enter the model name to be called.
    For the Model parameter, input MoArk’s model name. Before entering, change the mode from Fixed to Expression.

    Enter model

  4. Enter your Prompt, click Execute step, and call the model.

    Execution example

HTTP Request Node

In addition to OpenAI nodes, you can also call models using the HTTP Request node.

  1. Add a new node: HTTP Request.

    Select HTTP Request node

  2. Configure the request URL and parameters.
    Each model’s request structure may vary slightly — for details, please refer to the API Documentation.

    Example: Image generation model flux-1-schnell

    • Method: POST
    • URL: https://api.moark.ai/v1/images/generations
    • Authentication: Generic Credential Type
    • Generic Auth Type: Bearer Auth
    • Bearer Auth: Click Create new credential and enter your MoArk access token
    • Send Body:
      • Body Content Type: JSON
      • Specify Body: Using JSON
      • JSON Example:
        {
        "prompt": "A robot sitting on the grass painting on a canvas",
        "model": "flux-1-schnell",
        "size": "1024x1024",
        "guidance_scale": 7.5,
        "seed": 42
        }
  3. Click Execute step to invoke the model.

    Execution example

tip

When calling image or audio generation models via HTTP Request, the API returns a base64-encoded result.
You can then add a Convert to File node to convert it into a viewable image or audio file.