Back to the app / API
Tokens llms.txt

Driving H3 Prompt Studio from code

Base URL https://api.skillsafe.ai/v1/app-api. Every response is {"ok": true, "data": {…}} or {"ok": false, "error": {…}}. The app slug is minimax-h3-prompt.

This app writes plans and prompts. It does not generate video, and the API will not pretend otherwise. The one asset it produces is a preview image, through the platform's image model.

The task field comes first

Everything routes on task. It selects one of nine workflows and, for the seven that have two stages, which stage. Send it on every call, including /estimate — the hold differs per task because the prompts and output caps differ. An unrecognised task falls back to h3-prompt:build and the model says so in its Summary.

taskWorkflowStageRequired fieldsOptional fields
routeSuggest a workflowSuggestbrief-
h3-prompt:buildH3 prompt writingWrite the promptbrief, mode, secondsrefs
handdrawn:buildHand-drawn / live-action fusionWrite the promptbriefcontact, language
co-op-intro:planCo-op game intro1. Confirmation imagebrief, stylerefs
co-op-intro:buildCo-op game intro2. Video promptapprovedchanges
product-ad:planMinimalist product ad1. Brief and copybrief, template, copy_modeduration, aspect, copy
product-ad:buildMinimalist product ad2. Anchors and beatsapprovedbeats
brand-promo:planBrand promo video1. Truth sheet and beatsbriefduration, aspect, audience, assets_held
brand-promo:buildBrand promo video2. Production packageapprovedaudio
mv-subtitle:planMusic video with lyric typography1. Pre-flight lockbrieflyrics, duration, aspect, window
mv-subtitle:buildMusic video with lyric typography2. Multi-shot scriptapprovedpreset
paper-collage:planPaper collage explainer1. Gate 1 - planbriefduration, aspect, segments, addons
paper-collage:buildPaper collage explainer2. Stills and clipsapprovedpalette
papercraft:planPapercraft stop-motion explainer1. Design and previewsbrief, deliverableaudience, duration, aspect
papercraft:buildPapercraft stop-motion explainer2. Prompts and storyboardapprovednarration
anim-short:plan3D animated short1. Story and cardsbriefduration, aspect, dialogue, style
anim-short:table3D animated short2. Shot tableapprovedshots
anim-short:build3D animated short3. Boards and assemblyapprovedboards

Two fields you always send

task selects the contract. rules carries the working rules for that one stage, which the app keeps in h3rules.js rather than in the system prompt — so a run pays for the rules of the stage it is running and no others. Fetch that file, read H3Rules.forTask(task), and pass the string through.

Two optional fields are JSON-encoded strings rather than objects, because input-schema field types are scalar-only: prescan (what the client-side validator or workflow scorer already found, which the model is required to respond to) and clipped (a list of fields that were trimmed before the model saw them).

Choosing the model

Pass $model with any id from GET https://api.skillsafe.ai/v1/models, which is public and needs no token. Drop anything reporting available: false. Text models write packages; the image model renders previews and takes a body of exactly {"instruction", "$model"} — every extra key is concatenated into the text the image model sees. Omit $model and the run uses the app's configured model, gpt-terra.

Errors

error.codeHTTPWhat it means
validation_error400The body is not an object, or a field is the wrong type. With an input schema declared, warnings[] names the offending field. The {"input": {...}} wrapper lands here.
unauthorized401Missing or expired token. Mint a guest token, or sign in for a personal one.
forbidden403A guest token tried to run. Runs need a signed-in subject.
not_found404Unknown job id, or a file id minted under a different subject.
insufficient_credits402Balance is below min_credits. Compare against hold_credits before you submit, not after.
rate_limited429Back off. Similarity search is 30/min per IP; the other endpoints are more generous.
internal500The model run failed. Failed runs are not billed.

Step by step

1. A tiny client

Every call goes to the app API with a Bearer token and a JSON body. The envelope is always {"ok": true, "data": {...}} or {"ok": false, "error": {"code", "message", "status", "details"}}.

2. Get a token

A guest token is minted per app and is enough for /me and /estimate. Writing a package is metered and needs a personal token: the token page shows yours and copies a shell export, so you never have to open the developer console.

3. Check the session

