Gemini 4 Carbon
gemini-4-carbon
TextGoogleGemini 4 Carbongemini-4-carbon
gemini-4-carbon is the deepest reasoning tier of Gemini 4, for engineering tasks that run for days, subtle bugs in large codebases, research and vulnerability fixing, with 88.2% on SEC-bench Pro. Multimodal input, a 1M-token context, low, medium or high thinking.
Authentication
- Base URL
https://api.dreamto.ai- Authorization
Authorization: Bearer YOUR_API_KEY- Content-Type
application/json- Model name (model)
gemini-4-carbon
Integration protocol
Why choose this protocol
Best for users migrating existing Gemini SDK or generateContent requests.
Endpoint URL
POST/v1beta/models/gemini-4-carbon:generateContent
Authorization: Bearer YOUR_API_KEYContent-Type: application/jsonRequest / response JSON
Request
{
"tools": [],
"contents": [
{
"role": "user",
"parts": [
{
"text": "Hello, world"
}
]
}
],
"generationConfig": {
"topK": 40,
"topP": 1,
"temperature": 0.7,
"maxOutputTokens": 4096
}
}Response
{
"candidates": [
{
"content": {
"role": "model",
"parts": [
{
"text": "Hello from Mix API"
}
]
}
}
],
"modelVersion": "gemini-4-carbon",
"usageMetadata": {
"totalTokenCount": 24,
"promptTokenCount": 8,
"candidatesTokenCount": 16
}
}Request / response fields
Request fields
| Field | Field type | Required | Default | Options / range | Description | Example |
|---|---|---|---|---|---|---|
| messages | array | Y | - | - | OpenAI-compatible chat message array. | [{"role":"user","content":"Hello, world"}] |
| system_instruction | string | N | - | - | Used to set the role, style, and boundaries of responses. | You are a rigorous assistant. |
| temperature | number | N | 0.7 | - | Controls randomness; lower is more stable. | 0.7 |
| top_p | number | N | 1 | - | Nucleus sampling probability threshold. | 1 |
| max_tokens | integer | N | - | - | Limits the maximum output length of this response. | 4096 |
| stream | boolean | N | false | - | Whether to use a streaming response. | false |
| top_k | integer | N | - | - | Number of Gemini sampling candidates. | 40 |
| reasoning_effort | enum | N | medium | low, medium, high | Maps to Gemini thinkingConfig.thinkingLevel. | low |
| response_modalities | array | N | - | - | Gemini response modalities, e.g. TEXT or IMAGE. | ["TEXT"] |
| tools | array | N | - | - | Gemini tools/function declarations. | [] |
Response fields
| Field | Field type | Required | Default | Options / range | Description | Example |
|---|---|---|---|---|---|---|
| candidates[].content.parts[].text | string | N | - | - | Text parts in the Gemini candidates. | Hello from Mix API |
| usageMetadata.promptTokenCount | integer | N | - | - | Gemini input token count. | 8 |
| usageMetadata.candidatesTokenCount | integer | N | - | - | Gemini output token count. | 16 |
| usageMetadata.totalTokenCount | integer | N | - | - | Gemini total token count. | 24 |
| candidates | array | N | - | - | - | [{"content":{"role":"model","parts":[{"text":"Hello from Mix API"}]}}] |
| candidates[] | object | N | - | - | - | {"content":{"role":"model","parts":[{"text":"Hello from Mix API"}]}} |
| candidates[].content | object | N | - | - | - | {"role":"model","parts":[{"text":"Hello from Mix API"}]} |
| candidates[].content.role | string | N | - | - | - | model |
| candidates[].content.parts | array | N | - | - | - | [{"text":"Hello from Mix API"}] |
| candidates[].content.parts[] | object | N | - | - | - | {"text":"Hello from Mix API"} |
| modelVersion | string | N | - | - | - | gemini-4-carbon |
| usageMetadata | object | N | - | - | - | {"totalTokenCount":24,"promptTokenCount":8,"candidatesTokenCount":16} |
Code examples
cURLrequest.sh
curl -X POST "https://api.dreamto.ai/v1beta/models/gemini-4-carbon:generateContent" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"contents": [
{
"role": "user",
"parts": [
{
"text": "Hello, world"
}
]
}
],
"generationConfig": {
"temperature": 0.7,
"topP": 1,
"topK": 40,
"maxOutputTokens": 4096
},
"tools": []
}'