Skip to main content
cURL is ideal for quick, one-off API calls from the command line: simple, immediate, and useful for exploring or debugging endpoints. For production workflows—automating generation in loops, processing and saving results, storing metadata in a database, building scripts or web applications, or integrating generation into larger systems—using a programming language such as Python (or an SDK) provides far better control, error handling, and integration options.
Use cURL for ad-hoc requests and fast debugging. Use Python (or another SDK) when you require automation, conditional logic, parallel processing, persistence, or when integrating generation into applications.
Slide titled "Curl vs Python" on a dark blue background comparing use cases: the left side says curl is great for quick, one-time API calls from the command line but not ideal for complex tasks, while the right lists Python use cases like automating image generation, processing/saving results, building tools or web apps, and integrating into bigger projects.
Whatever you can do with cURL, you can also do from Python — but with the added benefit of programmatic control. That includes using loops, retries, concurrency, structured logging, and integrating results with databases or web frameworks. Table: When to use cURL vs Python Examples below show equivalent requests using cURL and the Runway Python SDK so you can compare the syntax and typical usage patterns.

Example: GET a task by ID

cURL — quick authenticated GET:
Python — using the Runway SDK:
Never hard-code API keys in source files. Store secrets in environment variables (e.g., RUNWAYML_API_SECRET) or a secure secrets manager.

Example: Create a text-to-image task (POST)

Below is the corresponding cURL POST with a JSON body to create a text-to-image task. cURL POST:
Successful response (example):
Python (Runway SDK) — same action, expressed with native types and easier programmatic handling:
Using the SDK allows you to:
  • Work with native Python objects (lists, dicts) instead of raw JSON strings.
  • Add retries, error handling, logging, and persistence easily.
  • Integrate image generation into web applications, background workers, or data pipelines.
Links and references

Watch Video