Python client for Stability AI API
Project description
Stability AI Python SDK
A Python library to easily access the Stability AI API.
Installation
PIP
pip install stability-ai
Authentication
This environment variable must be set for authentication to take place.
export STABILITY_AI_API_KEY=<your key>
Table of Contents
Setup
Engines (v1)
User (v1)
Setup
Initialization
To begin using the Stability AI SDK, just import at the top of your python file.
import stability_ai
Engines (v1)
List
Fetches a list of all available engines.
results = stability_ai.v1.engines.list()
if not results.engines or len(results.engines) == 0:
raise Exception("No engines found")
engine = results.engines[0]
print(f"Engine found: {engine}")
Engines (v1)
Account
Fetches user account.
result = stability_ai.v1.user.account()
print(f"Account found with id: {result.id}")
List
Fetches a list of all available engines.
result = stability_ai.v1.user.balance()
print(f"Balance: {result.credits}")
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
stability_ai_sdk-0.0.1.tar.gz
(12.5 kB
view hashes)
Built Distribution
Close
Hashes for stability_ai_sdk-0.0.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1c2bc4c033f090e65bf670727d87baa21634b0932aadc4a48f3d5fa10f4b9947 |
|
MD5 | 4d717a7385adf3339e0f341c0dd6db38 |
|
BLAKE2b-256 | 0c584eb4b82dfd8d26848a21b35705aefa53be0c0c84ef3e1b20b2524fa75f62 |