Developer Tools

Penguin Mod
Extension Docs

Connect your visual programming projects to the power of Zylo AI. Generate text, use tools, create chat bots and more—directly from Penguin Mod blocks!

Introduction

Welcome to the Zylo API Extension documentation for Penguin Mod. This extension allows you to integrate our unified AI platform into your Scratch-like projects easily.

Key features included:

  • Set up personalities for the AI using System Prompts.
  • Easily provide memory to the AI using a message list.
  • Utilize Gemini Vision by sending Base64 images directly inside the blocks.
  • Use tools natively like Google Search inside your projects.

Installation

The Zylo API Extension runs as an unsandboxed custom extension in environments like Penguin Mod.

  1. Open your editor (e.g. Penguin Mod Editor).
  2. Click the "Add Extension" button in the bottom left corner.
  3. Select "Custom Extension".
  4. Choose File or Text and import your ZyloAPI.js file.
  5. Accept any warnings about running unsandboxed extensions (required for API Network Requests).

Authentication & Basics

1. Set your API Key

Before doing anything, you must set your Zylo API key obtained from the Console.

set Zylo API Key to [zk_...]

2. Choose Endpoint

Select whether to use the native /generate endpoint or openai.

set Endpoint to [generate | openai]

3. Validate Key

A boolean block that pings the server to verify if your key is currently active and has credits.

< is API Key valid? >

Building the Prompt

ZyloAPI uses a modular message system. You build your conversation history piece by piece before sending it to the AI.

1. Set System Prompt
Define the AI's personality or rules. You only need to set this once.
set System Prompt [You are a helpful pirate.]

2. Add User Message
Add the user's text question to the memory array.
add User text message [What is the capital of France?]

3. Add Image (Vision)
Provide a Base64 image to models that support vision (like Gemini models).
add User image (Base64) [data:image/png;base64,...]

4. Clear Messages
Clear the conversation history when starting a fresh chat.
clear all User Messages

Advanced Features

Tweaking the Output

Adjust internal parameters to change AI behavior.

set Temperature to [0.7] Controls randomness (0 to 1)
set Max Tokens to [4096] Maximum response length

Zylo Tools

Enable the AI to perform external actions.

add Tool [Google Search] Allows Gemini to search the web in real-time.
clear all Tools Removes tools from the upcoming request.

Get the Response!

Once you've set your Key, built your messages, and set any optional tools/parameters, use the final Reporter block to fetch the AI's response asynchronously.

( generate response with model [gemini-3] )

Example Workflow

when [Green Flag] clicked
set Zylo API Key to [zk_...]
clear all User Messages
add User text message ["Hello, say a fun fact about space!"]
say (generate response with model [gemini-3-pro]) for [10] secs