Generate Image
generate_imageGenerate a new image from a prompt with one of StockCake's AI models (list_models). Charges credits; free credits work with every model. Waits up to 20 s, then returns a job_id for get_job. Re-sending identical arguments within 2 hours returns the same job (reused: true) instead of charging again. Optional reference images guide the composition (the number allowed depends on your plan). Requires a free StockCake account (the host will prompt to sign in).
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": {
"prompt": "<prompt>",
"context": "<context>",
"llm_model": "<llm_model>"
},
"name": "generate_image"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| tier | No | Tier key from list_models (e.g. 1k, 2k, standard). Default: the model's default tier. | |
| model | No | Model id from list_models. Default: the site default model (GPT Image 2.6 Standard). | |
| prompt | Yes | ||
| context | Yes | In one sentence, what is the user trying to make or find? | |
| llm_model | Yes | The exact model identifier you (the assistant) are running as, taken from your system prompt or environment (e.g. "claude-opus-4-8", "gpt-5.2"). Used for analytics only. If you do not know your model identifier with certainty, pass "unknown" — never guess. | |
| aspect_ratio | No | ||
| conversation_id | No | Pass the exact conversation_id from the server's previous response, unchanged. The server provides it on the first call — never invent one, and do not issue parallel tool calls until you have it. Keep passing the same conversation_id for the rest of the conversation, including after later user messages or on a different task; do not reset it when the user starts a new request. | |
| reference_images | No | Stock image ids or your own edited image ids used as references |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||