GPT Image 2.5 is live — OpenAI's newest image model, targeted edits that leave the rest of the frame alone
rreAPI Docs

gemini-4-neon

Use Gemini 4 Neon with native Google GenerateContent requests, streaming, four thinking levels, JSON schemas, tool calls, and explicit continuation on reAPI.

Use gemini-4-neon with reAPI's native Google GenerateContent endpoints; see the model page for current availability and pricing.

Quick example

These examples make one non-streaming request without automatic retries or continuation. Your reAPI key belongs in x-goog-api-key; a Google account key is not required. Python uses the standard library. The JavaScript example uses @google/genai 2.29.1 or higher with explicit retry and continuation controls.

curl https://reapi.ai/api/v1beta/models/gemini-4-neon:generateContent \
  -H "x-goog-api-key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "contents": [{"role":"user","parts":[{"text":"Audit this retry queue for race conditions and outline a minimal fix."}]}],
    "generationConfig": {
      "maxOutputTokens": 4096,
      "thinkingConfig": {"thinkingLevel":"high"}
    }
  }'
import json
from urllib.request import Request, urlopen

body = {
    "contents": [{"role": "user", "parts": [{"text": "Audit this retry queue for race conditions and outline a minimal fix."}]}],
    "generationConfig": {
        "maxOutputTokens": 4096,
        "thinkingConfig": {"thinkingLevel": "high"},
    },
}
request = Request(
    "https://reapi.ai/api/v1beta/models/gemini-4-neon:generateContent",
    data=json.dumps(body).encode("utf-8"),
    headers={"x-goog-api-key": "YOUR_API_KEY", "Content-Type": "application/json"},
    method="POST",
)
with urlopen(request, timeout=120) as response:
    result = json.load(response)
print(json.dumps(result, indent=2))
import { GoogleGenAI } from "@google/genai";

const ai = new GoogleGenAI({
  apiKey: "YOUR_API_KEY",
  httpOptions: {
    baseUrl: "https://reapi.ai/api",
    apiVersion: "v1beta",
    retryOptions: { attempts: 1 },
  },
});
const response = await ai.models.generateContent({
  model: "gemini-4-neon",
  contents: "Audit this retry queue for race conditions and outline a minimal fix.",
  config: {
    maxOutputTokens: 4096,
    thinkingConfig: { thinkingLevel: "high" },
    automaticContinuation: false,
  },
});
console.log(response.text);
package main

import (
    "bytes"
    "fmt"
    "io"
    "net/http"
)

func main() {
    body := []byte(`{
      "contents":[{"role":"user","parts":[{"text":"Audit this retry queue for race conditions and outline a minimal fix."}]}],
      "generationConfig":{"maxOutputTokens":4096,"thinkingConfig":{"thinkingLevel":"high"}}
    }`)
    req, err := http.NewRequest("POST",
        "https://reapi.ai/api/v1beta/models/gemini-4-neon:generateContent",
        bytes.NewReader(body))
    if err != nil { panic(err) }
    req.Header.Set("x-goog-api-key", "YOUR_API_KEY")
    req.Header.Set("Content-Type", "application/json")
    resp, err := http.DefaultClient.Do(req)
    if err != nil { panic(err) }
    defer resp.Body.Close()
    out, err := io.ReadAll(resp.Body)
    if err != nil { panic(err) }
    fmt.Println(resp.Status, string(out))
}

Endpoints and authentication

MethodURLResponse
POSThttps://reapi.ai/api/v1beta/models/gemini-4-neon:generateContentNative JSON
POSThttps://reapi.ai/api/v1beta/models/gemini-4-neon:streamGenerateContent?alt=sseNative SSE

Send Content-Type: application/json and x-goog-api-key: YOUR_API_KEY. Authorization: Bearer YOUR_API_KEY and the Google-compatible ?key=YOUR_API_KEY query parameter are also accepted. Prefer the header examples. An explicitly supplied Google key takes precedence over bearer or browser-session credentials. Create your key in API Keys.

