fotoai_generate
Generate an image or a video with FotoAI (fotoai.hu), paid with the user's OWN FotoAI credits. Call fotoai_quote first, tell the user the price, and pass its quote_id here only after the user agrees.
Returns the generation id. The finished outputs are saved into this Postemi workspace's media library automatically. With wait_seconds (up to 50) the call waits for a short image and returns media paths directly; otherwise call fotoai_get_generation with the id until status is completed. Attach each media PATH to create_post.
Pass an idempotencyKey (a UUID you invent per generation). If a call times out, repeat it with the SAME key: you get the same generation back and nothing is charged twice.
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": {
"model": "<model>",
"prompt": "<prompt>",
"quote_id": "<quote_id>"
},
"name": "fotoai_generate"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| model | Yes | A model id from fotoai_list_models. | |
| aspect | No | Aspect ratio, the same value you quoted with. | |
| params | No | Other model parameters, the same as in the quote. | |
| prompt | Yes | What to generate, in any language. | |
| duration | No | Video length in seconds, the same value you quoted with. | |
| quote_id | Yes | The quote_id from fotoai_quote, after the user agreed to the price. | |
| wait_seconds | No | Wait this long for the result (0 to 50). Default 0. | |
| idempotencyKey | No | A UUID per generation; repeat it on a retry. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| error | No | ||
| output | No |