Gemini 3.1 Flash Image Preview (free)

Gemini 3.1 Flash Image Preview (free)

gemini-3.1-flash-image-preview-free
New

Pricing

PricingInput ImageOutput Image
$0$0
--

Input Modalities

    Try this model

    Python
    import os
    from openai import OpenAI
    
    client = OpenAI(
        api_key=os.environ["AIHUBMIX_API_KEY"],
        base_url="https://shkq.org/v1",
    )
    
    response = client.chat.completions.create(
        model="gemini-3.1-flash-image-preview-free",
        messages=[
          {
            "role": "user",
            "content": "Hello, how are you?"
          }
        ],
        max_tokens=1024,
        stream=False,
    )
    
    print(response.choices[0].message.content)

    Frequently asked questions

    How do I call Gemini 3.1 Flash Image Preview (free) via API?

    Gemini 3.1 Flash Image Preview (free) is available through the AIHubMix unified API. The API is OpenAI-compatible: point your OpenAI SDK at https://aihubmix.com/v1, use your AIHubMix API key, and set the model name to gemini-3.1-flash-image-preview-free — no other code changes needed.