The JavaScript Google SDK base URL is https://reapi.ai/api, with apiVersion: "v1beta". The SDK appends /v1beta/models/gemini-4-neon:generateContent, or its streaming equivalent. Do not put /v1beta in both the base URL and API version. Direct HTTP clients use the full endpoint shown above.

Select streaming by endpoint, not a stream body field. generateContent returns JSON; streamGenerateContent?alt=sse returns text/event-stream. There is no asynchronous task ID or task polling. This integration exposes these generation methods, not Google's Files, cache-management, Interactions, or token-counting APIs.

Request parameters

The native JSON body is forwarded unchanged, including unknown fields and nested schemas. This inventory describes Google's request format; it is not a field allowlist. The model service determines parameter acceptance and behavior. Authentication, billing admission, request size, and the platform media policy remain separate checks.

The model is selected in the URL. Do not replace contents with OpenAI messages or put reasoning_effort in a native request.

FieldTypeRequired / defaultMeaning
contentsContent arrayRequiredConversation history plus the current input; each content has role (user or model) and parts
toolsTool arrayOptional; omittedNative function declarations and supported built-in tools
toolConfigobjectOptional; omittedNative function-calling and other tool configuration
safetySettingsarrayOptional; model defaultsPer-category thresholds; Google permits at most one setting per category
continuationTokenstringOptional; omittedOpaque checkpoint token returned by a candidate; resend the original contents unchanged when continuing
labelsstring-valued objectOptional; omittedRequest metadata; Google specifies lowercase letters, digits, underscores, and dashes, at most 63 characters per key/value, with keys starting with a letter
systemInstructionContent objectOptional; omittedTop-level text instructions, such as {"parts":[{"text":"Be concise."}]}
generationConfigobjectOptional; model defaultsOutput budget, thinking level, stop sequences, schemas, and other generation settings
serviceTierstring enumOptional; standardunspecified, standard, flex, priority; availability depends on the model service
storebooleanOptional; omittedGoogle request-logging control; reAPI does not add a default

For media, use native fileData parts with a public HTTP(S) fileUri and the actual mimeType. inlineData, base64 media, and data: media URIs are not accepted. Opaque thought signatures and continuation tokens are protocol state, not media inputs; preserve them verbatim. Google documents text, image, video, audio, and PDF inputs for Neon and text output. A format's presence in the generic API does not guarantee model-specific availability.

generationConfig

All fields below are optional. Unless stated, omission leaves the model default in effect; reAPI does not inject sampling defaults or rewrite schemas.

FieldTypeDocumented behavior
maxOutputTokensintegerThinking plus output budget; REST defaults and per-request caps are 65,536 for both JSON and SSE. Larger budgets can require continuation. Input, thinking, and output share 1,048,576 tokens
thinkingConfigobjectthinkingLevel: low, medium, high (Neon default), xhigh; includeThoughts requests available thought summaries. Thinking cannot be disabled, and native minimal is rejected. thinkingBudget is deprecated and cannot be combined with thinkingLevel
stopSequencesstring arrayUp to five sequences; the matched sequence is excluded from output
responseMimeTypestringtext/plain by default; application/json and text/x.enum are documented alternatives
responseJsonSchemaJSON valueJSON Schema output constraint; forward the complete schema, with support determined by Google
responseSchemaobjectLegacy output schema, deprecated in the current reference; do not combine with responseJsonSchema
responseFormatobjectNative REST JSON output uses responseFormat.text with mimeType: "APPLICATION_JSON" and a schema; model support is determined upstream
responseModalitiesstring arrayOmitted or empty requests text; Neon is a text-output model
seedintegerOptional decoding seed; omission leaves selection to the service
presencePenalty, frequencyPenaltynumberNative repetition settings; model behavior varies
responseLogprobsbooleanRequests candidate log probabilities where supported
logprobsinteger0–20 alternatives in the generic reference; requires responseLogprobs
mediaResolutionstring enumMEDIA_RESOLUTION_UNSPECIFIED, MEDIA_RESOLUTION_LOW, MEDIA_RESOLUTION_MEDIUM, MEDIA_RESOLUTION_HIGH; support depends on media and model
enableEnhancedCivicAnswers, enableAffectiveDialogbooleanGeneric Google options; model availability varies
translationConfig, audioTranscriptionConfigobjectGeneric task configurations; model availability varies

