Embed Muapi Tools

Muapi has two separate iframe options: a model embed for one generation model and a Creative Agent embed for a conversational canvas. Each embed is tied to the Muapi account that created it.

Embed a model playground

  1. Open the model's page in the Playground and sign in to your Muapi account.
  2. Select the Embed tab. Muapi creates an embed code for that model.
  3. Copy the iframe snippet and add it to the page where you want the generator to appear.

The embed opens the selected model's generation form. Its current inputs and options follow that model's Playground schema. Generations made through the embed use the account associated with the embed code and deduct credits from that account. Only publish an embed where you are comfortable letting visitors submit generations against your balance.

Embed the Creative Agent

  1. Open Assistant and create an agent embed.
  2. Copy the iframe snippet shown for that embed.
  3. Paste it into your site's HTML where the canvas should appear.

Example:

<iframe
  src="https://muapi.ai/embed/agent/YOUR_EMBED_CODE"
  style="width:100%;height:100%;border:0;"
  allow="clipboard-write"
  allowfullscreen
></iframe>

Set a height on the iframe or its containing element so the canvas has room to display. The Assistant page lists your agent embeds; revoke an embed there when you no longer want it to work.

Restrict an agent embed to selected sites

Agent embeds support an optional allowed-origins list. Set it when creating an agent embed with POST /api/v1/agent-embeds, or update one with PATCH /api/v1/agent-embeds/{embed_id}. Supply hostnames such as example.com. When a list is set, requests from other origins are rejected. An empty list allows use from any origin, so add the sites you control when you need this restriction.

This origin setting applies to Creative Agent embeds. Model playground embed codes use a separate system and do not have this same allowed-origins setting.

Manage and troubleshoot embeds

  • Treat an embed code like a credential: anyone who obtains it may be able to use the associated tool and incur usage on its owner's account.
  • If an iframe is blank or says the embed is unavailable, verify that the code is complete and that the model or agent is still available.
  • If an agent embed is restricted, check the browser page's hostname against its allowed-origins list.
  • For model embeds, review model parameters and cost on the model's Playground page before publishing.

See Credits, Models, and Creative Canvas.