From an idea to your first image API request
The practical pieces of an image-generation integration: inputs, authentication, task state, and output.
Create a key, check your balance, submit an image task and retrieve the generated file. The example uses the Seedream 5 Flash configuration verified through our website.
1. Create a key and check funds
Register and sign in. In API Keys, create a named key with a spending limit above the request price, and allow seedream-5-flash if you restrict models. An API key does not add balance. Check Balance & billing before submitting.
2. Confirm the current configuration
Open the model page to check live availability and the current USD price. This example generates one 2K image. Do not substitute another resolution, add image inputs or batch parameters without checking that model’s contract.
3. Submit once
Run this in a terminal on your server with your own key. The request can incur a generation charge. Keep REQUEST_ID and the identical body if the connection fails before you receive a response.
4. Save the task ID
HTTP 202 means the request was recorded, not that generation succeeded. The response includes id, status, outputs, error_code and timestamps. IDs below are illustrative; use your returned ID.
5. Query and save your file
Set TASK_ID to the returned ID. Query every five seconds or more using the same API key. When status is succeeded, outputs contains HTTPS file URLs. Download important files to storage you control; permanent hosting is not guaranteed.
6. Check the charge
Open Consumption history and compare the entry with the selected price. A failed task and a refund are separate records; allow settlement to complete. For an unclear outcome, retain the task ID instead of generating again.
Keep the same task identifier across these steps so the interface, logs, and billing records describe the same operation.