> ## Documentation Index
> Fetch the complete documentation index at: https://bianxieai.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Gemini GenerateContent

> Generate output using the native Gemini content format

Authenticate with `x-goog-api-key: API_KEY`. The `model` path parameter is required.

| Field                 | Type   | Required | Description                                                                                    |
| --------------------- | ------ | -------- | ---------------------------------------------------------------------------------------------- |
| `contents`            | array  | Yes      | Conversation turns containing `role` and `parts[]`; parts may carry text or supported media.   |
| `systemInstruction`   | object | No       | System instruction content.                                                                    |
| `generationConfig`    | object | No       | Temperature, topP, topK, candidate count, output-token limit, stops, and response MIME/schema. |
| `safetySettings`      | array  | No       | Safety categories and thresholds.                                                              |
| `tools`, `toolConfig` | mixed  | No       | Function, code execution, search, or other model-supported tools and configuration.            |
| `cachedContent`       | string | No       | Cached content resource name.                                                                  |

<CodeGroup>
  ```bash cURL theme={null}
  curl "https://api.bianxie.ai/v1beta/models/your-model:generateContent" \
    -H "x-goog-api-key: API_KEY" \
    -H "Content-Type: application/json" \
    -d '{
      "contents": [{
        "role": "user",
        "parts": [{"text": "Hello"}]
      }]
    }'
  ```

  ```python Python theme={null}
  import requests
  requests.post("https://api.bianxie.ai/v1beta/models/your-model:generateContent", headers={"x-goog-api-key":"API_KEY"}, json={"contents":[{"role":"user","parts":[{"text":"Hello"}]}]})
  ```

  ```javascript Node.js theme={null}
  await fetch("https://api.bianxie.ai/v1beta/models/your-model:generateContent", { method: "POST", headers: { "x-goog-api-key": "API_KEY", "Content-Type": "application/json" }, body: JSON.stringify({ contents: [{ role: "user", parts: [{ text: "Hello" }] }] }) });
  ```
</CodeGroup>

The response includes `candidates[]`, `promptFeedback`, `usageMetadata`, `modelVersion`, and `responseId`. Candidates include content, finish reason, and safety ratings. This documented endpoint does not claim Gemini's separate streaming path.
