Skip to main content
Core.Today
|
GoogleFastHigh

Gemini 3.1 Flash Image Preview

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.

500 credits
per request
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

Run it right now

Test this model instantly in the Console Playground โ€” no code required

Sign in to try

Use with AI Assistant

Copy usage instructions for Claude, ChatGPT, or other AI

llms.txt

Model Specifications

Context Window
131K
tokens
Max Output
33K
tokens
Training Cutoff
January 2025
Compatible SDK
OpenAI, Google AI

Capabilities

Vision
Function Calling
Streaming
JSON Mode
System Prompt
Image Generation

Token Pricing (per 1M tokens)

Token TypeCreditsUSD Equivalent
Input Tokens500$0.50
Output Tokens3,000$3.00
๐Ÿ–ผImage Output Tokens60,000$60.00

* 1 credit โ‰ˆ $0.001 (actual charges may vary based on usage)

Quick Start

curl -X POST "https://api.core.today/llm/gemini/v1beta/openai/chat/completions" \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer cdt_your_api_key" \
  -d '{
  "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
}'

Parameters

ParameterTypeRequiredDefaultDescription
messagesarrayYes-Array of message objects (OpenAI format)
temperaturefloatNo1Sampling temperature (0-2)
top_pfloatNo0.95Nucleus sampling parameter
max_tokensintegerNo-Maximum output tokens. Max: 32,768. Context window (input + output): 131,072 tokens.
streambooleanNofalseEnable Server-Sent Events streaming

Examples

Text Chat

Standard text conversation

curl -X POST "https://api.core.today/llm/gemini/v1beta/openai/chat/completions" \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer cdt_your_api_key" \
  -d '{
  "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

curl -X POST "https://api.core.today/llm/gemini/v1beta/openai/chat/completions" \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer cdt_your_api_key" \
  -d '{
  "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
}'

Tips & Best Practices

1Max output tokens: 32,768 (combined text + image output)
2Context window 131,072 tokens โ€” smaller than non-image Flash variants
3Image output tokens are priced separately at $60.00/M (~60,000 credits/M)
4Each 1024px image uses approximately 1,120 output tokens
5Text-only responses use standard text output pricing ($3.00/M)
6Function calling, structured outputs, caching, and Live API are NOT supported
7Great for creative workflows combining text and image generation

Use Cases

Conversational image generation
Visual content creation with text descriptions
Image editing via natural language instructions
Creative design brainstorming
Multimodal content production

Model Info

ProviderGoogle
Version3.1-preview
CategoryLLM
Price500 credits

API Endpoint

POST /llm/gemini/v1beta/openai/chat/completions
Try in PlaygroundBack to Docs