GeminiText to imageAvailable now
gemini-3.1-flash-image
gemini-3.1-flash-image is a text to image tool from Gemini that runs in the background and returns images. Pay as you go from $0.00000065 per token, with one API key.
Try itfrom $0.00000065 / token
Pricing
Up to $2.641101 per run at the default inputs. $0.65 per 1M input tokens, $78.00 per 1M image output tokens, $3.90 per 1M text output tokens. The final charge comes from usage.
Limits
- Runs
- In the background
- Returns
- image
- Longest queue wait
- 3600s
- Run deadline
- 1800s
- Largest inline input
- 1024 KB
- Largest input file
- 500 MB
- Largest output
- 4768 MB
- Outputs per run
- 16
Input
| Field | Kind | Default | Description |
|---|---|---|---|
contents required | JSON | — | The content of the current conversation with the model. |
tools | JSON | — | Grounding with Google Search, the only tool this model takes (web and image search). Set generationConfig.responseModalities to ["TEXT", "IMAGE"]. Every search query the model runs is billed. |
generationConfig | JSON | — | Configuration options for model generation and outputs. |
systemInstruction | JSON | — | Developer set [system instruction(s)](https://ai.google.dev/gemini-api/docs/system-instructions). |
Same request in code
curl https://api.spiral.ai/v1/runs \
-H "Authorization: Bearer $SPIRAL_API_KEY" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: $(uuidgen)" \
-d '{
"provider": "gemini",
"model": "gemini-3.1-flash-image",
"input": {
"contents": {}
}
}'