Skip to main content

Python SDK

What this lets you do

Create durable image turns from Python against a local runtime or DreamLayer Agent API.

What you need

  • Python 3.11 or later
  • A DreamLayer clone for local installation
  • A running local runtime or a server-side DREAMLAYER_API_KEY

Steps

1. Install from the clone

2. Create a local conversation

3. Create a managed execution

Keep managed keys in server-side environment variables.

Confirm it worked

The local example prints durable job stages ending in a terminal state. The managed example prints an asset event followed by done with status completed.

Common errors

  • 401: replace a missing, invalid, or revoked managed key.
  • 402: add live credits or use a test key.
  • Connection refused: start the local runtime and use its printed loopback URL.

Troubleshooting

Reuse the same idempotency key after an uncertain managed response. Read Idempotency and retries before retrying a mutation.

Next steps