Runware API Skill
Use this skill when working with Runware requests in this repo. Prefer the
current Runware docs for model-specific parameters, because available models and
capabilities change often.
Docs To Check
- Platform intro:
https://runware.ai/docs/platform/introduction
- Authentication:
https://runware.ai/docs/platform/authentication
- Task polling:
https://runware.ai/docs/platform/task-polling
- Errors:
https://runware.ai/docs/platform/errors
- Rate limits:
https://runware.ai/docs/platform/rate-limits
- Model search:
https://runware.ai/docs/platform/model-search
- Text to image guide:
https://runware.ai/docs/guides/text-to-image
Request Rules
- REST endpoint:
https://api.runware.ai/v1.
- WebSocket endpoint:
wss://ws-api.runware.ai/v1.
- Raw API request bodies are always a JSON array of task objects, even for one
task.
- Authenticate REST calls with
Authorization: Bearer <API_KEY> whenever
possible. Payload auth is allowed by docs but avoid embedding keys in saved
JSON.
- For WebSockets, the first message must be an authentication task containing
the API key; subsequent messages use the same authenticated connection.
- Every task that accepts
taskUUID must use a fresh UUID v4. Preserve and log
the UUID for debugging and async polling.
- Match responses to requests by
taskUUID and taskType; do not assume array
order is enough.
Local Helper
This workspace has an ignored local helper at local/runware_request.py.
Examples:
export RUNWARE_API_KEY="..."
python3 local/runware_request.py model-search --search "pixel art" --limit 5
python3 local/runware_request.py text-to-image --prompt "a small airship over a forest"
python3 local/runware_request.py raw request.json
python3 local/runware_request.py poll <taskUUID>
The helper prints the full JSON response, retries transient REST/capacity
failures with exponential backoff, exits nonzero when errors is present, and
uses only Python standard-library modules.
Async And Polling
- For long-running operations, set
"deliveryMethod": "async" when the model
or workflow supports it.
- Poll with a
getResponse task:
[
{
"taskType": "getResponse",
"taskUUID": "00000000-0000-4000-8000-000000000000"
}
]
- Use exponential backoff when polling. Start around 1-2 seconds, increase the
delay, and add an initial delay for predictable long tasks such as video.
getResponse can return processing, success, or error; completed
generations can appear before the whole task is finished.
Error And Retry Rules
- Runware errors are returned in an
errors array. Multiple-task requests can
have some successful data entries and some scoped errors.
- Log the full
message and taskUUID; the UUID is important for support.
- Retry only transient failures with exponential backoff: HTTP
429, HTTP
5xx, and capacity/provider codes such as timeoutProvider or
providerRateLimitExceeded.
- Do not blindly retry client errors such as invalid parameters, invalid API
keys, missing balance, or permission failures.
- Keep normal concurrency around 2-4 requests unless the user has a capacity
agreement or the current docs say otherwise.
Image Generation Defaults
For imageInference text-to-image work:
- Use
taskType: "imageInference".
- Include
model, positivePrompt, width, height, and a UUID v4
taskUUID.
- Use
runware:101@1 only as a quick FLUX.1 Dev starting point; search or
inspect model docs when style, cost, speed, or capability matters.
negativePrompt is useful for many diffusion models, but FLUX-style models
may ignore it.
- Check each model's recommended defaults for dimensions,
steps, scheduler,
CFG, and supported extras before assuming parameters are valid.
Secret Handling
- Never commit API keys,
.env files, generated request payloads containing
keys, or downloaded private outputs.
- Prefer
RUNWARE_API_KEY in the shell environment.
- If a command fails because the key is missing, ask the user to provide or set
the key instead of inventing one.
1---2name: runware-api3description: Use when making, reviewing, debugging, or scripting Runware API requests. Follow Runware's raw REST/WebSocket request shape, authentication, UUID, async polling, error, retry, and model-selection rules.4---56# Runware API Skill78Use this skill when working with Runware requests in this repo. Prefer the9current Runware docs for model-specific parameters, because available models and10capabilities change often.1112## Docs To Check1314- Platform intro: `https://runware.ai/docs/platform/introduction`15- Authentication: `https://runware.ai/docs/platform/authentication`16- Task polling: `https://runware.ai/docs/platform/task-polling`17- Errors: `https://runware.ai/docs/platform/errors`18- Rate limits: `https://runware.ai/docs/platform/rate-limits`19- Model search: `https://runware.ai/docs/platform/model-search`20- Text to image guide: `https://runware.ai/docs/guides/text-to-image`2122## Request Rules2324- REST endpoint: `https://api.runware.ai/v1`.25- WebSocket endpoint: `wss://ws-api.runware.ai/v1`.26- Raw API request bodies are always a JSON array of task objects, even for one27 task.28- Authenticate REST calls with `Authorization: Bearer <API_KEY>` whenever29 possible. Payload auth is allowed by docs but avoid embedding keys in saved30 JSON.31- For WebSockets, the first message must be an authentication task containing32 the API key; subsequent messages use the same authenticated connection.33- Every task that accepts `taskUUID` must use a fresh UUID v4. Preserve and log34 the UUID for debugging and async polling.35- Match responses to requests by `taskUUID` and `taskType`; do not assume array36 order is enough.3738## Local Helper3940This workspace has an ignored local helper at `local/runware_request.py`.4142Examples:4344```bash45export RUNWARE_API_KEY="..."46python3 local/runware_request.py model-search --search "pixel art" --limit 547python3 local/runware_request.py text-to-image --prompt "a small airship over a forest"48python3 local/runware_request.py raw request.json49python3 local/runware_request.py poll <taskUUID>50```5152The helper prints the full JSON response, retries transient REST/capacity53failures with exponential backoff, exits nonzero when `errors` is present, and54uses only Python standard-library modules.5556## Async And Polling5758- For long-running operations, set `"deliveryMethod": "async"` when the model59 or workflow supports it.60- Poll with a `getResponse` task:6162```json63[64 {65 "taskType": "getResponse",66 "taskUUID": "00000000-0000-4000-8000-000000000000"67 }68]69```7071- Use exponential backoff when polling. Start around 1-2 seconds, increase the72 delay, and add an initial delay for predictable long tasks such as video.73- `getResponse` can return `processing`, `success`, or `error`; completed74 generations can appear before the whole task is finished.7576## Error And Retry Rules7778- Runware errors are returned in an `errors` array. Multiple-task requests can79 have some successful `data` entries and some scoped `errors`.80- Log the full `message` and `taskUUID`; the UUID is important for support.81- Retry only transient failures with exponential backoff: HTTP `429`, HTTP82 `5xx`, and capacity/provider codes such as `timeoutProvider` or83 `providerRateLimitExceeded`.84- Do not blindly retry client errors such as invalid parameters, invalid API85 keys, missing balance, or permission failures.86- Keep normal concurrency around 2-4 requests unless the user has a capacity87 agreement or the current docs say otherwise.8889## Image Generation Defaults9091For `imageInference` text-to-image work:9293- Use `taskType: "imageInference"`.94- Include `model`, `positivePrompt`, `width`, `height`, and a UUID v495 `taskUUID`.96- Use `runware:101@1` only as a quick FLUX.1 Dev starting point; search or97 inspect model docs when style, cost, speed, or capability matters.98- `negativePrompt` is useful for many diffusion models, but FLUX-style models99 may ignore it.100- Check each model's recommended defaults for dimensions, `steps`, scheduler,101 CFG, and supported extras before assuming parameters are valid.102103## Secret Handling104105- Never commit API keys, `.env` files, generated request payloads containing106 keys, or downloaded private outputs.107- Prefer `RUNWARE_API_KEY` in the shell environment.108- If a command fails because the key is missing, ask the user to provide or set109 the key instead of inventing one.