Skip to main content
Use /v1beta/models/{model}:generateContent for Gemini-compatible integrations.
curl https://api.apiany.ai/v1beta/models/gemini-3.5-flash:generateContent \
  -H "Authorization: Bearer $APIANY_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "contents": [
      {
        "parts": [
          { "text": "Summarize why async media tasks are useful." }
        ]
      }
    ]
  }'
The path model is a public APIAny.AI model ID.

Streaming

Call :streamGenerateContent instead of :generateContent to receive a Gemini server-sent event stream of incremental candidates chunks.
curl https://api.apiany.ai/v1beta/models/gemini-3.5-flash:streamGenerateContent \
  -H "Authorization: Bearer $APIANY_API_KEY" \
  -H "Content-Type: application/json" -N \
  -d '{ "contents": [ { "parts": [ { "text": "Hello" } ] } ] }'

Structured output

Use generationConfig.responseMimeType: "application/json" with responseSchema for JSON output:
{
  "contents": [{ "parts": [{ "text": "Extract name and age" }] }],
  "generationConfig": {
    "responseMimeType": "application/json",
    "responseSchema": {
      "type": "object",
      "properties": { "name": { "type": "string" }, "age": { "type": "integer" } }
    }
  }
}

Parameters

Supported generationConfig: temperature, topP, topK, maxOutputTokens, stopSequences, responseMimeType, responseSchema, responseModalities (include IMAGE for image output). Also top-level tools (functionDeclarations) and systemInstruction.