API overview
| Method | Path | Purpose | Success status |
|---|---|---|---|
| POST | /openapi/v1/projects | Create a project | HTTP 201 |
| GET | /openapi/v1/projects | List projects available to the current account | HTTP 200 |
| GET | /openapi/v1/apps | List published Apps in a project | HTTP 200 |
| GET | /openapi/v1/apps/{appId} | Get App parameters, steps, examples, and estimated price | HTTP 200 |
| POST | /openapi/v1/app-runs | Create an App Run | HTTP 201 |
| GET | /openapi/v1/app-runs/{runId} | Get Run status and results | HTTP 200 |
v1 does not currently provide APIs for deleting or updating projects, listing Runs, canceling Runs, or retrying Runs.
App-specific parameters
After obtaining an appId, call the App details API to read that App's parameter contract, including:
- The App name and purpose;
- The name, type, required status, default value, and example for every input key;
- Supported media formats, sizes, or duration limits;
- The name and type of every output;
- A complete
inputJsonexample that can be run directly; - The current estimated price and factors that may affect the actual price.
The outfit_prompt and character_image fields in this documentation only demonstrate the protocol. They are not supported by every App. Actual requests must follow the current data.inputs returned by the App details API.
Complete App Run flow
- Get a Project ID
Call
GET /openapi/v1/projectsto select an existing project. If no project is available, callPOST /openapi/v1/projectsto create one. - Select an App and read its parameters
Call
GET /openapi/v1/appsto select a published App in the project, then callGET /openapi/v1/apps/{appId}and prepareinputJsonfrom the returneddata.inputs. - Create an App Run
Call
POST /openapi/v1/app-runswith the App ID, Project ID, andinputJson, then save the returned Run ID. - Poll the Run status
Call
GET /openapi/v1/app-runs/{runId}to check progress. Continue polling while the status ispending,queued, orrunning. - Process the result
Stop polling when the status becomes
succeeded,partial_success,failed, orcanceled, then readdata.outputsordata.error.