{"id":28158,"library":"runware","title":"Runware Python SDK","description":"The Python Runware SDK provides a high-level interface to the Runware API for image and video generation, upscaling, captioning, background removal, and audio generation. It supports models from Runware's gallery and CivitAI, with ControlNet, inpainting, and outpainting. Current version: 0.5.10, requires Python >=3.10. Active development with regular releases.","status":"active","version":"0.5.10","language":"python","source_language":"en","source_url":"https://github.com/runware/sdk-python","tags":["runware","image-generation","video-generation","ai","sdk","async"],"install":[{"cmd":"pip install runware","lang":"bash","label":"Install from PyPI"}],"dependencies":[],"imports":[{"note":"","wrong":"","symbol":"Runware","correct":"from runware import Runware"}],"quickstart":{"code":"import asyncio\nfrom runware import Runware\n\nasync def main():\n    runware = Runware(api_key=os.environ.get('RUNWARE_API_KEY', ''))\n    await runware.connect()\n    result = await runware.image_generation(\n        model=\"runware:100@1\",\n        positive_prompt=\"a beautiful landscape\",\n        number_of_images=1,\n        height=512,\n        width=512,\n    )\n    print(result)\n    await runware.disconnect()\n\nif __name__ == \"__main__\":\n    asyncio.run(main())","lang":"python","description":"Connect to the Runware API, generate an image, and print the result."},"warnings":[{"fix":"Always use async/await and run the script with asyncio.run() or inside an async context.","message":"The SDK requires asyncio and Python >=3.10. All API calls are async; forgetting to await or not running inside an event loop will cause runtime errors.","severity":"gotcha","affected_versions":"all"},{"fix":"Always call await runware.connect() before operations and await runware.disconnect() when done.","message":"The connect() method must be called before any API calls, and disconnect() after. Failing to do so may leave connections open or cause unexpected behavior.","severity":"gotcha","affected_versions":"all"},{"fix":"Use Runware(api_key='your_key').","message":"Older versions used a different initialization pattern (e.g., Runware(api_key=...). In 0.5.x, the constructor only accepts api_key as a keyword argument. Passing it positionally may break.","severity":"deprecated","affected_versions":">=0.5.0"}],"env_vars":null,"last_verified":"2026-05-09T00:00:00.000Z","next_check":"2026-08-07T00:00:00.000Z","problems":[{"fix":"Run 'pip install runware' in the correct Python environment (Python >=3.10).","cause":"The package is not installed or installed in the wrong environment.","error":"ModuleNotFoundError: No module named 'runware'"},{"fix":"Ensure you call 'await runware.connect()' at the start of your async function and await all API calls.","cause":"Forgetting to call connect() before an API call, or calling a sync method that is actually async.","error":"TypeError: object NoneType can't be used in 'await' expression"},{"fix":"Set the RUNWARE_API_KEY environment variable or pass a valid key to Runware(api_key='...').","cause":"Missing or incorrect API key provided to the Runware constructor.","error":"runware.exceptions.RunwareError: Invalid API key"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}