Docs
Status
OverviewQuickstartSetup promptsThe core loopAuthenticationChatAgentOverviewModelsThe waterfallPlansAdding modelsData controlsContent moderationKYCResellersOpenAI compatibilityEmbeddingsAnthropic APIGemini APIErrorsIntegrate the gatewayCost APIRequest log APIAccount APICoding agentsSwitch gatewaysCredits & billingSpend & intelligenceSpend APITelemetryBecome a providerProvider guideAPI reference

Get started

  • Overview
  • Quickstart
  • Setup prompts
  • The core loop
  • Authentication

Experiential Agent

  • Chat
  • Agent

Guides

  • Overview
  • Models
  • The waterfall
  • Plans
  • Adding models
  • Data controls
  • Content moderation
  • KYC
  • Resellers
  • OpenAI compatibility
  • Embeddings
  • Anthropic API
  • Gemini API
  • Errors

Integrations

  • Integrate the gateway
  • Cost API
  • Request log API
  • Account API
  • Coding agents
  • Switch gateways

Billing & usage

  • Credits & billing
  • Spend & intelligence
  • Spend API
  • Telemetry

Providers

  • Become a provider
  • Provider guide

Reference

  • API reference

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-1310.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-1310.preview.experientiallabs.ai/v1beta/models (the same set as GET /v1/models, including your :free spellings).

generateContent
curl "https://api-pr-1310.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.

Streaming
curl -N "https://api-pr-1310.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

FieldContract
contentsRequired. 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.
systemInstructionText parts, joined into the system prompt.
tools, toolConfigfunctionDeclarations (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.
generationConfigtemperature, 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, logprobsAccepted and dropped with a disclosure in x-experiential-ignored-parameters; the gateway's own guardrails apply.
cachedContentRefused: a Google cache resource the gateway cannot address. Gemini lanes are cached automatically.

Responses, usage and errors

  • usageMetadata carries promptTokenCount (cached reads inside it, reported again as cachedContentTokenCount), candidatesTokenCount, thoughtsTokenCount and totalTokenCount, plus the gateway's cost extension on finished completions.
  • Thought summaries render as thought: true text parts only when thinkingConfig.includeThoughts is set, as on Google. A tool turn's hidden reasoning returns as one trailing opaque thought part: echo it on the next turn.
  • :countTokens answers {"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, so Idempotency-Key is not honored here.
Errors wear Google's envelope, {"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.

PreviousAnthropic APINextErrors