Generate media
generateRuns a model to generate an image, video, audio clip, 3D model or text, billed against your credits. Pass the endpoint id and the model's input (see generate_schema). Waits up to wait_seconds for the result; a job still running by then returns its request_id and status, to follow with generate_status. Needs a positive credit balance (403 insufficient_credits) and a priced model (400 unknown_endpoint).
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"endpoint_id": "<endpoint_id>",
"input": "<input>"
},
"name": "generate"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| input | Yes | The model's input, per generate schema | |
| endpoint_id | Yes | A model's endpoint id, as generate models lists it, e.g. `fal-ai/flux/dev` | |
| wait_seconds | No | How long to wait for the result before returning the request id |