Skip to main content

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


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)

Uploaded Source

Built Distribution

stability_ai_sdk-0.0.1-py3-none-any.whl (11.7 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page