The reference is your key to a comprehensive understanding of the RunComfy API.
<aside> ❗ You need an API key to interact with the RunComfy API. You can find your API key after you signed in to RunComfy.
</aside>
The base URL to send all API requests is https://api.runcomfy.net
. Please pay special attention that it is .net instead of .com. HTTPS is required for all API requests.
The RunComfy API follows RESTful conventions when possible, with most operations performed via GET
, POST
, PATCH
, and DELETE
requests on resources. Request and response bodies are encoded as JSON.
SUPPORTED ENDPOINTS
HTTP method | Endpoint | Jump-to |
---|---|---|
GET | List all workflows | Link |
GET | List all running machines | Link |
GET | Retrieve machine status | Link |
POST | Launch a machine | Link |
POST | Change machine running duration | Link |
DELETE | Stop a machine | Link |
RunComfy uses Bearer Token authorization, once you get the token from your user profile, please add the following to your request Headers, such as the curl below,
curl --location '<https://beta-api.runcomfy.net/prod/api/users/xxxxx/workflows>' \\
--header 'Authorization: Bearer api_token_string'
Preparation
UserID
Token
(Https request) Send a request to get all workflows in your account and grab the version_id (attn! version_id) of the workflow you want to launch the machine with.
(Https request) Issue a POST request to launch a machine, please note this request will return right away with a server_id.
estimated_duration
is a time span in seconds, for instance, you can set 86400 for one day. You can issue another POST request to change this value after the machine is Ready.(Https request) Poll the current machine launching status using the server_id until the status is Ready. You are NOT charged until the machine status is Ready.
(Https request) Modify the machine running duration to adjust to your specific running scenario. For instance, if you have two running machines and the request queue to your service is dropping, you might consider shortening the running duration of one of your machines or just stop it right away using the request below.
(Https request) Stop the machine by calling the DELETE machine API. Once the DELETE request is returned with 200, the machine charge is stopped right away.
To ensure a consistent developer experience for all API users, the RunComfy API is rate limited and size limits apply to request parameters.
Rate-limited requests will return a "rate_limited"
error code (HTTP response status 429). The rate limit for incoming requests per account is one request per second. Some bursts beyond the average rate are allowed.
<aside> ❗ Rate limits may change
In the future, we plan to adjust rate limits to balance for demand and reliability.
</aside>