Affogato: generate media from an agent
Affogato serves 100+ image, video and audio models (Flux, Seedream, Nano Banana, Kling, Seedance, Veo, Wan, ElevenLabs, …) plus studio tools (lipsync, talking heads, headshots, cast swaps, product shots) behind one API, billed in the credits of the user's Affogato plan.
Two ways in:
- MCP server (
https://api.affogato.ai/mcp): if the host already has the Affogato connector, prefer its tools (list_models,estimate_cost,generate,wait_for_generation, …). They carry the same contract as below and enforce the user's spend limits. - REST API with an API key:
scripts/affogato.pywraps it. The key is read fromAFFOGATO_API_KEY(never paste a key into chat or commit it). The user creates keys at https://affogato.ai/app/developers (paid plans).
Workflow
- Pick a model.
python scripts/affogato.py models --feature image-generation(features:image-generation,image-editing,text-to-video,image-to-video,lipsync,text-to-speech,music-generation, …).models --output-type videolists everything that makes video. - Read its contract.
python scripts/affogato.py model <id>prints the parameters (enums, ranges, defaults, which ones change the price), the file input slots, and an example request. - Quote first.
python scripts/affogato.py estimate <id> --input '{"prompt": "..."}'returns the credits. Tell the user the price before spending more than a trivial amount, and never loop on expensive video models without asking. - Generate.
python scripts/affogato.py generate <id> --input '{...}' --waitcreates the job and waits (long-polls in 25 s rounds) until it ends. Output URLs are printed;--download DIRsaves the files. - Inputs. Upload a local file with
python scripts/affogato.py upload path/to/file.png(or--url https://…) and pass the returned file id in the model's input slot (model <id>→inputs). Outputs of one generation are files too: pass their id straight into the next model.
Statuses: queued → processing → succeeded | failed | cancelled. Failed and
cancelled generations are refunded in full. A 429 carries Retry-After;
back off and retry.
Rules of thumb
- One continuous scene per video prompt; describe camera movement
explicitly. See
references/prompting.md. - Image edits: put the source in the image slot and describe the change, not the whole picture.
- Keep
num_imagessmall while iterating; raise it for the final pass. - Do not retry a
failedgeneration blindly: readerror.code(content_policymeans the prompt or image was refused). - Credits are real money: quote, confirm, then generate.
Reference
- API docs: https://affogato.ai/developers · OpenAPI: https://api.affogato.ai/v1/openapi.json
- Agent summary: https://affogato.ai/developers/llms.txt
- MCP setup: https://affogato.ai/mcp
