Skip to main content

When to use this

  • You need to forward generationConfig, thinkingConfig, or modality settings
  • Your unified layer should still preserve Google-specific capabilities

Example

{
  "model": "gemini-2.5-flash",
  "contents": [
    {
      "role": "user",
      "parts": [{ "text": "Summarize this report." }]
    }
  ],
  "model_extra": {
    "generationConfig": {
      "thinkingConfig": { "thinkingBudget": 512 },
      "responseMimeType": "application/json"
    }
  }
}

cURL example

curl "https://mass.apigo.ai/v1beta/models/gemini-2.5-flash:generateContent" \
  -H "Authorization: Bearer $TIDEMIND_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "gemini-2.5-flash",
    "contents": [
      {
        "role": "user",
        "parts": [{ "text": "Summarize this report." }]
      }
    ],
    "model_extra": {
      "generationConfig": {
        "thinkingConfig": { "thinkingBudget": 512 },
        "responseMimeType": "application/json"
      }
    }
  }'

Python example

import requests

response = requests.post(
    "https://mass.apigo.ai/v1beta/models/gemini-2.5-flash:generateContent",
    headers={
        "Authorization": "Bearer <TIDEMIND_API_KEY>",
        "Content-Type": "application/json",
    },
    json={
        "model": "gemini-2.5-flash",
        "contents": [
            {
                "role": "user",
                "parts": [{"text": "Summarize this report."}],
            }
        ],
        "model_extra": {
            "generationConfig": {
                "thinkingConfig": {"thinkingBudget": 512},
                "responseMimeType": "application/json",
            }
        },
    },
)

print(response.json())

Node.js example

const response = await fetch(
  "https://mass.apigo.ai/v1beta/models/gemini-2.5-flash:generateContent",
  {
    method: "POST",
    headers: {
      Authorization: `Bearer ${process.env.TIDEMIND_API_KEY}`,
      "Content-Type": "application/json",
    },
    body: JSON.stringify({
      model: "gemini-2.5-flash",
      contents: [
        {
          role: "user",
          parts: [{ text: "Summarize this report." }]
        }
      ],
      model_extra: {
        generationConfig: {
          thinkingConfig: { thinkingBudget: 512 },
          responseMimeType: "application/json"
        }
      }
    }),
  }
);

console.log(await response.json());

Best practices

  • Validate nested config objects before passthrough
  • Record both model name and extension parameters for regression tracking