SDKs

OpenAI SDK (images)

Generate images with any OpenAI-compatible client pointed at Spoof.

The image endpoints are OpenAI-compatible, so you can use the official OpenAI SDKs (or any OpenAI-compatible client) by setting the base URL to https://api.spoofzone.com/v1 and your spf_ key as the API key.

from openai import OpenAI

client = OpenAI(
  base_url="https://api.spoofzone.com/v1",
  api_key="spf_your_key",
)

result = client.images.generate(
  model="nano-banana-pro",
  prompt="a neon koi drifting through violet storm clouds",
)
print(result.data[0].b64_json[:32], "...")
python · 12 lines

See the Images API reference for size, aspect_ratio, and the edit endpoint.

OpenAI SDK (images) | Spoof