> ## 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-compatible protocol

> Generate text with the native generateContent format

Gemini puts turns in `contents[].parts[]` and authenticates with `x-goog-api-key`. Choose the path model ID from the [live model page](https://api.bianxie.ai/pricing).

## Text generation

```bash 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": "Explain quantum computing in one sentence."}]
    }],
    "generationConfig": {
      "temperature": 0.7,
      "maxOutputTokens": 1024
    }
  }'
```

For multi-turn conversations, append ordered `contents` entries with `user` and `model` roles. Use top-level `systemInstruction` for system guidance and `generationConfig` for temperature, stops, output limits, and structured output.

## Response shape

```json theme={null}
{
  "candidates": [{
    "content": {"role": "model", "parts": [{"text": "Quantum computing uses..."}]},
    "finishReason": "STOP"
  }],
  "usageMetadata": {
    "promptTokenCount": 12,
    "candidatesTokenCount": 24,
    "totalTokenCount": 36
  }
}
```

Read text from `candidates[0].content.parts[]`. If safety filters block a request, inspect `promptFeedback` and candidate safety ratings.
