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/completionsendpoint can also invoke Gemini models, format translation may strip Gemini-specific fields such asthinkingConfig,responseSchema, andthoughtSignature. 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.
| Operation | Request |
|---|---|
| Non-streaming generation | POST https://vip.brioi.com/v1beta/models/{model}:generateContent |
| Streaming generation (SSE) | POST https://vip.brioi.com/v1beta/models/{model}:streamGenerateContent?alt=sse |
| List models | GET https://vip.brioi.com/v1beta/models |
{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).| Method | Example |
|---|---|
x-goog-api-key header (Gemini SDK default) | x-goog-api-key: YOUR_API_KEY |
Authorization header | Authorization: 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.models[].name provides the model ID to substitute into {model} (for example, gemini-4-carbon).GenerateContentRequest schema. Common fields:| Field | Type | Required | Description |
|---|---|---|---|
contents | array | Yes | Ordered conversation turns. |
contents[].role | string | No | user or model. Populate for multi-turn conversations. |
contents[].parts | array | Yes | Content parts such as text or images. |
parts[].text | string | Conditional | Text content (required when no media part is supplied). |
parts[].inlineData | object | No | Base64-encoded inline file containing mimeType and data. |
parts[].fileData | object | No | Publicly accessible direct HTTPS file or media URL containing mimeType and fileUri. |
systemInstruction | object | No | System instructions using the contents[] item structure, e.g. {"parts":[{"text":"..."}]}. |
generationConfig | object | No | Generation parameters such as temperature, maxOutputTokens, responseMimeType, responseSchema, and thinkingConfig. |
tools | array | No | Tool declarations such as function calling. |
candidates[0].content.parts[], and token usage is reported in usageMetadata."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.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.responseMimeType and responseSchema in generationConfig (no format instructions needed in the prompt):{"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.{
"contents": [
{"role": "user", "parts": [{"text": "My name is Alex."}]},
{"role": "model", "parts": [{"text": "Hello, Alex."}]},
{"role": "user", "parts": [{"text": "What is my name?"}]}
]
}Invalid auth method selected.; write the following to ~/.gemini/settings.json or run /auth inside the CLI:{
"security": {
"auth": { "selectedType": "gemini-api-key" }
}
}gemini -p "...", trust the working directory beforehand or pass --skip-trust.https://vip.brioi.com without /v1beta—the SDK appends the version path automatically.401 or invalid token: Verify that you are passing a Brioi API key rather than a Google API key.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.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."thought": true when rendering the response (see Non-Streaming Request above).