Run Your First Model
Install the SDK, install the model, generate an image, save it. Under 10 lines of Python.
Uses:flux_schnell — fast text-to-image, 4-step diffusion, ~1 second per image on a warm worker.
The [all] extras pull in media-toolkit so result images get a built-in .save() helper, with image / audio / video format support.
pip install socaity[all]flux_schnell is not an official Socaity service, so you need to install it once. From then on it imports like any other module.
socaity --install flux_schnell Import the service, call it with a prompt, and save the result. Calling the model returns a Job object — .get_result() blocks until the GPU finishes and returns a list of image objects with a .save() helper.
from socaity import flux_schnell
flux = flux_schnell()
images = flux(prompt="a lone astronaut on a neon planet, cinematic", num_outputs=1).get_result()
for img in images:
img.save(f"{img}.png") The SDK handles auth for you. If you ran socaity login once, a temporary key is cached — same flow as the gh or claude CLI. For production, prefer an environment variable.
# Option A — log in once, the SDK keeps a temp key (like gh or claude CLI)
socaity login
# Option B — export the key in your environment (good for production)
export SOCAITY_API_KEY="sk_..."
# Windows (PowerShell)
$env:SOCAITY_API_KEY = "sk_..."- Installed the
socaityPython SDK with the[all]extras - Installed the
flux_schnellservice viasocaity --install - Generated an image from a prompt and saved it to disk