Skip to main content

Official StewAI Python SDK

Project description

stewai (Python SDK)

Base URL (only): https://api.stewai.com/v1

Install

pip install stewai

Get an API key

  1. Log in to stewai.com
  2. Go to Settings → API keys
  3. 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"])

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) returns output_flat.usage with 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

stewai-0.1.4.tar.gz (8.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

stewai-0.1.4-py3-none-any.whl (11.1 kB view details)

Uploaded Python 3

File details

Details for the file stewai-0.1.4.tar.gz.

File metadata

  • Download URL: stewai-0.1.4.tar.gz
  • Upload date:
  • Size: 8.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for stewai-0.1.4.tar.gz
Algorithm Hash digest
SHA256 3693b7226d875c115c0f1d140e49f605702e98b39f7931e80da3e0114e6689ad
MD5 dd07870f7c4eed951f934c97df3d2ec1
BLAKE2b-256 ecd54415db2686def0505a326c5a70b6274e69bc0de427052550ea13b6c0a3fd

See more details on using hashes here.

Provenance

The following attestation bundles were made for stewai-0.1.4.tar.gz:

Publisher: pypi-stewai.yml on cmumulle/stewai-core

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file stewai-0.1.4-py3-none-any.whl.

File metadata

  • Download URL: stewai-0.1.4-py3-none-any.whl
  • Upload date:
  • Size: 11.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for stewai-0.1.4-py3-none-any.whl
Algorithm Hash digest
SHA256 33060de250b42742216fac6e8a272c2d9feceed3c1a4a23cdffae1cca005b9b0
MD5 04808d931e4ac79b023ef7bc5e74eee7
BLAKE2b-256 bed50a0810096c2c79ffe35e1ad5c2ed62a5a0b3d540459e6d1f1725431f4e47

See more details on using hashes here.

Provenance

The following attestation bundles were made for stewai-0.1.4-py3-none-any.whl:

Publisher: pypi-stewai.yml on cmumulle/stewai-core

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

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