Guides
Gemini API
The gateway serves Google's native Gemini API at /v1beta, so the google-genai SDK and raw REST callers work against it unchanged. It is served over the same chat surface as every other protocol, so every catalog model is reachable, not just Gemini.
The endpoint
Point the SDK's base URL at https://api-pr-1277.preview.experientiallabs.ai with API version v1beta. Authenticate with Google's x-goog-api-key header (the SDK default), the ?key= query parameter, or Authorization: Bearer; each carries the same xpl_ key. The {model} in the path is any slug from GET https://api-pr-1277.preview.experientiallabs.ai/v1beta/models (the same set as GET /v1/models, including your :free spellings).
curl "https://api-pr-1277.preview.experientiallabs.ai/v1beta/models/gemini-4-argon:generateContent" \-H "x-goog-api-key: $EXPLABS_API_KEY" \-H "Content-Type: application/json" \-d '{"contents": [{"role": "user", "parts": [{"text": "Hello"}]}]}'
Streaming
:streamGenerateContent?alt=sse streams Google's server-sent events, one GenerateContentResponse per frame, exactly as the SDK's generate_content_stream expects. The terminal frame carries finishReason and usageMetadata; alt=sse is required.
curl -N "https://api-pr-1277.preview.experientiallabs.ai/v1beta/models/gemini-4-argon:streamGenerateContent?alt=sse" \-H "x-goog-api-key: $EXPLABS_API_KEY" \-H "Content-Type: application/json" \-d '{"contents": [{"role": "user", "parts": [{"text": "Hello"}]}]}'
Supported fields
| Field | Contract |
|---|---|
| contents | Required. user and model turns with text, inlineData (PNG, JPEG, GIF, WebP, MP4-family video, WAV/MP3 audio, PDF), public http(s) fileData, functionCall and functionResponse parts. Replayed functionCall parts keep their thoughtSignature. |
| systemInstruction | Text parts, joined into the system prompt. |
| tools, toolConfig | functionDeclarations (parametersJsonSchema, or the upper-case Schema form); functionCallingConfig AUTO, ANY, NONE and allowedFunctionNames. Google's server tools (googleSearch, codeExecution, urlContext, fileSearch) are refused with a 400 naming the field. |
| generationConfig | temperature, topP, topK, presencePenalty, frequencyPenalty, maxOutputTokens, stopSequences, responseMimeType application/json (schema-free JSON), responseJsonSchema or responseSchema (structured output), thinkingConfig (thinkingLevel, thinkingBudget, includeThoughts). candidateCount other than 1, non-TEXT responseModalities, speechConfig and imageConfig are refused. |
| safetySettings, labels, seed, logprobs | Accepted and dropped with a disclosure in x-experiential-ignored-parameters; the gateway's own guardrails apply. |
| cachedContent | Refused: a Google cache resource the gateway cannot address. Gemini lanes are cached automatically. |
Responses, usage and errors
usageMetadatacarriespromptTokenCount(cached reads inside it, reported again ascachedContentTokenCount),candidatesTokenCount,thoughtsTokenCountandtotalTokenCount, plus the gateway'scostextension on finished completions.- Thought summaries render as
thought: truetext parts only whenthinkingConfig.includeThoughtsis set, as on Google. A tool turn's hidden reasoning returns as one trailing opaque thought part: echo it on the next turn. :countTokensanswers{"totalTokens": N}from the gateway's own estimate (disclosed as such); nothing is charged.- Billing, rate limits, key caps, location rules, data controls and guardrails are the same as on every other surface; usage rows record the surface as
generate_content. Google defines no idempotency header, soIdempotency-Keyis not honored here.
{"error":{"code":400,"message":"...","status":"INVALID_ARGUMENT","details":[...]}}, at the same HTTP statuses as the OpenAI routes. The gateway's stable error code rides details[0].reason and the offending field details[0].metadata.param; the meanings match the Errors table.See also
Prefer another protocol? The Quickstart covers Chat Completions and the Responses API, and the Anthropic API guide the Messages lane.