Generate images and videos
These tools spend the user's omg credits. 1 credit is 1 USD. Treat every call as a purchase.
When to use
- Use them when the task needs new visual media: a hero image, an icon, a logo, an illustration, a short clip.
- Do not use them for a screenshot, a chart, or anything you can draw with code or SVG.
- Do not generate many variations "to be safe". Make one, show it, and ask if the user wants another.
Rules
-
Leave
modelout unless the request needs a specific look. With no model the router picks the cheapest curated model for the task ("auto") and names it in the result. -
Each result has
modelandcostUsd. Tell the user both in your reply, for example "Generated with flux-schnell for $0.003." -
A call is refused above the per-call cap ($1.00 default) or when the daily cap ($25.00 default, UTC day) is used up. The error says how much is left. Do not work around the cap. Tell the user.
-
If the result has
pending: true, callomg_media_jobwith thejobId. Do not generate again; that charges twice. -
If the error says the credits are used up, tell the user to add credits at omg.dev. Do not retry.
-
Show images with
omg_display_image. Show videos withomg_display_video. -
A video for the iPhone app must be under 6 MB, H.264, with faststart. The tools already remux downloads to faststart. Check the size. If it is larger, re-encode and keep the original:
ffmpeg -i in.mp4 -vf scale=480:-2 -c:v libx264 -profile:v main -crf 27 -maxrate 1800k -bufsize 3600k -c:a aac -b:a 96k -movflags +faststart out.mp4
Choosing a model
- Usually pass no
model. The router picks the cheapest suitable model for the task and names it in the result. - Pass
modelonly when the request needs a specific look, for example readable text, SVG, or best-quality video. omg_media_modelslists the top models with prices.omg_media_models {all: true, q: "kling"}searches the full list.- A model outside the top list is priced before it runs. If it cannot be priced, the call is refused; pick another.
Video takes 30 seconds to 5 minutes. Images take 3 to 20 seconds.
Fields
- Friendly fields map to provider input:
prompt,aspectRatiotoaspect_ratio,durationSecondstoduration,resolutiontoresolution. - Put any other provider field in
input, for example{"generate_audio": false}or{"quality": "high"}. - Files save to
~/omg-media/<date>/<jobId>-<n>.<ext>unless you passoutputPath.
3D models
Use omg_generate_3d to turn one image of an object into a GLB file. Give imageUrl, or imagePath for a local image under 600 KB. Use one object on a plain background.
tripo3d/h3.1/image-to-3dis the default. It costs $0.30. Use{face_limit: 8000}for a game-ready mesh.fal-ai/hyper3d/rodin/v2.5/fastcosts $0.10. Use it for quick drafts.fal-ai/trellis-2costs $0.25 to $0.35, byresolution.fal-ai/hunyuan3d-v3/image-to-3dcosts $0.375.{generate_type: "LowPoly"}costs $0.45.- PBR, extra views, and detailed geometry cost more. The quote includes them.