Models
Text Models
- gemini-2.5-pro
- gemini-2.5-flash
- gemini-2.5-flash-lite
- gemini-3.1-pro-preview
- gemini-3-flash-preview
curl --location "https://api.znapai.com/v1beta1/projects/zamani-tech2-484512/locations/global/publishers/google/models/gemini-2.5-flash-lite:generateContent" \
--header "Authorization: Bearer $ZnapAI_API_KEY" \
--header "Content-Type: application/json" \
--header 'spend-logs-metadata: {"user_id": "user_123", "project_id": "proj_abc", "env": "production"}' \
--data '{
"contents": [
{"role": "user", "parts": [{"text": "Say hello world"}]}
]
}'
Image Models
- gemini-3.1-flash-image-preview
- gemini-3-pro-image-preview
- gemini-2.5-flash-image
curl --location "https://api.znapai.com/v1beta1/projects/zamani-tech2-484512/locations/global/publishers/google/models/gemini-3.1-flash-image-preview:generateContent" \
--header "Authorization: Bearer $ZnapAI_API_KEY" \
--header "Content-Type: application/json" \
--header 'spend-logs-metadata: {"user_id": "user_123", "project_id": "proj_abc", "env": "production"}' \
--data '{
"contents": [
{
"role": "user",
"parts": [
{
"text": "Generate an image of a futuristic city with flying cars at sunset"
}
]
}
],
"generationConfig": {
"candidateCount": 1
}
}'
Image Editing
curl --location "https://api.znapai.com/v1beta1/projects/zamani-tech2-484512/locations/global/publishers/google/models/gemini-2.5-flash-image:generateContent" \
--header "Authorization: Bearer $ZnapAI_API_KEY" \
--header "Content-Type: application/json" \
--header 'spend-logs-metadata: {"user_id": "user_123", "project_id": "proj_abc", "env": "production"}' \
--data '{
"contents": [
{
"role": "user",
"parts": [
{
"text": "Edit this image with british faces"
},
{
"inlineData": {
"mimeType": "image/jpeg",
"data": "<BASE64_ENCODED_IMAGE>"
}
}
]
}
],
"generationConfig": {
"responseModalities": ["IMAGE", "TEXT"]
}
}'