/me returns only three fields: subject_type, subject_id and credits. Signed in means subject_type === "user".

4. Estimate, free

/estimate creates no job and costs nothing. It reports the hold, the resolved model and the markup, and validates the body.

5. Run and poll

/run returns a job_id immediately. Poll /jobs/{id} until the status is terminal.

6. Or stream it

/run-stream sends server-sent events. The delta frame carries text, not an object — accumulating frame.text is what gets you the output as it arrives.

Every task contract

The output is Markdown whose ## headings are fixed per task, in order. Parse by heading; a missing heading is a section that did not arrive, which is worth surfacing rather than silently dropping.

route — Suggest a workflow, Suggest

A ranked recommendation of which of the nine workflows fits your request. Source skill: .

Minimal body

{
  "task": "route",
  "rules": "<rules for this stage>",
  "brief": "<your brief>",
  "$model": "gpt-5.6-terra"
}

Output sections, in this order

  1. ## Summary
  2. ## Recommended Workflow
  3. ## Why This One
  4. ## Runners Up
  5. ## Out Of Scope
  6. ## Prefilled Brief
  7. ## Next Step
h3-prompt:build — H3 prompt writing, Write the prompt

A MiniMax H3 prompt in the exact published structure, for any of the five generation modes. Source skill: h3-prompt-writing.

Minimal body

{
  "task": "h3-prompt:build",
  "rules": "<rules for this stage>",
  "brief": "<your brief>",
  "mode": "<your mode>",
  "seconds": 8,
  "$model": "gpt-5.6-terra"
}

Output sections, in this order

  1. ## Summary
  2. ## Mode
  3. ## H3 Prompt
  4. ## Field Check
  5. ## Reconciliation
  6. ## Next Step
handdrawn:build — Hand-drawn / live-action fusion, Write the prompt

A reusable 15-second 16:9 prompt for glowing hand-drawn animation touching a real space. Source skill: handdrawn-live-video-generator.

Minimal body

{
  "task": "handdrawn:build",
  "rules": "<rules for this stage>",
  "brief": "<your brief>",
  "$model": "gpt-5.6-terra"
}

Output sections, in this order

  1. ## Summary
  2. ## Video Prompt
  3. ## Paragraph Order Check
  4. ## Invention Log
  5. ## Recommendation
  6. ## Next Step
co-op-intro:plan — Co-op game intro, 1. Confirmation image

A confirmation-image prompt, then the H3 video prompt built from the image you approved. Source skill: co-op-game-intro-generator.

Minimal body

{
  "task": "co-op-intro:plan",
  "rules": "<rules for this stage>",
  "brief": "<your brief>",
  "style": "<your style>",
  "$model": "gpt-5.6-terra"
}

Output sections, in this order

  1. ## Summary
  2. ## Style Lock
  3. ## Player And Game Data
  4. ## Identity Anchors
  5. ## Confirmation Image Prompt
  6. ## Template Field Check
  7. ## Next Step
co-op-intro:build — Co-op game intro, 2. Video prompt

A confirmation-image prompt, then the H3 video prompt built from the image you approved. Source skill: co-op-game-intro-generator.

Minimal body

{
  "task": "co-op-intro:build",
  "rules": "<rules for this stage>",
  "approved": "<your approved>",
  "$model": "gpt-5.6-terra"
}

Output sections, in this order

  1. ## Summary
  2. ## Approved Image Recap
  3. ## Video Prompt
  4. ## UI Copy And Event Timing
  5. ## Negative Constraints
  6. ## Failure Repairs
  7. ## Next Step
product-ad:plan — Minimalist product ad, 1. Brief and copy

An Apple-style product film plan: fact summary, spine, copy, anchor photos and a beat storyboard. Source skill: minimalist-product-ad-generator.

Minimal body

{
  "task": "product-ad:plan",
  "rules": "<rules for this stage>",
  "brief": "<your brief>",
  "template": "<your template>",
  "copy_mode": "<your copy_mode>",
  "$model": "gpt-5.6-terra"
}

Output sections, in this order

  1. ## Summary
  2. ## Start Gate Result
  3. ## Product Fact Summary
  4. ## Production Brief
  5. ## Narrative Spine
  6. ## Motion Language
  7. ## Copy Options
  8. ## Next Step
