# Gemini 3.1 Pro Preview - Core.Today AI API > Google's latest and most capable Gemini model in preview. Features dynamic pricing that adjusts based on context length, with enhanced pricing for inputs over 200K tokens. - **Provider**: Google - **Model ID**: gemini-3.1-pro-preview - **Category**: LLM - **Credits**: 500 per request - **Speed**: Medium - **Quality**: Ultra ## Model Specifications - **Context Window**: 1.0M tokens - **Max Output**: 66K tokens - **Training Cutoff**: January 2025 - **Supported Formats**: text, json, markdown - **Compatible SDK**: OpenAI, Google AI ### Capabilities - Vision (image input) - Function Calling - Streaming - JSON Mode - System Prompt ### Token Pricing (per 1M tokens) - **Input Tokens**: 3,716 credits ($2.48) - **Output Tokens**: 22,296 credits ($14.86) ## Features - Dynamic pricing (standard / long-context >200K) - Advanced reasoning and analysis - 1,048,576 token context window - 65,536 max output tokens - Multimodal input: text, image, audio, video, PDF - Function calling, structured outputs, thinking, search grounding, code execution, caching, Batch API ## Use Cases - Complex reasoning and research tasks - Long document analysis and summarization - Multimodal content understanding - Advanced code generation and review - Scientific and mathematical problem solving ## 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). Supports text, image, video, audio, and PDF inputs. ### Optional - **temperature**: float (default: 1) - Sampling temperature (0-2). Lower values produce more deterministic outputs. - **top_p**: float (default: 0.95) - Nucleus sampling parameter (0-1). - **max_tokens**: integer - Maximum output tokens. Max: 65,536. Context window (input + output): 1,048,576 tokens. - **stop**: string | array - Up to 4 sequences where the model stops generating. - **response_format**: object - Output format constraint. Use `{ type: 'json_object' }` for structured JSON output. - **presence_penalty**: float (default: 0) - Penalty (-2.0 to 2.0) for repeating tokens. - **frequency_penalty**: float (default: 0) - Penalty (-2.0 to 2.0) by token frequency. - **seed**: integer - Seed for deterministic sampling (best-effort). - **stream**: boolean (default: false) - Enable Server-Sent Events streaming. ## Examples ### Research Analysis In-depth analysis with Gemini 3.1 Pro ```json { "model": "gemini-3.1-pro-preview", "messages": [ { "role": "user", "content": "Analyze the current state of quantum error correction research and identify the most promising approaches for achieving fault-tolerant quantum computing by 2030." } ], "max_tokens": 4096, "temperature": 0.5 } ``` ## 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: 65,536 — set max_tokens up to this limit - Context window 1,048,576 tokens (input + output) - Dynamic pricing: inputs >200K tokens use long-context pricing ($4.00/$18.00 per M) - Keep inputs under 200K tokens when possible for standard pricing - Excellent for research, analysis, and complex reasoning tasks - Combine with vision inputs for document and diagram analysis ## Documentation https://ai.google.dev/gemini-api/docs