Gemini Interactions API on MaxAPI: text, images and conversation state

Use /v1beta/interactions with a MaxAPI key. Start with curl, stream native events, continue a stored conversation and check current feature limits.

Technical review:

Start with one text request

Send POST https://api.maxapi.dev/v1beta/interactions with your MaxAPI key in x-goog-api-key or Authorization: Bearer. /v1/interactions is also registered. Use model and input, rather than the contents/candidates format of generateContent. Read native steps and usage in the response. store:false is suitable for standalone calls that need no later retrieval.

curl https://api.maxapi.dev/v1beta/interactions \
  -H "x-goog-api-key: $MAXAPI_KEY" \
  -H 'Content-Type: application/json' \
  -d '{"model":"google/gemini-3.1-flash-lite","input":"Say hello.","store":false}'

Stream native events

Add stream:true to the JSON body and -N to curl. MaxAPI preserves native SSE event types and IDs; do not parse the result as OpenAI chat-completion chunks. The terminal event follows billing settlement. Api-Revision is forwarded when supplied.

Save and continue a conversation

Omit store or set it to true to retain an interaction. Save the returned int_… ID and pass it as previous_interaction_id in the next POST. Use GET /v1beta/interactions/{id} to retrieve it and DELETE on the same path after completion and settlement. Only the owner can access that state. Verified routes retain state for 7 days, subject to upstream quotas; a continuation remains tied to its original channel and credential.

Generate an image or supply references

Nano Banana 2.1 image generation was verified with the request below. For editing, replace input with an array of text and image items, for example [{"type":"text","text":"Edit the reference"},{"type":"image","mime_type":"image/png","data":"BASE64"}]. Use valid image bytes and the model’s reference limit. Native image responses contain inline data on the currently verified routes, rather than the OpenAI data[] wrapper.

curl https://api.maxapi.dev/v1beta/interactions \
  -H "x-goog-api-key: $MAXAPI_KEY" \
  -H 'Content-Type: application/json' \
  -d '{
    "model":"google/gemini-nano-banana-2.1",
    "input":"Create a blue circle on a white square.",
    "store":false,
    "response_format":{"type":"image","image_size":"1K","aspect_ratio":"1:1"},
    "generation_config":{"max_output_tokens":8192}
  }'

Check the supported feature boundary

The 2026-10-12 production checks covered Gemini 3 Flash Preview, 3.1 Flash Lite, 3.1 Pro Preview and 3.5 Flash for text, plus Nano Banana 2.1 for image generation. Existing model and route permissions still apply. A channel supporting generateContent does not automatically support Interactions.

Currently verified routes do not support background execution, cancellation, event replay or managed agents. Plain JSON output works; strict response_format.schema and image URI delivery returned upstream errors in verification. MaxAPI preserves requested settings and returns unsupported errors rather than silently removing them. The async.maxapi.dev host default for image tasks does not turn Interactions into background execution.

Understand charges and interrupted calls

Creation reserves credit and settles once using native usage and the model’s existing price. Retrieval and deletion do not generate another turn or charge. Preserve X-MaxAPI-Interaction-ID when present so an accepted stored interaction can be retrieved after disconnection. Only explicit 429/503 rejections before acceptance may switch channels; an ambiguous timeout is not automatically resubmitted. Check the existing interaction or usage record before creating another.

Model-specific parameters

Public configuration snapshot; not live availability. Follow each model page for its parameters, supported routes and reference limits.

References

Continue your integration

Manage API keysAPI referenceCheck current prices