Create a Yorai job
yorai_create_jobStart an image, video, or audio generation job with a credit quote that refuses if the cost exceeds max_credits, and retry with the same idempotency key to avoid double charges.
Instructions
Start an image/video/audio generation. SPENDS CREDITS. The server quotes first and refuses if the hold exceeds max_credits. Returns the job; then poll yorai_get_job. Pass the same idempotency_key when retrying an ambiguous failure so you are not charged twice.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| type | No | Generation type, e.g. text-to-image, image-to-video. Optional only if the model has one type. | |
| input | Yes | Model inputs. Use exact names/values from yorai_get_model. File inputs take file IDs from yorai_upload_file. | |
| model | Yes | Model slug, e.g. bytedance-seedance-2-5, z-image, nano-banana-2-lite | |
| max_credits | Yes | Refuse if the quoted hold (upTo) is above this. Use the amount the user approved. | |
| webhook_url | No | ||
| idempotency_key | No |