# Generate an image (https://docs.fuser.studio/docs/api/guides/generate-an-image)

    ### Build the canvas [#build-the-canvas]

    ```bash
    curl -X POST https://api.fuser.studio/v1/canvas_edit \
      -H "x-api-key: $FUSER_API_KEY" -H "content-type: application/json" \
      -d '{
        "newCanvas": { "name": "Mug shots" },
        "idempotencyKey": "mug-shots-1",
        "diff": {
          "nodes": [{
            "ref": "shot",
            "type": "OpenAIGPTImageNode",
            "label": "Mug on marble",
            "inputs": [
              { "id": "prompt", "value": "A matte black coffee mug on a marble counter, morning light" },
              { "id": "aspect_ratio", "value": "1024x1024" }
            ]
          }]
        }
      }'
    ```

    The response has the `canvasId` and the new node's id.

    ### Price it [#price-it]

    ```bash
    curl -X POST https://api.fuser.studio/v1/run_start \
      -H "x-api-key: $FUSER_API_KEY" -H "content-type: application/json" \
      -d '{ "canvasId": "…", "dryRun": true, "idempotencyKey": "quote-1" }'
    ```

    ### Run it [#run-it]

    ```bash
    curl -X POST https://api.fuser.studio/v1/run_start \
      -H "x-api-key: $FUSER_API_KEY" -H "content-type: application/json" \
      -d '{ "canvasId": "…", "maxCredits": 20, "idempotencyKey": "run-1" }'
    ```

    ### Get the image [#get-the-image]

    ```bash
    curl "https://api.fuser.studio/v1/run_get?canvasId=…&runId=…&waitSeconds=10" \
      -H "x-api-key: $FUSER_API_KEY"
    ```

    `nodes[].outputs` holds the image link once the run is `completed`.