English
  • 中文
  • English
English
  • 中文
  • English
官网
服务状态
English
  • 中文
  • English
  1. Text Models
  • Quickstart & Conventions
  • Images
    • GPT Image 2 / 2.5 / 2.6 Generation & Editing
    • Nano Banana Image Generation
    • Gemini Native Sync Image Generation
    • Seedream 5.0 Pro / 5.5 Image Generation
    • Midjourney Image Generation
  • Videos
    • Seedance 2 Video Generation
    • Omni Video Generation
    • Seedance 2.5 Video Generation
    • MiniMax H3 Video Generation
    • WAN 3.0 Video Generation
    • Muse Video Generation
    • Seedance Asset Registration
    • Gemini Omni 1.2 Flash Video Generation
    • Seedance Volcengine Native Video Generation
    • MAGI-2 Video Generation
  • Text Models
    • Claude Desktop (CC Switch) Setup Guide
    • Codex in ChatGPT Desktop Setup Guide
    • Gemini Text Models (Native Format)
    • Text & Chat APIs (OpenAI / Claude)
  • Audio
    • Gemini Text-to-Speech (TTS)
  1. Text Models

Gemini Text Models (Native Format)

Brioi supports the native Google Gemini API format. Existing applications built with the Google Gen AI SDK, Gemini CLI, or direct generateContent HTTP calls can switch by pointing the base URL to Brioi and supplying a Brioi API key—no request body changes needed.
Use the native Gemini format documented here. Although the OpenAI-compatible POST /v1/chat/completions endpoint can also invoke Gemini models, format translation may strip Gemini-specific fields such as thinkingConfig, responseSchema, and thoughtSignature. Use the OpenAI-compatible format only for clients that support solely OpenAI schemas and do not need those capabilities; use the native format for all new integrations.

Endpoints#

OperationRequest
Non-streaming generationPOST https://vip.brioi.com/v1beta/models/{model}:generateContent
Streaming generation (SSE)POST https://vip.brioi.com/v1beta/models/{model}:streamGenerateContent?alt=sse
List modelsGET https://vip.brioi.com/v1beta/models
Replace {model} with the model ID, such as gemini-4-carbon. Streaming is determined by the URL action, so no stream field is needed in the request body.
:countTokens is not supported and returns 404 (Invalid URL).

Authentication#

Any of the three methods below is accepted:
MethodExample
x-goog-api-key header (Gemini SDK default)x-goog-api-key: YOUR_API_KEY
Authorization headerAuthorization: Bearer YOUR_API_KEY
key URL query parameter...:generateContent?key=YOUR_API_KEY
YOUR_API_KEY is your Brioi API key, not a Google API key. Because URL query parameters appear in access logs and browser history, prefer request headers for server-side calls.

Available Models#

Available models depend on your API key's assigned group. Query the live model list:
Returns the native Gemini model list format, where models[].name provides the model ID to substitute into {model} (for example, gemini-4-carbon).

Request Body#

The request body follows Google's official GenerateContentRequest schema. Common fields:
FieldTypeRequiredDescription
contentsarrayYesOrdered conversation turns.
contents[].rolestringNouser or model. Populate for multi-turn conversations.
contents[].partsarrayYesContent parts such as text or images.
parts[].textstringConditionalText content (required when no media part is supplied).
parts[].inlineDataobjectNoBase64-encoded inline file containing mimeType and data.
parts[].fileDataobjectNoPublicly accessible direct HTTPS file or media URL containing mimeType and fileUri.
systemInstructionobjectNoSystem instructions using the contents[] item structure, e.g. {"parts":[{"text":"..."}]}.
generationConfigobjectNoGeneration parameters such as temperature, maxOutputTokens, responseMimeType, responseSchema, and thinkingConfig.
toolsarrayNoTool declarations such as function calling.
Pass additional fields per the official Gemini API documentation. Support for individual features depends on the target model.

Examples#

Non-Streaming Request#

The model's reply is in candidates[0].content.parts[], and token usage is reported in usageMetadata.
Thinking models emit reasoning summary parts marked with "thought": true ahead of the final answer; read only text parts without the thought flag as the final answer. Some parts carry a thoughtSignature—in multi-turn conversations, pass the previous model turn's parts back verbatim. Reasoning tokens are counted in usageMetadata.thoughtsTokenCount and billed at the output rate.

Streaming Request#

Returns SSE where each data: line is a GenerateContentResponse chunk. Concatenate parts[].text in order across chunks while skipping thought parts. Omitting ?alt=sse currently also streams SSE, but we recommend keeping ?alt=sse per the official Gemini convention.

Structured Outputs (JSON)#

To enforce a strict JSON output schema, set both responseMimeType and responseSchema in generationConfig (no format instructions needed in the prompt):
The response text is a JSON string such as {"city":"Paris"}. Extract it the same way as a standard request: skip thought parts, concatenate the remaining parts[].text, and parse as JSON. Passing responseMimeType without responseSchema also returns JSON, with property names chosen by the model. Structured outputs are guaranteed only on the native Gemini format.

Multi-Turn Conversation#

{
  "contents": [
    {"role": "user", "parts": [{"text": "My name is Alex."}]},
    {"role": "model", "parts": [{"text": "Hello, Alex."}]},
    {"role": "user", "parts": [{"text": "What is my name?"}]}
  ]
}

Using with SDKs & CLI#

Google Gen AI SDK (Python)#

Google Gen AI SDK (JavaScript / TypeScript)#

Gemini CLI#

On first launch, select Use Gemini API Key (do not choose Google account login or Vertex AI). Setting environment variables alone without having selected an auth method causes the CLI to report Invalid auth method selected.; write the following to ~/.gemini/settings.json or run /auth inside the CLI:
{
  "security": {
    "auth": { "selectedType": "gemini-api-key" }
  }
}
For non-interactive script runs via gemini -p "...", trust the working directory beforehand or pass --skip-trust.
Set Base URL strictly to https://vip.brioi.com without /v1beta—the SDK appends the version path automatically.

Troubleshooting#

Returns 401 or invalid token: Verify that you are passing a Brioi API key rather than a Google API key.
Returns 400 "Request contains an invalid argument": The payload contains a field or value unsupported by the target model (commonly invalid thinkingConfig, responseSchema, or tools). Test with contents only first, then re-introduce optional fields one by one.
thinkingConfig or responseSchema has no effect via OpenAI-compatible format: Protocol conversion can drop Gemini-specific fields. Switch to the native Gemini format on this page.
Plain text returned despite passing responseSchema: Confirm you are calling the native endpoint and that responseMimeType is application/json with both fields placed inside generationConfig. If it still reproduces, provide the model ID, timestamp, and X-Oneapi-Request-Id from the response.
countTokens returns 404: Not currently supported; read token usage from usageMetadata in generation responses.
Reasoning summary appears mixed into the answer: Filter out parts marked with "thought": true when rendering the response (see Non-Streaming Request above).
Modified at 2026-12-04 07:58:01
Previous
Codex in ChatGPT Desktop Setup Guide
Next
Text & Chat APIs (OpenAI / Claude)
Built with