POST
javascript
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 const axios = require('axios'); const fs = require('fs'); const path = require('path'); // helper function to help you convert your local images into base64 format async function toB64(imgPath) { const data = fs.readFileSync(path.resolve(imgPath)); return Buffer.from(data).toString('base64'); } const api_key = "YOUR API-KEY"; const url = "https://api.segmind.com/v1/gemini-3.7-flash"; const data = { "messages": [ { "role": "user", "content" : "tell me a joke on cats" }, { "role": "assistant", "content" : "here is a joke about cats..." }, { "role": "user", "content" : "now a joke on dogs" }, ] }; (async function() { try { const response = await axios.post(url, data, { headers: { 'x-api-key': api_key } }); console.log(response.data); } catch (error) { console.error('Error:', error.response.data); } })();
RESPONSE
application/json
HTTP Response Codes
200 - OKImage Generated
401 - UnauthorizedUser authentication failed
404 - Not FoundThe requested URL does not exist
405 - Method Not AllowedThe requested HTTP method is not allowed
406 - Not AcceptableNot enough credits
500 - Server ErrorServer had some issue with processing

Attributes


messagesArray

An array of objects containing the role and content


rolestr

Could be "user", "assistant" or "system".


contentstr

A string containing the user's query or the assistant's response.

To keep track of your credit usage, you can inspect the response headers of each API call. The x-remaining-credits property will indicate the number of remaining credits in your account. Ensure you monitor this value to avoid any disruptions in your API usage.

Gemini 3.7 Flash — Fast Multimodal LLM for Coding, Agents, and Knowledge Work

What is Gemini 3.7 Flash?

Gemini 3.7 Flash is Google DeepMind's newest Flash-tier large language model — a fast, cost-efficient workhorse built for coding, agentic workflows, and document-heavy knowledge work. It is the next iteration in the Gemini 3 family, adding algorithmic improvements to the core reasoning foundation of Gemini 3.6 Flash rather than a larger base model. On Segmind you call it with a simple text prompt and optional image or video inputs, and it returns text. The underlying model natively handles text, images, audio, video, and PDFs across a 1M-token context window and returns up to 65,536 output tokens, so entire codebases, long reports, and long recordings fit in a single request.

Key Features

  • Fast multimodal reasoning: send a text prompt with an optional image or video URL; the model reads, analyzes, and answers in one synchronous call — no polling.
  • 1M-token context: 1,048,576 input tokens and up to 65,536 output tokens for large codebases, long documents, and long multi-turn sessions.
  • Built-in thinking: customizable thinking depth lets the model plan multi-step tasks and self-correct before answering; the minimal level is not supported on this model.
  • Search grounding: set web_search: true to ground answers in live Google Search for news and other time-sensitive prompts.
  • Agent-ready: stronger multi-step planning, tool calls, and instruction-following make it a dependable engine for autonomous, long-running workflows.

Best Use Cases

Gemini 3.7 Flash is built for high-volume production work where quality still matters. It shines on software engineering — debugging, issue resolution, and production-ready code generation — and posts top-tier scores on web development and long-horizon coding benchmarks. It is a strong single-model choice for document-heavy knowledge work in finance, legal, and biosciences, where it parses complex PDFs, extracts structured data, and automates enterprise workflows. Its multimodal reach makes it effective for turning screenshots or design systems into working UIs, summarizing long video, and answering questions grounded in charts and reports. In our own testing it produced clean, well-structured markdown — tables, headings, and accurate real-world detail — making it a reliable backend for chatbots, copilots, research assistants, and PDF-to-data pipelines.

Prompt Tips and Output Quality

Be explicit about the output format you want. Asking for a JSON schema, a markdown table, or a fixed bullet structure in the prompt raises consistency substantially — in testing, a structured request returned a clean, complete table on the first try. For analysis, chain-of-thought framing ("work through it step by step, then give the final answer") plays well with the model's built-in thinking. When you attach an image or video, ask a specific question about it rather than an open-ended one. Long system prompts are handled reliably, so put examples, constraints, and output templates directly in the prompt.

FAQs

What inputs does Gemini 3.7 Flash accept? On Segmind, a required text prompt plus optional image and video URLs. Output is text only — this model does not generate images or audio.

How large is the context window? Up to 1,048,576 input tokens and 65,536 output tokens, enough for large codebases and long documents in one call.

Is it good for coding and agents? Yes. It targets software engineering, web development, and agentic workflows, with strong multi-step planning, tool use, and instruction-following.

How do I get up-to-date answers? Set web_search: true to enable Google Search grounding — ideal for news, research, and other prompts that need current facts.

Does it support thinking levels? It supports low, medium, and high thinking depth. Unlike some earlier Gemini models, minimal is not supported and returns an error.

How is it different from Gemini 3.6 Flash? It is a refinement of 3.6 Flash with algorithmic gains in coding, document comprehension, and workflow automation — same context window, no larger model.