Skip to main content
Comfy Router gives you one API for hosted image and video models at https://api.comfy.org. Create an API key in your Comfy workspace, then call any model with the official Python and TypeScript SDKs or over plain HTTP. Billing is pay per use: each request draws credits from your workspace balance, with no subscription.
Using Higgsfield? Save your own Higgsfield key and those generations bill to your Higgsfield account instead of your Comfy credits — same endpoint, same request body. See Higgsfield with your own key.
1

Create an API key

Create a key in your Comfy workspace. In a Bash-compatible terminal, set:
Keep API keys on your server or in your local environment. These examples are for a terminal or server, not browser JavaScript.Router charges credits per request. If your workspace has no credit balance, the first live call returns 402 with error_type: insufficient_credits. This check runs before body validation, so an unfunded workspace can return 402 even for an invalid request. Add credits at workspace billing before debugging the request body.
2

Queue a request

Choose your language and run the example. Generation can take a few minutes.
Each SDK submit call creates an idempotency key and reuses it for automatic retries. The cURL example creates one with uuidgen. If it is unavailable, use another UUID generator. For status, cancellation, and collection details, see Queued delivery.