product-ad:build — Minimalist product ad, 2. Anchors and beats

An Apple-style product film plan: fact summary, spine, copy, anchor photos and a beat storyboard. Source skill: minimalist-product-ad-generator.

Minimal body

{
  "task": "product-ad:build",
  "rules": "<rules for this stage>",
  "approved": "<your approved>",
  "$model": "gpt-5.6-terra"
}

Output sections, in this order

  1. ## Summary
  2. ## Anchor Photo Prompts
  3. ## User Choice Statement
  4. ## Beat Content Table
  5. ## Principles Check
  6. ## Video Prompt
  7. ## BGM Direction
  8. ## Delivery Verification
  9. ## Next Step
brand-promo:plan — Brand promo video, 1. Truth sheet and beats

A verified brand truth sheet, a provenance manifest and a frame-aware beat plan. Source skill: brand-promo-video-generator.

Minimal body

{
  "task": "brand-promo:plan",
  "rules": "<rules for this stage>",
  "brief": "<your brief>",
  "$model": "gpt-5.6-terra"
}

Output sections, in this order

  1. ## Summary
  2. ## Intake And Brief
  3. ## Brand Truth Sheet
  4. ## Provenance Manifest
  5. ## Story Spine Options
  6. ## Beat Plan
  7. ## Motion Language
  8. ## Caveats
  9. ## Next Step
brand-promo:build — Brand promo video, 2. Production package

A verified brand truth sheet, a provenance manifest and a frame-aware beat plan. Source skill: brand-promo-video-generator.

Minimal body

{
  "task": "brand-promo:build",
  "rules": "<rules for this stage>",
  "approved": "<your approved>",
  "$model": "gpt-5.6-terra"
}

Output sections, in this order

  1. ## Summary
  2. ## Production Dispatches
  3. ## Shot Prompts
  4. ## Audio Plan
  5. ## Pre-Delivery Checks
  6. ## Delivery Package
  7. ## Failure Recovery
  8. ## Next Step
mv-subtitle:plan — Music video with lyric typography, 1. Pre-flight lock

A pre-flight lock, locked lyrics, and a modular multi-shot MV script with beat-reactive text. Source skill: music-video-subtitle-generator.

Minimal body

{
  "task": "mv-subtitle:plan",
  "rules": "<rules for this stage>",
  "brief": "<your brief>",
  "$model": "gpt-5.6-terra"
}

Output sections, in this order

  1. ## Summary
  2. ## Pre-flight Lock
  3. ## Locked Lyrics
  4. ## Creative Contract
  5. ## Reference Roles
  6. ## Shotlist Timeline
  7. ## Next Step
mv-subtitle:build — Music video with lyric typography, 2. Multi-shot script

A pre-flight lock, locked lyrics, and a modular multi-shot MV script with beat-reactive text. Source skill: music-video-subtitle-generator.

Minimal body

{
  "task": "mv-subtitle:build",
  "rules": "<rules for this stage>",
  "approved": "<your approved>",
  "$model": "gpt-5.6-terra"
}

Output sections, in this order

  1. ## Summary
  2. ## Global Aesthetic And Character Lock
  3. ## Multi-Shot Script
  4. ## Typography Plan
  5. ## Stitching Protocol
  6. ## Checklist
  7. ## Next Step
paper-collage:plan — Paper collage explainer, 1. Gate 1 - plan

A production plan, still-frame specs and stop-motion assembly prompts in halftone collage language. Source skill: paper-collage-explainer-generator.

Minimal body

{
  "task": "paper-collage:plan",
  "rules": "<rules for this stage>",
  "brief": "<your brief>",
  "$model": "gpt-5.6-terra"
}

Output sections, in this order

  1. ## Summary
  2. ## Brief
  3. ## Visual Metaphors
  4. ## Script Or Visual Beat Track
  5. ## Storyboard
  6. ## Media Approach
  7. ## Next Step
paper-collage:build — Paper collage explainer, 2. Stills and clips

A production plan, still-frame specs and stop-motion assembly prompts in halftone collage language. Source skill: paper-collage-explainer-generator.

Minimal body

