Write GitHub Actions workflows that call Wiro AI with the Wiro AI Action (wiroai/Wiro-Action@v1). It runs any of 1,000+ models for images, video, audio and 3D, runs a saved Wiro AI workflow, or asks an LLM through the Wiro AI gateway, and returns URLs, files, text and the cost for later steps. Covers the inputs and outputs, the WIRO_API_KEY secret, the price estimate and the max-cost limit, and ready workflows for an image, a pull request summary, release media and a workflow run. Use when the user wants AI images, video, audio, text or reviews in GitHub Actions, mentions wiroai/Wiro-Action or a WIRO_API_KEY secret, or wants to run Wiro AI from CI.
---
name: wiro-github-action
description: Write GitHub Actions workflows that call Wiro AI with the Wiro AI Action (wiroai/Wiro-Action@v1). It runs any of 1,000+ models for images, video, audio and 3D, runs a saved Wiro AI workflow, or asks an LLM through the Wiro AI gateway, and returns URLs, files, text and the cost for later steps. Covers the inputs and outputs, the WIRO_API_KEY secret, the price estimate and the max-cost limit, and ready workflows for an image, a pull request summary, release media and a workflow run. Use when the user wants AI images, video, audio, text or reviews in GitHub Actions, mentions wiroai/Wiro-Action or a WIRO_API_KEY secret, or wants to run Wiro AI from CI.
---
# Wiro AI Action for GitHub workflows
`wiroai/Wiro-Action` is a JavaScript action (Node.js 24) that calls Wiro AI from one workflow step and waits for the result. Use `wiroai/Wiro-Action@v1`, which follows the latest 1.x release. It has three modes:
- **model** runs one of the 1,000+ models at https://wiro.ai/models (image, video, audio, 3D, LLM and more), waits for the task and returns the output URLs, the text and the cost. It uploads workspace files as inputs and downloads the outputs.
- **workflow** runs one of the user's saved Wiro AI workflows (https://wiro.ai/workflows) with the inputs you give it and returns what its End node shows.
- **llm** sends one prompt, with files if needed, to the Wiro AI LLM gateway and returns the answer.
For Wiro AI outside GitHub Actions, use the wiro-ai skill (task API and MCP) or the wiro-llm skill (LLM gateway).
## Key and secret
- Read the key from a repository secret: `api-key: ${{ secrets.WIRO_API_KEY }}`. A project that uses signature authentication also needs `api-secret: ${{ secrets.WIRO_API_SECRET }}`.
- If the repository has no `WIRO_API_KEY` secret yet, ask the user to create a project at https://wiro.ai/panel/project/new and add its key under **Settings → Secrets and variables → Actions** themselves. Never ask for the key in the chat, and never write it into a workflow file, a commit or a log.
- The action masks the key in the logs and needs no GitHub token. Give the job only what its other steps need, such as `pull-requests: write` to comment or `contents: write` to upload release assets.
- Workflows started by pull requests from forks, or by Dependabot, don't receive repository secrets. Skip them with a job condition, as the pull request example below does.
## Write the step
- `mode`: leave it out for model mode, or when `workflow` is set. Set `mode: llm` for the LLM gateway.
- `model` (model and llm modes): the exact ID, `owner/model`, from the model's page on wiro.ai, such as `pruna/p-image`, `pruna/p-video-2` or `openai/gpt-5-4-mini`. The page also lists the model's parameters and its price. The LLMs for llm mode are at https://wiro.ai/models?categories=llm-tool-call.
- `workflow` (workflow mode): the workflow's link on wiro.ai, or its full slug, such as `product-ad-a1B2c`.
- `prompt`: in llm mode, the message (required). In model and workflow modes, it fills the `prompt` parameter or input.
- `system` (llm mode): the system prompt.
- `params`: a YAML or JSON mapping. In model mode, the model's parameters by their IDs on the model page, with values as the page shows them, such as `duration: "5"`. In workflow mode, the inputs by the names the Start node shows. In llm mode, extra Chat Completions fields such as `max_tokens`, `reasoning_effort` or `response_format`. A required model parameter you leave out gets the default the model's form starts with; file inputs and the prompt are never filled in.
- Free text from a person, an issue or a pull request goes into `params` through `toJSON()`, such as `brief: ${{ toJSON(inputs.brief) }}`, so quotes, colons and line breaks can't break the YAML.
- `files`: in model and workflow modes, a mapping from a file parameter or input to a workspace path, list or glob, such as `inputImage: assets/photo.png`. The action uploads each file in the form the parameter expects; a public URL in `params` works too. In llm mode, paths or globs, one per line: text files are added as text, and PNG, JPEG, GIF, WebP and PDF files go to models that read them.
- `download: true` saves the output files in `download-dir` (`wiro-output` by default).
- `timeout`: seconds to wait, 600 by default; give video models 900 or more. In model mode, the action stops the task when the timeout runs out or the workflow run is cancelled (`cancel-on-timeout`, on by default). In workflow mode, it stops waiting and fails, while the run goes on and shows its results on wiro.ai when it ends, so give long workflows a generous `timeout`.
- `summary` (on by default) writes the result, with images and answers, to the job summary.
## Use the results
Give the step an `id` and read `steps.<id>.outputs.<name>`:
- `url` is the URL of the first output file, and `urls` is a JSON array of all of them.
- `files` is a JSON array of the downloaded paths, relative to the workspace.
- `text` is the answer in llm mode. In model mode it is an LLM's answer, or the text file a model returns, such as a transcript. In workflow mode it holds the text results.
- `outputs` is JSON: in model mode, the task's outputs (`name`, `contenttype`, `size`, `url`, and `content` for LLMs); in workflow mode, an object with each End node result by name.
- `cost` is the amount billed, in USD. `estimated-cost` is the price estimated before the run: empty when it isn't known in advance, and an upper estimate in llm mode.
- `task-id` (model mode), `run-token` (workflow mode, masked in the logs) and `response` (llm mode, the full Chat Completions response) are there for follow-up work.
Read JSON outputs with `fromJSON()` in expressions, such as `fromJSON(steps.image.outputs.urls)[0]`, or with `jq` in a script. Model output is untrusted text: pass it to scripts through `env:`, and never write `${{ steps.<id>.outputs.text }}` inside a `run:` script.
## Price and max-cost
- Before every run, the action logs `Estimated cost: $...` and sets `estimated-cost`. In model mode it is the model's price for the settings sent, defaults included. In workflow mode it is the sum over the steps that lead to the End node, plus the creator's fee of a priced gallery workflow. In llm mode it is an upper estimate from the prices per token, with the output counted from `max_tokens` or from the model's output limit.
- `max-cost`, in USD, such as `max-cost: '0.50'`, keeps a run from starting when its estimate is higher, or when its price is only known after it ends, such as a model billed by run time. LLM token use inside a model or workflow run is billed when the run ends, so the estimate leaves it out and the log says so.
- Set `max-cost` on every step of an automated workflow, a little above the expected price. In model mode, only a successful run is billed.
- Match the trigger to the price: a priced video step fits `release`, `workflow_dispatch` or a schedule better than every push.
- Run a new workflow once with `workflow_dispatch` and read the `Estimated cost` and `cost` lines in its log.
## Examples
Each one is a complete file for `.github/workflows/`, and each ran on GitHub Actions as written; the last one ran with a real workflow link in place of the example link. Change the models, prompts and limits to fit the task.
### Generate an image by hand and keep it as an artifact
```yaml
name: Generate an image
on:
workflow_dispatch:
inputs:
prompt:
description: What the image shows
required: true
default: A small paper boat on a calm lake at sunrise, soft light
jobs:
image:
runs-on: ubuntu-latest
steps:
- uses: wiroai/Wiro-Action@v1
id: image
with:
api-key: ${{ secrets.WIRO_API_KEY }}
model: pruna/p-image
prompt: ${{ inputs.prompt }}
params: |
aspectRatio: "16:9"
max-cost: '0.02'
download: true
- uses: actions/upload-artifact@v7
with:
name: image
path: wiro-output/
- name: Show the URL and the cost
env:
URL: ${{ steps.image.outputs.url }}
COST: ${{ steps.image.outputs.cost }}
run: |
echo "URL: $URL"
echo "Cost: $COST USD"
```
### Summarize a pull request
```yaml
name: Pull request summary
on:
pull_request:
types: [opened, ready_for_review]
permissions:
contents: read
pull-requests: write
jobs:
summary:
# Pull requests from forks and from Dependabot don't receive repository secrets.
if: github.event.pull_request.head.repo.full_name == github.repository && github.actor != 'dependabot[bot]'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
with:
fetch-depth: 0
- name: Save the diff
env:
BASE: ${{ github.event.pull_request.base.sha }}
run: git diff "$BASE" HEAD -- . ':!package-lock.json' > pr.diff
- uses: wiroai/Wiro-Action@v1
id: summary
with:
mode: llm
api-key: ${{ secrets.WIRO_API_KEY }}
model: openai/gpt-5-4-mini
system: You write short, factual pull request summaries for reviewers.
prompt: >-
Summarize this pull request in at most five bullet points.
Then list anything a reviewer should look at closely.
files: pr.diff
params: |
reasoning_effort: low
- name: Comment on the pull request
env:
GH_TOKEN: ${{ github.token }}
PR: ${{ github.event.pull_request.number }}
SUMMARY: ${{ steps.summary.outputs.text }}
run: printf '%s\n' "$SUMMARY" | gh pr comment "$PR" --repo "$GITHUB_REPOSITORY" --body-file -
```
### Make a release banner, then a short video of it
The second step passes the banner's URL to a video model, and `max-cost` keeps it from starting if the price is above $0.20.
```yaml
name: Release media
on:
release:
types: [published]
permissions:
contents: write
jobs:
media:
runs-on: ubuntu-latest
steps:
- uses: wiroai/Wiro-Action@v1
id: banner
with:
api-key: ${{ secrets.WIRO_API_KEY }}
model: pruna/p-image
prompt: >-
A clean, wide banner for a software release named
"${{ github.event.release.name }}", abstract shapes, soft light
params: |
aspectRatio: "16:9"
download: true
download-dir: media
- uses: wiroai/Wiro-Action@v1
id: video
with:
api-key: ${{ secrets.WIRO_API_KEY }}
model: pruna/p-video-2
prompt: Slow camera push in, the shapes drift and the light shifts gently
params: |
inputImage: ${{ steps.banner.outputs.url }}
duration: "5"
resolution: 720p
max-cost: '0.20'
timeout: 900
download: true
download-dir: media
- name: Attach the banner and the video to the release
env:
GH_TOKEN: ${{ github.token }}
TAG: ${{ github.event.release.tag_name }}
BANNER: ${{ steps.banner.outputs.files }}
VIDEO: ${{ steps.video.outputs.files }}
run: |
cp "$(jq -r '.[0]' <<< "$BANNER")" release-banner.jpg
cp "$(jq -r '.[0]' <<< "$VIDEO")" release-video.mp4
gh release upload "$TAG" release-banner.jpg release-video.mp4 --repo "$GITHUB_REPOSITORY"
```
### Run a saved workflow
Replace the link with the user's workflow, and the input names with the ones its Start node shows.
```yaml
name: Product shot
on:
workflow_dispatch:
inputs:
subject:
description: What to photograph
default: a ceramic coffee mug
jobs:
shot:
runs-on: ubuntu-latest
steps:
- uses: wiroai/Wiro-Action@v1
with:
api-key: ${{ secrets.WIRO_API_KEY }}
workflow: https://wiro.ai/workflows/product-shot-a1B2c
params: |
subject: ${{ toJSON(inputs.subject) }}
max-cost: '0.05'
timeout: 1800
download: true
- uses: actions/upload-artifact@v7
with:
name: product-shot
path: wiro-output/
```
## Before you hand over the workflow
- `api-key` comes from a secret, and no step prints it.
- `model` is an exact `owner/model` ID, and each `params` key is a parameter ID from its page, or a Start input name in workflow mode.
- `max-cost` is set, and `timeout` fits the model.
- Steps whose outputs are read have an `id`. JSON outputs go through `fromJSON()` or `jq`, and text reaches scripts only through `env:`.
- Jobs started by pull requests skip forks and Dependabot, and the permissions are the least the steps need.
don't have the plugin yet? install it then click "run inline in claude" again.
extracted implicit decision logic into a dedicated section, added edge cases like fork prs and dependabot blocking, rate limits, auth expiry, and empty results, documented all external connections and env vars, made output format explicit with json examples, and added outcome signals for each mode.
use wiroai/Wiro-Action@v1 to call wiro ai from a github actions workflow step and wait for the result. the action runs one of 1,000+ models at https://wiro.ai/models (image, video, audio, 3d, llm), executes a saved wiro ai workflow with custom inputs, or sends a prompt to the wiro ai llm gateway. it returns output urls, files, text, and the cost billed. use this skill when a user wants ai-generated images, video, audio, text summaries, or code reviews in ci/cd, or mentions wiroai/Wiro-Action or a WIRO_API_KEY secret.
wiro ai credentials
api-key: read from a repository secret ${{ secrets.WIRO_API_KEY }}. required. create a project at https://wiro.ai/panel/project/new and copy the key to Settings → Secrets and variables → Actions.api-secret: read from ${{ secrets.WIRO_API_SECRET }} only if the project uses signature authentication. optional.action mode and configuration
mode: omit for model mode (default), or set to llm for the wiro ai llm gateway. for workflow mode, leave this out and set workflow instead.model: the exact owner/model ID from https://wiro.ai/models, such as pruna/p-image, pruna/p-video-2, or openai/gpt-5-4-mini. required for model and llm modes.workflow: the workflow's full slug or link on wiro.ai, such as product-ad-a1B2c or https://wiro.ai/workflows/product-ad-a1B2c. required for workflow mode.prompt: the input message (required in llm mode). in model and workflow modes, fills the prompt parameter or input field.system: the system prompt for llm mode (optional).params: yaml or json mapping. in model mode, the model's parameter ids with values as shown on the model page (e.g., duration: "5"). in workflow mode, the input names the start node shows. in llm mode, chat completions fields like max_tokens or reasoning_effort. omitted required parameters get model defaults.files: in model and workflow modes, a yaml mapping from file parameter or input name to workspace path, list, or glob (e.g., inputImage: assets/photo.png). in llm mode, paths or globs one per line; text files are added as text, png/jpeg/gif/webp/pdf go to models that read them. public urls in params work too.download: true: saves output files to the workspace in download-dir (default: wiro-output).download-dir: output directory for downloaded files (default: wiro-output).timeout: seconds to wait for the task (default: 600). use 900+ for video models. in model mode, the action cancels the task on timeout or workflow cancellation if cancel-on-timeout: true (default). in workflow mode, stops waiting and fails while the run continues on wiro.ai.max-cost: usd limit, e.g., '0.50'. prevents the step from starting if the estimated cost exceeds this, or if the price is only known after run completion (e.g., time-billed models).summary: false: disable writing the result to the job summary (enabled by default).github context and permissions
github.event.pull_request.head.repo.full_name: check this against github.repository to block fork prs from using repository secrets.github.actor: check this to block dependabot prs.contents: read or write: for pulling code or uploading release assets.pull-requests: write: for commenting on prs.external urls and public files
files are uploaded as-is; public urls in params bypass file upload.WIRO_API_KEY. never ask the user for the key in chat and never write it into a workflow file or commit..github/workflows/ yaml file. add a job with runs-on: ubuntu-latest.wiroai/Wiro-Action@v1. set api-key: ${{ secrets.WIRO_API_KEY }} and give the step an id for reading outputs later.model to an exact owner/model id, prompt to the input text, and params for model-specific settings (see model page for parameter ids and values).workflow to the slug or link, params for start node input names, prompt to fill the prompt input if the start node has one.mode: llm, model to an llm id (e.g., openai/gpt-5-4-mini), prompt required, optionally system for the system prompt, and params for chat completions fields.files to workspace paths or globs. for llm mode, list file paths directly. for model and workflow modes, use yaml key-value syntax (e.g., inputImage: photo.png).max-cost to a usd amount slightly above the expected price to prevent cost overruns. check the action's log output "Estimated cost: $..." to calibrate this on a test run with workflow_dispatch.timeout in seconds. use 600 (default) for most models, 900+ for video, and 1800+ for long workflows. set cancel-on-timeout: true (model mode default) to stop the task on timeout.download: true and optionally download-dir: <dirname> to save output files to the workspace for later steps (e.g., artifact upload).summary: false if you don't want the result written to the job summary.steps.<id>.outputs.<name> using expressions or jq. use fromJSON() for json arrays/objects (e.g., fromJSON(steps.image.outputs.urls)[0]).text field), pass them to scripts only via env: variables. never embed ${{ steps.<id>.outputs.text }} directly in a run: script.if: github.event.pull_request.head.repo.full_name == github.repository && github.actor != 'dependabot[bot]' to skip the step when secrets are unavailable.permissions: on the job (e.g., contents: read, pull-requests: write) to match what the workflow steps actually need.workflow_dispatch).if the repository has no WIRO_API_KEY secret yet: ask the user to create a project at https://wiro.ai/panel/project/new and add the key under Settings → Secrets and variables → Actions. do not ask the user to paste the key in chat and do not write it into the workflow file.
if the step runs on a pull request from a fork or from dependabot: the job does not receive repository secrets. add a job condition if: github.event.pull_request.head.repo.full_name == github.repository && github.actor != 'dependabot[bot]' to skip the step, or the step will fail on missing api-key.
if the user does not know the exact model owner/model id: look it up on https://wiro.ai/models. each model's page lists its id, parameters, parameter ids, default values, and prices.
if the user has a saved workflow on wiro.ai: use workflow mode instead of model mode. set workflow to the slug or link, and read the input names from the start node on that workflow's page.
if the user is in llm mode and the model output is untrusted text: do not write ${{ steps.<id>.outputs.text }} directly into a run: script. pass it through env: to a shell script or use jq to process json outputs safely.
if the estimated cost is higher than expected: the action logs "Estimated cost: $..." before running. set max-cost to block runs above a threshold. in model mode, only successful runs are billed, so a failed run incurs no cost. in llm mode, the estimate is an upper bound based on max_tokens or the model's output limit.
if the model is billed by run time and the actual cost is only known after completion: set max-cost anyway; the action will fail the step after the run ends if the final price exceeds the limit.
if the timeout expires: in model mode, the action cancels the task (if cancel-on-timeout: true, the default) and the step fails. in workflow mode, the action stops waiting and fails, but the run continues on wiro.ai and shows results when it finishes.
if the user wants to use a file parameter but only has a public url: set the url directly in params instead of uploading a file. the model will fetch it.
if the user is using json from a previous step or user input: pass free text through toJSON() in the expression (e.g., brief: ${{ toJSON(inputs.brief) }}) to avoid yaml syntax errors from quotes, colons, or line breaks.
if the step outputs contain json arrays (urls, files, outputs): use fromJSON() in the expression (e.g., fromJSON(steps.image.outputs.urls)[0]) or pipe to jq in a script to extract fields.
if the action needs to mask the api key in logs: the action automatically masks api-key and api-secret values. do not set any additional log masking.
if the job runs on a schedule or workflow_dispatch trigger and uses a priced model: set max-cost to match the expected spend and test the workflow once to log the actual Estimated cost and cost lines. adjust max-cost based on the test run.
on success, the action sets these outputs (read with steps.<id>.outputs.<name>):
url: the url of the first output file (string).urls: all output file urls (json array of strings, e.g., ["https://...", "https://..."]).files: downloaded file paths relative to the workspace root (json array of strings, e.g., ["wiro-output/image.png"]). only set if download: true.text: the answer in llm mode; in model mode, an llm's answer or the text file a model returns (e.g., transcript); in workflow mode, text results from the end node (string or empty).outputs: json object. in model mode, task outputs with keys name, contenttype, size, url, and content (for llms). in workflow mode, an object with each end node result by name (object).cost: usd amount billed (string, e.g., "0.0123").estimated-cost: usd cost estimated before the run. empty if not known in advance. in llm mode, an upper estimate based on token counts (string or empty).task-id: wiro ai task id for follow-up work (model mode only, string).run-token: wiro ai workflow run token, masked in logs, for follow-up work (workflow mode only, string).response: full openai chat completions response json (llm mode only, object).output files are saved to download-dir (default: wiro-output) when download: true. paths are relative to the workspace root. file types (image, video, audio, text, pdf, etc.) match the model's output format.
the job summary (displayed on the workflow run page) includes the result, images, and text if summary: true (default).
on failure, the step fails and logs the error. the action logs "Estimated cost: $..." before attempting the run. if max-cost is set and the estimate exceeds it, the step fails without starting the task.
Cost: $... at the end.task-id in outputs.run-token in outputs.response in outputs.download-dir if download: true.steps.<id>.outputs.<name> without errors.max-cost is set and the step does not start, the logs show "Estimated cost: $X exceeds max-cost: $Y".