The controls follow the recorded Neon request inventory. Google's migration guide says to remove temperature, topP, topK, and candidateCount; in-range custom sampling values are ignored and out-of-range values return an upstream 400 error. Explicit caching (cachedContent) is unsupported. Additional fields still pass through unchanged; omitting them from the UI inventory does not add an API rejection rule. The Google GenerateContent reference defines nested content, tool, safety, and configuration objects.

Structured output

This native configuration requests an object matching a JSON Schema:

{
  "generationConfig": {
    "responseMimeType": "application/json",
    "responseJsonSchema": {
      "type": "object",
      "properties": {"answer": {"type": "string"}},
      "required": ["answer"],
      "additionalProperties": false
    }
  }
}

OpenAI-compatible requests

Existing OpenAI clients can use POST https://reapi.ai/api/v1/chat/completions, an OpenAI SDK base URL of https://reapi.ai/api/v1, and bearer authentication. That body uses model, messages, stream, and OpenAI parameter names. Keep it separate from the native body above.

Google documents the compatibility mapping reasoning_effort: minimal → low, low → low, medium → medium, high → high, and xhigh → xhigh for gemini-4-neon and gemini-4-hydrogen. Prefer the native generationConfig.thinkingConfig format when working directly with Gemini-specific settings and signed parts. Acceptance of a parameter does not prove its effect. See Google OpenAI compatibility.

Groups

See the model page’s live group prices. Copy the complete model ID shown for the group you want and use it in the model segment of the native Gemini URL, or in the model field for OpenAI-compatible calls. The same reAPI key works across available groups; no separate group key is needed.

Keep the bare gemini-4-neon model ID to use its configured default group when enabled, or pass gemini-4-neon:GROUP_ID to target a specific discovered group. For programmatic discovery and compatibility details, see LLM groups.

Pricing dimensions

Current rates are read from the configured price group and displayed on the model page. Input, output (including thinking), and cached input carry separate rates across the full 1M context window. The final charge follows the selected group's settled request amount, including any applicable tool fees. Explicit caching is not supported on Neon; implicit caching runs automatically on prompts of at least 4,096 tokens, and a repeated prompt is a cache hit only when usage reports cached tokens.

Each continuation is a separate HTTP request with its own usage and charge. reAPI performs one generation attempt per request, with no automatic retries or continuation loop. Your application's SDK can otherwise issue additional requests, which is why the examples disable both behaviors.

Bill formula

For ordinary token usage, the estimate is (input_tokens − cached_tokens) × input_rate + cached_tokens × cache_read_rate + output_tokens × output_rate. Thinking tokens count as output. Any applicable tool charges also apply; the final settled request amount is authoritative. reAPI does not multiply an already group-adjusted amount by the group ratio again.

The final USD amount is retained in micro-units: micro_units = ceil(billed_usd × 1,000,000), then credits = micro_units / 1,000. One credit equals $0.001. Streamed usage is cumulative and settles once after complete delivery. Failed delivery, cancellation, incomplete streams, or missing trusted billing evidence follow the no-charge path.

Responses, tools and continuation

FieldMeaning
candidates[]Native response candidates; inspect each candidate's content, finishReason, and optional continuationToken
content.parts[]Text, thought summaries, signed parts, function calls, and other native output parts
usageMetadataPrompt, candidate, thinking, cached-content, and applicable tool-use token counters
promptFeedbackPrompt blocking or safety feedback when returned
groundingMetadata, citationMetadataCandidate-level grounding or citation data when returned
modelVersion, responseIdModel and response identifiers when supplied

