DGX LLM Chat Gateway

Image generation

Three aliases delivered through the chat-completions endpoint:

AliasUnderlying modelCold latencyCost (rough)
nano-bananagoogle/gemini-3.1-flash-image-preview12-15 s~$3/M tokens
gpt-imageopenai/gpt-5.4-image-2100-180 s~$15/M tokens
image-gencomposite (banana → gpt-image)12-180 smixed

Output is base64-encoded image data inside the chat completion — specifically choices[0].message.images[0].image_url.url, prefixed with data:image/jpeg;base64,.

Generate one image

curl -s --max-time 240 https://dgx-spark-4236.spass.fun/v1/chat/completions \
  -H "Authorization: Bearer $BEARER" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "nano-banana",
    "messages": [{
      "role": "user",
      "content": "Generate a photo of a small green frog wearing a tiny crown, photorealistic"
    }],
    "stream": false
  }' \
  | jq -r '.choices[0].message.images[0].image_url.url' \
  | sed 's/^data:image\/[a-z]*;base64,//' \
  | base64 -d > frog.jpg

Important details:

Compare aliases

PROMPT="A vintage scientific illustration of a hummingbird"

for ALIAS in nano-banana gpt-image image-gen; do
  echo "=== $ALIAS ==="
  T0=$(date +%s)
  curl -s --max-time 240 https://dgx-spark-4236.spass.fun/v1/chat/completions \
    -H "Authorization: Bearer $BEARER" \
    -H "Content-Type: application/json" \
    -d "{\"model\": \"$ALIAS\", \"messages\": [{\"role\": \"user\", \"content\": \"$PROMPT\"}], \"stream\": false}" \
    | jq -r '.choices[0].message.images[0].image_url.url' \
    | tee >(wc -c) \
    | sed 's/^data:image\/[a-z]*;base64,//' \
    | base64 -d > "${ALIAS}.jpg"
  echo "  time: $(($(date +%s) - T0)) s"
done

When to pick which

Image input + image output

Both image-gen aliases also accept image input — useful for variation / edit workflows:

B64=$(base64 -w 0 source.jpg)

curl -s --max-time 240 https://dgx-spark-4236.spass.fun/v1/chat/completions \
  -H "Authorization: Bearer $BEARER" \
  -H "Content-Type: application/json" \
  -d "{
    \"model\": \"nano-banana\",
    \"messages\": [{
      \"role\": \"user\",
      \"content\": [
        {\"type\": \"text\", \"text\": \"Make this look like an oil painting\"},
        {\"type\": \"image_url\", \"image_url\": {\"url\": \"data:image/jpeg;base64,$B64\"}}
      ]
    }],
    \"stream\": false
  }"

Limitations