{
  "task": "paper-collage:build",
  "rules": "<rules for this stage>",
  "approved": "<your approved>",
  "$model": "gpt-5.6-terra"
}

Output sections, in this order

  1. ## Summary
  2. ## Still Frame Specifications
  3. ## Still Image Prompts
  4. ## Stop-Motion Assembly Plan
  5. ## Video Prompts
  6. ## Quality Review
  7. ## Assembly And Delivery
  8. ## Next Step
papercraft:plan — Papercraft stop-motion explainer, 1. Design and previews

A production-ready papercraft package: style DNA, characters, diorama staging, prompts and storyboard. Source skill: papercraft-stop-motion-explainer.

Minimal body

{
  "task": "papercraft:plan",
  "rules": "<rules for this stage>",
  "brief": "<your brief>",
  "deliverable": "<your deliverable>",
  "$model": "gpt-5.6-terra"
}

Output sections, in this order

  1. ## Summary
  2. ## Understanding Block
  3. ## Style DNA
  4. ## Creative Directions
  5. ## Paper Characters
  6. ## Paper Scenes
  7. ## Layered Diorama Staging
  8. ## Prop And Asset Library
  9. ## Preview Image Prompts
  10. ## Next Step
papercraft:build — Papercraft stop-motion explainer, 2. Prompts and storyboard

A production-ready papercraft package: style DNA, characters, diorama staging, prompts and storyboard. Source skill: papercraft-stop-motion-explainer.

Minimal body

{
  "task": "papercraft:build",
  "rules": "<rules for this stage>",
  "approved": "<your approved>",
  "$model": "gpt-5.6-terra"
}

Output sections, in this order

  1. ## Summary
  2. ## Single Image Prompt
  3. ## Image Series Prompts
  4. ## Image To Video Prompt
  5. ## Storyboard
  6. ## Editing Rhythm
  7. ## Camera Rules
  8. ## Transitions
  9. ## Sound Design
  10. ## Negative Prompts
  11. ## Review Checklist
  12. ## Next Step
anim-short:plan — 3D animated short, 1. Story and cards

A brief, story outline, character and scene cards, then the six-column shot table and storyboard. Source skill: 3d-animation-short-generator.

Minimal body

{
  "task": "anim-short:plan",
  "rules": "<rules for this stage>",
  "brief": "<your brief>",
  "$model": "gpt-5.6-terra"
}

Output sections, in this order

  1. ## Summary
  2. ## Project Brief
  3. ## Story Outline
  4. ## Gate Checks
  5. ## Character Cards
  6. ## Scene Cards
  7. ## Next Step
anim-short:table — 3D animated short, 2. Shot table

A brief, story outline, character and scene cards, then the six-column shot table and storyboard. Source skill: 3d-animation-short-generator.

Minimal body

{
  "task": "anim-short:table",
  "rules": "<rules for this stage>",
  "approved": "<your approved>",
  "$model": "gpt-5.6-terra"
}

Output sections, in this order

  1. ## Summary
  2. ## Standard Shot Table
  3. ## Shot Table Self-Check
  4. ## Next Step
anim-short:build — 3D animated short, 3. Boards and assembly

A brief, story outline, character and scene cards, then the six-column shot table and storyboard. Source skill: 3d-animation-short-generator.

Minimal body

{
  "task": "anim-short:build",
  "rules": "<rules for this stage>",
  "approved": "<your approved>",
  "$model": "gpt-5.6-terra"
}

Output sections, in this order

  1. ## Summary
  2. ## Text Storyboards
  3. ## Model Selection
  4. ## Fallback Ladders
  5. ## Assembly And BGM
  6. ## Final Review
  7. ## Next Step

The H3 prompt structure

The h3-prompt:build task emits a prompt in one fenced text block. Base modes give a mode-specific alignment line, a blank line, then integrated_multimodal_description, overall_soundscape and non_diegetic_music. Ref2VA gives subject_definitions, summary, retention_analysis, detailed_description, overall_soundscape and non_diegetic_music.

The same validator the page runs is in h3lint.js and works standalone: H3Lint.check(text, {mode, seconds, declaredRefs}) returns {ok, findings, shots, speakers, labels, motions}. It needs no token and makes no network call, so it is worth running over anything you generate before you send it to H3.