Gemini native text generation
curl --request POST \
--url https://api.omnimux.ai/v1beta/models/{model}:generateContent \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"contents": [
{
"role": "user",
"parts": [
{
"text": "Hello."
}
]
}
]
}
'import requests
url = "https://api.omnimux.ai/v1beta/models/{model}:generateContent"
payload = { "contents": [
{
"role": "user",
"parts": [{ "text": "Hello." }]
}
] }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({contents: [{role: 'user', parts: [{text: 'Hello.'}]}]})
};
fetch('https://api.omnimux.ai/v1beta/models/{model}:generateContent', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.omnimux.ai/v1beta/models/{model}:generateContent"
payload := strings.NewReader("{\n \"contents\": [\n {\n \"role\": \"user\",\n \"parts\": [\n {\n \"text\": \"Hello.\"\n }\n ]\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}{
"modelVersion": "<string>",
"responseId": "<string>",
"candidates": [
{
"index": 123,
"finishReason": "<string>",
"content": {
"role": "<string>",
"parts": [
{
"text": "<string>",
"thought": true,
"functionCall": {
"name": "<string>",
"args": {}
}
}
]
}
}
],
"usageMetadata": {
"promptTokenCount": 1,
"toolUsePromptTokenCount": 1,
"candidatesTokenCount": 1,
"thoughtsTokenCount": 1,
"cachedContentTokenCount": 1,
"totalTokenCount": 1,
"promptTokensDetails": [
{
"modality": "<string>",
"tokenCount": 1
}
],
"toolUsePromptTokensDetails": [
{
"modality": "<string>",
"tokenCount": 1
}
]
}
}{
"error": {
"message": "<string>",
"type": "<string>",
"code": "<string>"
}
}{
"error": {
"message": "<string>",
"type": "<string>",
"code": "<string>"
}
}{
"error": {
"message": "<string>",
"type": "<string>",
"code": "<string>"
}
}{
"error": {
"message": "<string>",
"type": "<string>",
"code": "<string>"
}
}{
"error": {
"message": "<string>",
"type": "<string>",
"code": "<string>"
}
}{
"error": {
"message": "<string>",
"type": "<string>",
"code": "<string>"
}
}{
"error": {
"message": "<string>",
"type": "<string>",
"code": "<string>"
}
}{
"error": {
"message": "<string>",
"type": "<string>",
"code": "<string>"
}
}{
"error": {
"message": "<string>",
"type": "<string>",
"code": "<string>"
}
}Gemini
Gemini · Native Multimodal Understanding
Submit text and media through the native content API and receive text or structured results.
POST
/
v1beta
/
models
/
{model}
:generateContent
Gemini native text generation
curl --request POST \
--url https://api.omnimux.ai/v1beta/models/{model}:generateContent \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"contents": [
{
"role": "user",
"parts": [
{
"text": "Hello."
}
]
}
]
}
'import requests
url = "https://api.omnimux.ai/v1beta/models/{model}:generateContent"
payload = { "contents": [
{
"role": "user",
"parts": [{ "text": "Hello." }]
}
] }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({contents: [{role: 'user', parts: [{text: 'Hello.'}]}]})
};
fetch('https://api.omnimux.ai/v1beta/models/{model}:generateContent', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.omnimux.ai/v1beta/models/{model}:generateContent"
payload := strings.NewReader("{\n \"contents\": [\n {\n \"role\": \"user\",\n \"parts\": [\n {\n \"text\": \"Hello.\"\n }\n ]\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}{
"modelVersion": "<string>",
"responseId": "<string>",
"candidates": [
{
"index": 123,
"finishReason": "<string>",
"content": {
"role": "<string>",
"parts": [
{
"text": "<string>",
"thought": true,
"functionCall": {
"name": "<string>",
"args": {}
}
}
]
}
}
],
"usageMetadata": {
"promptTokenCount": 1,
"toolUsePromptTokenCount": 1,
"candidatesTokenCount": 1,
"thoughtsTokenCount": 1,
"cachedContentTokenCount": 1,
"totalTokenCount": 1,
"promptTokensDetails": [
{
"modality": "<string>",
"tokenCount": 1
}
],
"toolUsePromptTokensDetails": [
{
"modality": "<string>",
"tokenCount": 1
}
]
}
}{
"error": {
"message": "<string>",
"type": "<string>",
"code": "<string>"
}
}{
"error": {
"message": "<string>",
"type": "<string>",
"code": "<string>"
}
}{
"error": {
"message": "<string>",
"type": "<string>",
"code": "<string>"
}
}{
"error": {
"message": "<string>",
"type": "<string>",
"code": "<string>"
}
}{
"error": {
"message": "<string>",
"type": "<string>",
"code": "<string>"
}
}{
"error": {
"message": "<string>",
"type": "<string>",
"code": "<string>"
}
}{
"error": {
"message": "<string>",
"type": "<string>",
"code": "<string>"
}
}{
"error": {
"message": "<string>",
"type": "<string>",
"code": "<string>"
}
}{
"error": {
"message": "<string>",
"type": "<string>",
"code": "<string>"
}
}- Put the model in the request path and use
contentsin the body; a bodymodelis not required. - Pass system instructions in
systemInstruction. Treat media as input content, not higher-priority instructions. - One user message can contain text, the complete video and multiple reference images; output is text or structured data.
- For streaming, see Native Streaming Understanding.
Models
| Model ID |
|---|
gemini-4-argon |
gemini-4-hydrogen |
gemini-4-neon |
gemini-4-carbon |
Media and results
Send PNG, MP4 or PDF throughparts[].inlineData. Match mimeType to the actual file and encode the complete file in data without a data-URL prefix. Confirm unlisted formats, media sizes and long-media limits before integrating; request examples do not establish service limits.
Set generationConfig.thinkingConfig.thinkingLevel to choose thinking effort: gemini-4-hydrogen and gemini-4-neon support low, medium, high, and xhigh; gemini-4-carbon supports low, medium, and high; gemini-4-argon examples use low. maxOutputTokens covers both thinking and visible output; the example value does not establish a maximum output limit.
For structured results, combine generationConfig.responseMimeType: application/json with native responseSchema. These structured-output parameters are forwarded in the native request. The returned content may still contain code fences or field types that do not match the schema, such as an object where an array was requested. Validate the actual content and field types before processing it.
Inspect the complete response, finishReason and usageMetadata. A returned functionCall leaves execution to the client; this reference does not promise multi-turn tool execution.
Billing and usage
Charges follow published account prices and actual usage. Automatic route changes do not alter the published price for this model. Input includes reported tool-use input, output includes reported thinking, and reported cached input is an input subset. Do not add these components twice or charge cumulative streaming snapshots as separate usage. An omitted usage field is not an explicit zero. For insufficient balance, inspect the error body: native endpoints can return403 with insufficient_user_quota, in addition to 402. Do not treat every 403 as a permission failure.Path Parameters
Body
application/json
Response
Native response; inspect finishReason and usageMetadata