Chat
Generate text using Google’s native Gemini API format.Endpoint
Examples
- Python
- JavaScript
- cURL
Request Body
| Parameter | Type | Required | Description |
|---|---|---|---|
contents | array | Yes | Array of content objects |
generationConfig | object | No | Generation configuration |
systemInstruction | object | No | System instruction for the model |
safetySettings | array | No | Safety filter settings |
Content Object
| Field | Type | Description |
|---|---|---|
role | string | user or model (optional for single turn) |
parts | array | Array of part objects (text, image, etc.) |
Part Object
| Field | Type | Description |
|---|---|---|
text | string | Text content |
inlineData | object | Base64 encoded media data |
Generation Config
| Field | Type | Description |
|---|---|---|
temperature | number | Sampling temperature (0-2) |
topP | number | Nucleus sampling parameter |
topK | integer | Top-k sampling parameter |
maxOutputTokens | integer | Maximum tokens to generate |
stopSequences | array | Stop sequences |
Response
System Instructions
- Python
- JavaScript
- cURL
Multi-turn Conversations
- Python
- JavaScript
- cURL
Vision (Image Input)
- Python
- JavaScript
- cURL
Available Models
| Model | Description |
|---|---|
gemini-3-pro-preview | Latest Gemini with 1M token context |
gemini-3-flash | Ultra-fast and cost-effective |
Headers
| Header | Required | Description |
|---|---|---|
x-goog-api-key | Yes | Your ScaleLLM API key (sk_your_key) |
Content-Type | Yes | application/json |