Skip to navigation

Generate content

Google Gemini-compatible endpoint. Send a native Gemini request (contents, systemInstruction, generationConfig, tools, toolConfig) and receive a native GenerateContentResponse. Point the google-genai SDK (Python or JavaScript) or any Gemini-native client at https://api.empiriolabs.ai and the SDK appends this path automatically. Authenticate with your EmpirioLabs API key via the x-goog-api-key header (or the ?key= query parameter). Works with any chat model, and pricing, parameters, and billing match /v1/chat/completions.

A request without contents returns 400. So does a request the API cannot serve as asked, with the field named in the message: generationConfig.candidateCount above 1, responseModalities other than TEXT, responseLogprobs or logprobs, thinkingLevel together with thinkingBudget, cachedContent, a built-in tool other than googleSearch (such as codeExecution, urlContext, or googleMaps), or allowedFunctionNames that name no declared function. A googleSearch tool turns on web search on models that offer it.

Errors use the Google error shape, {"error": {"code": <HTTP status>, "message": "...", "status": "..."}}.

Authentication

AuthorizationBearer

Pass your EmpirioLabs API key as a bearer token. The Anthropic-style x-api-key header is also accepted on every endpoint.

Path parameters

modelstringRequired

An EmpirioLabs chat model id, for example qwen3-7-max.

Request

This endpoint expects an object.
contentslist of objectsRequired

Conversation turns, at least one with a part. Roles are user and model.

systemInstructionobjectOptional
generationConfigobjectOptional

Generation settings. The snake_case spellings are accepted too.

toolslist of objectsOptional

functionDeclarations, and googleSearch (or googleSearchRetrieval), which turns on web search on models that offer it. Any other built-in tool returns 400.

toolConfigobjectOptional
safetySettingslist of objectsOptional

Accepted for compatibility; it does not change the response.

Response

Generated content.
candidateslist of objectsOptional
usageMetadataobjectOptional
modelVersionstringOptional
responseIdstringOptional
One ID for the whole response, the same on every event of a stream.

Errors

400
Bad Request Error
401
Unauthorized Error
402
Payment Required Error
403
Forbidden Error
404
Not Found Error
429
Too Many Requests Error