API Free WeekHundreds of APIs are free to call this week.Browse free APIs
API reference · Google

google/gemini-nano-banana-2.1

Integrate this model through SandBase's unified API, with production-ready schemas and examples.

LLMSynchronousOpen model
Production endpoint

Send your first request

OpenAI-compatible endpoint with unified authentication and usage tracking.

POSThttps://api.sandbase.ai/v1beta/models/google/gemini-nano-banana-2.1:generateContent
Model IDgoogle/gemini-nano-banana-2.1
01

Input Schema

10 parameters · 1 required · 9 optional

ParameterTypeRequiredDescription
messagesobject[]Required—
seedintegerOptional—
stopstring[]Optional—
toolsarrayOptional—
top_pnumberOptionalMin: 0 · Max: 1
streambooleanOptionalDefault: false
max_tokensintegerOptionalMax: 32768
temperaturenumberOptionalMin: 0 · Max: 2 · Default: 1
tool_choicestringOptional—
response_formatobjectOptional—
02

Output Schema

FieldTypeDescription
idstringUnique identifier for the completion
objectstringObject type, e.g. "chat.completion"
modelstringModel used for the completion
choicesarrayList of completion choices
choices[].message.contentstringGenerated text content
choices[].finish_reasonstringReason the generation stopped
usage.prompt_tokensintegerNumber of tokens in the prompt
usage.completion_tokensintegerNumber of tokens in the completion
usage.total_tokensintegerTotal tokens used
03

Code Examples

Ready-to-run snippets

const apiKey = process.env.SANDBASE_API_KEY;
const response = await fetch("https://api.sandbase.ai/v1beta/models/google/gemini-nano-banana-2.1:generateContent", {
  method: "POST",
  headers: {
    Authorization: `Bearer ${apiKey}`,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    "contents": [
      {
        "role": "user",
        "parts": [
          {
            "text": "A watercolor illustration of a fox in a snowy forest"
          }
        ]
      }
    ],
    "generationConfig": {
      "responseModalities": [
        "TEXT",
        "IMAGE"
      ]
    }
  }),
});

if (!response.ok) throw new Error(await response.text());
console.log(await response.json());