Text comes from candidate parts with text; parts marked thought: true are thought summaries. Preserve the complete model content for later turns, including thoughtSignature, part ordering, and functionCall objects. Do not reconstruct a signed turn from displayed text alone.

Your application executes client functions and sends functionResponse parts in a subsequent user content. reAPI does not execute those functions. When supplying Python callables to the Google SDK, disable automatic function calling if your application must control each tool round trip explicitly.

For streaming, change the curl URL to :streamGenerateContent?alt=sse and add --no-buffer. Each SSE data: frame contains a native JSON response fragment. The stream ends at EOF, with no OpenAI [DONE] sentinel. Inspect in-stream error frames and finishReason before treating partial text as a completed generation.

CONTINUATION means the per-request 65,536-token hop cap was reached before generation finished. The candidate supplies an opaque continuationToken; a hop spent on thinking may return empty visible text. To continue, send the original contents unchanged with that token. If resuming after MAX_TOKENS, raise maxOutputTokens. Keep the token intact; do not generate or decode it yourself. See Google's long-decode guide.

Errors

Native errors use Google's shape, with an HTTP status code and status name:

{
  "error": {
    "code": 400,
    "message": "Request body must be a JSON object.",
    "status": "INVALID_ARGUMENT"
  }
}

The response includes a request-id header for support. Native model error details are preserved where returned. OpenAI-compatible errors retain that endpoint's separate format.

HTTP statusNative statusMeaning
400INVALID_ARGUMENTInvalid JSON/request or a model-rejected parameter combination
401UNAUTHENTICATEDMissing or invalid reAPI key
402FAILED_PRECONDITIONInsufficient balance for admission
403PERMISSION_DENIEDAccess denied
404NOT_FOUNDUnknown model or method
413INVALID_ARGUMENTRequest body exceeds 32 MB
429RESOURCE_EXHAUSTEDRate or concurrency limit
502INTERNALInvalid response or incomplete delivery
503UNAVAILABLEService or pricing unavailable
504DEADLINE_EXCEEDEDRequest deadline exceeded

An error can arrive inside an already-open SSE stream. Handle it before treating the result as complete. See the platform error catalog for other reAPI surfaces.

Tips

  • Start with high (Neon's default) for complex coding, agentic tool use, and analytical tasks, and reserve xhigh for problems where high falls short.
  • Leave maxOutputTokens omitted (or set it to at least 65536) rather than carrying over a low 8,192 cap, since thinking tokens share that budget.
  • Keep original signed parts across tool turns and store the original request separately if you implement explicit continuationToken loops.
  • Use native JSON for Gemini-specific tools and generation settings. Do not mix OpenAI field names into a native request.
  • Use public HTTP(S) URLs and accurate MIME types for media inputs; this endpoint does not upload files to Google for you.
  • Inspect usage and finish reasons. HTTP 200 alone does not verify grounding, caching, schema adherence, or a particular parameter's effect.

Observed behavior

Live service checks on November 20, 2026 verified native JSON (:generateContent), native SSE (:streamGenerateContent?alt=sse, ending cleanly at EOF without [DONE]), thought summaries (includeThoughts: true with thought: true and thoughtSignature), a requested function call (lookup_order with functionCall + thoughtSignature), OpenAI-compatible /v1/chat/completions (high, xhigh, and minimal), and receipt-backed settlement (one upstream request per call). Native xhigh and OpenAI reasoning_effort: "xhigh" / "minimal" were accepted with HTTP 200; acceptance alone does not establish reasoning quality. On the tested channel, responseMimeType: "application/json" with responseSchema returned strict valid JSON, whereas responseJsonSchema and responseFormat.text returned HTTP 200 without enforcing JSON output. Forward the documented schema field you need and validate the returned content in your application.

Official model evidence reviewed 2026-11-20: GenerateContent, Neon model, What's new in Neon, thinking, long decode, OpenAI compatibility.

Table of Contents