# Image generation API

Let your agent make the images.

Generate or edit images through StableStudio. Choose the model and settings, check the price and retrieve the finished image.



Provider in the worked example: StableStudio.

Price shown for this route: 3¢ Flux 2 Pro · 1 MP example.



## What it can do

### Generate an image

Choose a model and settings. Our high-quality GPT Image 2 example cost 17¢.

Price: Priced per request.

### Edit an image

Use a supported edit endpoint to change an existing image. Check the model’s accepted inputs first.



### Generate a video

Request a video from a supported model. Duration and settings affect the price.

Price: from 40¢.

### Convert an image to SVG

Convert a raster image to SVG. Inspect the paths before using it as a logo or icon.




## A real example

Tested on 2026-09-18 through StableStudio.

One paid call from our own test run.

Your agent asked: Create a red sports car on a desert circuit, high quality

Returned in this test:

- Result: 1 image URL
- Dimensions: 1536 × 1024

Charged in this test: $0.17.

One GPT Image 2 generation at high quality. Prompt shortened here.


## Try the API request

Use your TaskFuel API key as TASKFUEL_API_KEY in your terminal or server. Keep it out of browser code.

### 1. Check the price

This request checks the price without paying. Exact request from the image test above. A new generation can produce a different image.

```sh
curl --fail-with-body https://app.taskfuel.ai/v1/call \
  -H "Authorization: Bearer $TASKFUEL_API_KEY" \
  -H 'Content-Type: application/json' \
  --data-binary @- <<'TASKFUEL_REQUEST'
{
  "url": "https://stablestudio.dev/api/generate/gpt-image-2/generate",
  "method": "POST",
  "body": {
    "prompt": "Photorealistic automotive campaign photograph of one unbranded scarlet-red two-door sports coupe accelerating along an empty closed desert test circuit at golden hour. Low front three-quarter tracking-camera view, car pointed to the right, entire car and all visible wheels inside the frame. Sculpted low bonnet, simple narrow headlights, black five-spoke wheels, dark windows, realistic red paint reflecting the warm sky. The car body is crisp while the spinning wheels and asphalt show controlled directional motion blur. Pale desert hills, a sweeping bend and trackside barriers recede behind it. Dynamic but physically believable, natural light, realistic scale and geometry. Leave generous space ahead of the car and keep its complete silhouette within the middle 60 percent of the image height for a later widescreen crop. No other vehicles, no people visible, no badges, no brand logos, no words, no watermark. Landscape photograph, not an illustration.",
    "size": "1536x1024",
    "quality": "high",
    "background": "opaque",
    "output_format": "png"
  },
  "dryRun": true
}
TASKFUEL_REQUEST
```

### 2. Run the request

Review amount_usd in the quote. To pay and run, change dryRun to false and add maxAmountUsd with that approved amount inside the same JSON object. Keep the inputs unchanged; this limit applies to one call.

### 3. Read the result

The first response contains a job ID and pollUrl. Send that URL through TaskFuel’s /v1/call with method GET and no body. Check until complete or failed, then read result.imageUrl. Do not resubmit a pending generation.

[Open the test image](https://wgunica1uhl5nijm.public.blob.vercel-storage.com/generated/fc27ffe5-1c57-4491-ab1f-bc1add4d0a25.png)

[Setup and API reference](https://taskfuel.ai/docs/) · [Job polling and timeout recovery](https://app.taskfuel.ai/using.md)


## Connect your agent

Read the [setup guide](https://taskfuel.ai/docs/setup/) and choose the connection your agent supports.

Use one TaskFuel account and prepaid balance. Inspect the provider and request quote before a paid call, then review the returned response and recorded charge.



## When to use it

### Replace the placeholder.

Describe the image and its dimensions. Inspect the result in the layout before shipping.

### Illustrate the draft you have open.

Ask for a visual that supports the article. Review it before adding it to the page.

### Revise the image you already have.

Use an edit endpoint for a background change. Keep the original so you can compare.




## Questions

### What does an image cost?

Our high-quality GPT Image 2 example cost 17¢ on 18 September 2026. Model, size and quality change the price. Your agent shows the price for your own request before it pays.

### Do I need a provider account?

No. Your agent pays from your TaskFuel balance, so there is nothing else to sign up for.

### Which model should I use?

Choose a model that supports your size, reference images and editing needs. Compare a small sample before using the output in a finished project.

### Can it edit an image I already have?

Use a supported editing tool and check its accepted inputs. A file in your project may need to be shared through a URL the provider can access. Keep the original and review the result.

### Can I generate video too?

Yes, through a supported video tool. Our four-second Sora 2 example cost 40¢ on 22 September 2026. Your agent shows the price for your own request before it pays.

### Can I use the images commercially?

Each image model has its own terms for what it generates, set by the model provider. TaskFuel does not grant or change them.

## Related tool guides

- [Compare fal.ai alternatives for media generation](https://taskfuel.ai/tools/fal-ai-alternative/)
- [Turn a reference image into a video](https://taskfuel.ai/tools/video-generation/)


## Reference

- [Read this guide on the website](https://taskfuel.ai/tools/image-generation/).
- [Browse providers and capabilities](https://taskfuel.ai/catalog/).
- [Pricing](https://taskfuel.ai/pricing/).
- [Agent instructions](https://taskfuel.ai/llms.txt).
