gemini-3.1-pro-preview
Gemini 3.1 Pro preview brings Google's large-context multimodal text stack to LumeAPI.
Auth: Authorization: Bearer sk-… from the Console. Use this model id exactly in the model field.
Only parameters relevant to gemini-3.1-pro-preview are listed below.
| Field | Type | Req | Description |
|---|---|---|---|
| model | string | ✓ | One of 30 whitelisted model ids (see model tables) |
| messages | array | ✓ | OpenAI-style messages[] — role + content |
| stream | boolean | — | SSE streaming |
| temperature | number | — | Sampling temperature (model-dependent default if omitted) |
| max_tokens | integer | — | Max completion tokens |
curl https://api.lumeapi.site/v1/chat/completions \
-H "Authorization: Bearer $LUMEAPI_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "gemini-3.1-pro-preview",
"messages": [{"role":"user","content":"Hello"}]
}'POST /v1/chat/completions with "stream": true. Response Content-Type is text/event-stream.
First line: retry: 3000 (reconnect delay ms). Each chunk: id: N then data: {JSON}. Heartbeats: : PING comment lines (~every 30s). End: data: [DONE].
Use the "id" field inside the first data JSON (e.g. chatcmpl-abc…) as stream_id for resume.
GET /v1/chat/completions/stream/resume/{stream_id}?last_event_id=N with the same Bearer key. Also accepts Last-Event-ID header. Replays cached chunks from N+1; waits for new chunks if still generating.
Hub expired (>30 min after completion) or server restarted. Do not retry resume — re-submit POST or fetch final result another way.
Video models use async POST/GET polling, not SSE. See Video Integration section.