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
Text and image output in single response
Separate pricing for text vs image output tokens
Fast inference speed
Function calling & JSON mode

Use with AI Assistant

Copy usage instructions for Claude, ChatGPT, or other AI

llms.txt

Model Specifications

Context Window
1M
tokens
Max Output
66K
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
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

1Image output tokens are priced separately at $60.00/M (~60,000 credits/M)
2Each 1024px image uses approximately 1,120 output tokens
3Text-only responses use standard text output pricing ($3.00/M)
4Great 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