# Gemini 3.1 Flash Image Preview - Core.Today AI API > Gemini 3.1 Flash with native image generation capabilities. Can generate images directly in chat responses alongside text. Features separate pricing for text and image output tokens. - **Provider**: Google - **Model ID**: gemini-3.1-flash-image-preview - **Category**: LLM - **Credits**: 500 per request - **Speed**: Fast - **Quality**: High ## Model Specifications - **Context Window**: 131K tokens - **Max Output**: 33K tokens - **Training Cutoff**: January 2025 - **Supported Formats**: text, json, markdown, image - **Compatible SDK**: OpenAI, Google AI ### Capabilities - Vision (image input) - Function Calling - Streaming - JSON Mode - System Prompt - Image Generation ### Token Pricing (per 1M tokens) - **Input Tokens**: 929 credits ($0.62) - **Output Tokens**: 5,574 credits ($3.72) - **Image Output Tokens**: 111,480 credits ($74.32) Note: ~1,120 tokens per 1024px image ## Features - Native image generation in chat - 131,072 token context window - 32,768 max output tokens - Multimodal input: text, image, PDF - Output modalities: image + text - Resolutions 0.5K / 1K (default) / 2K / 4K - Aspect ratios up to 1:8 and 8:1 - Image search grounding, thinking, Batch API ## Use Cases - Conversational image generation - Visual content creation with text descriptions - Image editing via natural language instructions - Creative design brainstorming - Multimodal content production ## API Endpoint Base URL: https://api.core.today Endpoint: POST /llm/gemini/v1beta/openai/chat/completions ## Authentication Header: Authorization: Bearer YOUR_API_KEY Note: LLM endpoints use OpenAI-compatible format with Authorization Bearer token. ## Input Parameters ### Required - **messages**: array - Array of message objects (OpenAI format) ### Optional - **temperature**: float (default: 1) - Sampling temperature (0-2) - **top_p**: float (default: 0.95) - Nucleus sampling parameter - **max_tokens**: integer - Maximum output tokens. Max: 32,768. Context window (input + output): 131,072 tokens. - **stream**: boolean (default: false) - Enable Server-Sent Events streaming ## Examples ### Text Chat Standard text conversation ```json { "model": "gemini-3.1-flash-image-preview", "messages": [ { "role": "user", "content": "Explain the concept of neural style transfer in simple terms." } ], "max_tokens": 1000, "temperature": 0.7 } ``` ### Image Generation Generate an image through natural language conversation ```json { "model": "gemini-3.1-flash-image-preview", "messages": [ { "role": "user", "content": "Generate an image of a serene Japanese garden with a koi pond, cherry blossoms, and a small wooden bridge at sunset." } ], "max_tokens": 4096 } ``` ## Response Format ```json { "id": "chatcmpl-abc123", "object": "chat.completion", "choices": [ { "index": 0, "message": { "role": "assistant", "content": "Response text here" }, "finish_reason": "stop" } ], "usage": { "prompt_tokens": 100, "completion_tokens": 50, "total_tokens": 150 } } ``` ## Tips - Max output tokens: 32,768 (combined text + image output) - Context window 131,072 tokens — smaller than non-image Flash variants - Image output tokens are priced separately at $60.00/M (~60,000 credits/M) - Each 1024px image uses approximately 1,120 output tokens - Text-only responses use standard text output pricing ($3.00/M) - Function calling, structured outputs, caching, and Live API are NOT supported - Great for creative workflows combining text and image generation ## Documentation https://ai.google.dev/gemini-api/docs