Run a Relay model
run_modelRun any Relay model by name to generate text, images, video, audio, or embeddings. Long-running media jobs return a task_id to poll instead of resubmitting.
Instructions
Runs any Relay model by name (billed to your key). input follows get_model's request_schema (request_example runs as is). Every model whose schema takes async (image, video, audio) is submitted as a task: it waits up to 45 s, past that it returns a task_id — do not resubmit, call check_task. Chat models answer inline. Result links expire 1 h after completion unless store_output names a media_storage SKU from get_pricing. Pass an idempotency_key if you may retry the same submit. Needs a Relay credential.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| input | Yes | Request body per get_model's request_schema, without model, store_output or async (run_model sets them). Pass media as *_url links (upload_file makes one). mode: direct (Relay's providers, the default) or opengpu (the decentralized network, priced separately). | |
| model | Yes | Exact model name from search_models / get_model, e.g. google/gemini-nano-banana-2.1. | |
| store_output | No | Keep result media longer: a media_storage SKU from get_pricing (e.g. relay7d, adds its per-file fee), or provider (default, 1 h). | |
| wait_seconds | No | Seconds to wait for it to finish (0–45, default 45); 0 returns the task_id at once. | |
| inline_images | No | Also return images ≤ 1 MB as image content blocks (default false: links only). | |
| idempotency_key | No | Your key for this submit (task models; a chat answer is not replayed): a retry with the same key and the same input replays the first task instead of starting (and billing) a new one; the same key with a changed input is refused with 422 IDEMPOTENCY_KEY_REUSED. |