Generate image (Gemini format)
For Imagen models, use the :predict suffix (e.g., imagen-3.0-generate-001:predict).
For Gemini models, use :generateContent with generationConfig.responseModalities: ["IMAGE"] in the request body.
Bearer token authentication. Use your provider API key or Bifrost authentication token.
Virtual keys (prefixed with sk-bf-) can also be passed here.
In: header
Path Parameters
Model name with action suffix. For Imagen models, use :predict (e.g., imagen-3.0-generate-001:predict).
For Gemini models with image generation, use :generateContent (e.g., gemini-1.5-pro:generateContent).
Model field for explicit model specification
Content for the model to process
System instruction for the model
Cached content resource name
Labels for the request
Empty Object
Batch embedding requests
Response Body
curl -X POST "http://localhost:8080/genai/v1beta/models/string:predict" \ -H "Content-Type: application/json" \ -d '{}'{
"candidates": [
{
"content": {
"role": "user",
"parts": [
{
"text": "string",
"thought": true,
"thoughtSignature": "string",
"inlineData": {
"mimeType": "string",
"data": "string",
"displayName": "string"
},
"fileData": {
"mimeType": "string",
"fileUri": "string",
"displayName": "string"
},
"functionCall": {
"id": "string",
"name": "string",
"args": {}
},
"functionResponse": {
"id": "string",
"name": "string",
"response": {},
"willContinue": true,
"scheduling": "string"
},
"executableCode": {
"language": "string",
"code": "string"
},
"codeExecutionResult": {
"outcome": "OUTCOME_UNSPECIFIED",
"output": "string"
},
"videoMetadata": {
"fps": 0,
"startOffset": "string",
"endOffset": "string"
}
}
]
},
"finishReason": "FINISH_REASON_UNSPECIFIED",
"finishMessage": "string",
"tokenCount": 0,
"safetyRatings": [
{
"category": "string",
"probability": "string",
"probabilityScore": 0,
"severity": "string",
"severityScore": 0,
"blocked": true,
"overwrittenThreshold": "string"
}
],
"citationMetadata": {},
"index": 0,
"groundingMetadata": {},
"urlContextMetadata": {
"urlMetadata": [
{
"retrievedUrl": "string",
"urlRetrievalStatus": "string"
}
]
},
"avgLogprobs": 0,
"logprobsResult": {
"chosenCandidates": [
{
"token": "string",
"tokenId": 0,
"logProbability": 0
}
],
"topCandidates": [
{
"candidates": [
{
"token": "string",
"tokenId": 0,
"logProbability": 0
}
]
}
]
}
}
],
"promptFeedback": {
"blockReason": "string",
"blockReasonMessage": "string",
"safetyRatings": [
{
"category": "string",
"probability": "string",
"probabilityScore": 0,
"severity": "string",
"severityScore": 0,
"blocked": true,
"overwrittenThreshold": "string"
}
]
},
"usageMetadata": {
"promptTokenCount": 0,
"candidatesTokenCount": 0,
"totalTokenCount": 0,
"cachedContentTokenCount": 0,
"thoughtsTokenCount": 0,
"toolUsePromptTokenCount": 0,
"trafficType": "string",
"cacheTokensDetails": [
{
"modality": "string",
"tokenCount": 0
}
],
"candidatesTokensDetails": [
{
"modality": "string",
"tokenCount": 0
}
],
"promptTokensDetails": [
{
"modality": "string",
"tokenCount": 0
}
],
"toolUsePromptTokensDetails": [
{
"modality": "string",
"tokenCount": 0
}
]
},
"modelVersion": "string",
"responseId": "string",
"createTime": "2019-08-24T14:15:22Z"
}{
"error": {
"code": 0,
"message": "string",
"status": "string",
"details": [
{
"@type": "string",
"fieldViolations": [
{
"description": "string"
}
]
}
]
}
}{
"error": {
"code": 0,
"message": "string",
"status": "string",
"details": [
{
"@type": "string",
"fieldViolations": [
{
"description": "string"
}
]
}
]
}
}