Official StewAI Python SDK
Project description
stewai (Python SDK)
Base URL (only): https://api.stewai.com/v1
Public docs:
- SDK overview:
https://docs.stewai.com/sdk-api/overview - Availability, scopes, and feature gates:
https://docs.stewai.com/sdk-api/availability-and-access
Install
pip install -U stewai
Get an API key
- Log in to
stewai.com - Go to
Settings → API keys - Create a key and copy it once (
sk-live-...)
Usage
from stewai import Client
client = Client(api_key="sk-live-...")
# Use the Input step “API input id” shown in the editor as the inputs key
run = client.runs.create(
recipe_id="01K....",
inputs={"USERQUESTION": "What should I focus on this week?"},
)
print(run["status"]) # done|failed|cancelled|blocked
# Debug only: full execution trace (steps + outputs)
trace = client.runs.steps(run["id"])
List runs
runs = client.runs.list(page=1, page_size=20, status="done")
print(runs["count"])
List own recipes (/v1/recipes/)
recipes = client.recipes.list(page=1, page_size=20)
print(recipes["count"])
client.recipes.get/create/update/delete map to server endpoints that are
currently disabled by default and may return 404.
Access and availability notes
client.runsis baseline public v1.client.recipes.list()is baseline public v1.client.recipes.get/create/update/deleteexist in the SDK, but may return404when recipe self-service is disabled on the deployment.client.marketplace.*requires Marketplace to be enabled on the deployment.client.marketplace.search(...)also requires the Marketplace search index.client.storage.*requires Storage to be enabled on the deployment.- Scoped keys need the matching permissions such as
runs:create,runs:read,recipes:read,recipes:write,marketplace:read, andmarketplace:run.
Marketplace discovery (query -> detail -> run)
from stewai import Client
client = Client(api_key="sk-live-...")
recipes = client.marketplace.search(
"gemini web search",
visibility="public_open",
page=1,
page_size=20,
)
first = recipes["results"][0]
detail = client.marketplace.detail(first["recipe_ulid"])
run = client.marketplace.run(
first["recipe_ulid"],
inputs={"query": "latest gemini model updates"},
wait=True,
)
print(run["status"])
Ingest sources (URLs + Pantry docs)
from stewai import Client, IngestSource
client = Client(api_key="sk-live-...")
run = client.runs.create(
recipe_id="01K....",
ingest={
"ingest_1": [
IngestSource(uri="https://example.com/docs", kind="url"),
]
},
)
Upload + resolve Pantry paths
from stewai import Client, IngestSource
client = Client(api_key="sk-live-...")
upload = client.storage.upload("./report.pdf")
run = client.runs.create(
recipe_id="01K....",
ingest={"ingest_1": [upload.to_ingest_source(label="Q4 Report")]},
)
resolved = client.storage.resolve_path("Reports/Q4.pdf")
if resolved:
client.runs.create(
recipe_id="01K....",
ingest={"ingest_1": [resolved.to_ingest_source()]},
)
Environment variable
export STEWAI_API_KEY="sk-live-..."
from stewai import Client
client = Client() # reads STEWAI_API_KEY
run = client.runs.create(recipe_id="01K....", wait=False)
run = client.runs.wait(run["id"], timeout=300)
Output usage contract (credits-first)
client.runs.steps(run_id)returnsoutput_flat.usagewith credits-focused billing fields.- Raw token counters are hidden by default in user-facing v1 responses.
- Compatibility mode for token counters is server-gated and requires privileged access.
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file stewai-0.1.7.tar.gz.
File metadata
- Download URL: stewai-0.1.7.tar.gz
- Upload date:
- Size: 10.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
633952a20e222dae50fdb5a0204eac60a5899d4c99f416bfbd91b7ce2b5948db
|
|
| MD5 |
70325a22096c01430261c4e932a9a574
|
|
| BLAKE2b-256 |
13cbbc64e15a1e1ea1b03391c0a566354e4f8a47bfed69e1bb88c08ea0a1e0ca
|
Provenance
The following attestation bundles were made for stewai-0.1.7.tar.gz:
Publisher:
pypi-stewai.yml on cmumulle/stewai-core
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
stewai-0.1.7.tar.gz -
Subject digest:
633952a20e222dae50fdb5a0204eac60a5899d4c99f416bfbd91b7ce2b5948db - Sigstore transparency entry: 1222882171
- Sigstore integration time:
-
Permalink:
cmumulle/stewai-core@41391524a09f6364ade453f859b43635845afd5e -
Branch / Tag:
refs/tags/stewai-v0.1.7 - Owner: https://github.com/cmumulle
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
pypi-stewai.yml@41391524a09f6364ade453f859b43635845afd5e -
Trigger Event:
push
-
Statement type:
File details
Details for the file stewai-0.1.7-py3-none-any.whl.
File metadata
- Download URL: stewai-0.1.7-py3-none-any.whl
- Upload date:
- Size: 13.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b1e7ce93d86376f4fe85348f40871a6743b2741a2e2c4e012ef647272b4be043
|
|
| MD5 |
6b1b8ca69ca629b810b055078562db89
|
|
| BLAKE2b-256 |
ac3202ca7a1d42229a46e6f828f15b7cc95941539b752493c02c774d4e12ccbf
|
Provenance
The following attestation bundles were made for stewai-0.1.7-py3-none-any.whl:
Publisher:
pypi-stewai.yml on cmumulle/stewai-core
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
stewai-0.1.7-py3-none-any.whl -
Subject digest:
b1e7ce93d86376f4fe85348f40871a6743b2741a2e2c4e012ef647272b4be043 - Sigstore transparency entry: 1222882189
- Sigstore integration time:
-
Permalink:
cmumulle/stewai-core@41391524a09f6364ade453f859b43635845afd5e -
Branch / Tag:
refs/tags/stewai-v0.1.7 - Owner: https://github.com/cmumulle
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
pypi-stewai.yml@41391524a09f6364ade453f859b43635845afd5e -
Trigger Event:
push
-
Statement type: