---
title: "generate_image"
description: "Generated reference for the management action generate_image: its description, access metadata, payload contract, and registration status."
slug: /reference/actions/generate-image
order: 101
visibility: public
redirects_from: []
---

# generate\_image

Generated automatically from the [published contract sources](/cloud/reference/about/#contract-sources).

A script calls this action over HTTPS at `POST https://dev.turnzero.ai/api/v1/generate_image`, with a bearer credential and the action's payload as the JSON body. An MCP connection lists this action as the tool `generate_image`.

OAuth access tokens and minted tokens, including the turnzero command's computer token, are bearer credentials. The action determines which kinds, scopes and grants it accepts ([Sign-in, sessions, and tokens](/cloud/concepts/sign-in-sessions-and-tokens/)).

**Build metadata:** Registered in this build. Registration describes the default dispatcher in this build. It does not guarantee that a caller has the required credential or grant, that a tool is listed for that connection, or that the required service is configured.

## Contract description

Generate design assets for your own app, such as a logo, icon, hero image, illustration, UI mockup, or diagram\. With no `application`, your account keeps it 7 days\. `link` opens it in a browser until `expires_at`, at most one hour\. `renew_image_link` replaces the link\. With `application`, it uses app storage with no deployed code needed\. That app's stored\-data limit can refuse it before saving or counting\.

The first images of each UTC month are free\. `free_images` gives how many\. Later delivered images draw the balance by resolution\. `read_account` shows use under your sign\-in or an authorized computer's token\.

A saved picture normally has two download commands\. If link or grant creation fails, it stays saved and counted\. `detail` gives the remedy\.

MCP `inline: true` returns pictures up to 256 KiB as image content\. Past 45 seconds, the call fails and gives the image back\. A failed give\-back stays counted, uncharged\. A repeat that delivers uses another image\.

## More about this action

Pass `prompt`, and optionally `application`, `environment`, `resolution`, and `inline`\. With no `application`, the picture belongs to your account, not a storage area\. You need no application for that form\. `environment` without `application` is refused `invalid_request`\. `resolution` is `1K`, the default, or `2K`\.

With `application`, the file goes to `images-<application id>` in the environment you pass, or otherwise to the app's deploy target\. That is production with one environment and development with two\. Its bytes count in the app's stored data\. They stay until deleted, and a repeat replaces no earlier picture because the platform chooses each name\.

Without `application`, `kept_until` is seven days after the picture was saved\. `link` carries read\-only access to this one picture\. Anyone holding it can open the picture without signing in until `expires_at`, at most one hour and never past `kept_until`\. A later `renew_image_link` call ends the old link\. Save the picture before its keep ends\.

The account form's download commands fetch the link without a header\. The application form's commands send a read\-only transfer grant as the bearer, valid for five minutes\. Reads do not spend either\. If minting fails, commands and `expires_at` are absent\. A failed link mint also leaves `link` absent\. The saved picture stays counted, and `detail` says how to read it\. For a picture saved without an application, call `renew_image_link` with its `name`\.

The first images of each UTC month are free\. `free_images` gives how many\. Later delivered images draw the account's balance by resolution\. The platform calls one model and uses none of an application's AI allowance\. The prompt reaches the provider, and the platform stores nothing about it\. A signed\-in connection and an account\-wide token may call this tool\. An application's platform credential, a token restricted to one application, a token restricted by a grant, and a device sign\-in cannot\.

A provider block returns `blocked: true` with the reason, writes no file, and gives the image back\. A provider refusal before any picture normally gives the image back\. If that fails, it stays counted and uncharged, and the refusal's `detail` says so\. A saved picture or a provider block includes `used`, `free_images`, and `resets_at`, the next UTC month's first instant\.

The account store keeps PNG, JPEG and WebP\. A provider type outside those fails `image_generation_failed`, with nothing saved and the image given back\. Other provider or storage failures also give it back\. A failed give\-back stays counted and uncharged, as the detail says\. `image_generation_unavailable` can mean no key, an unreadable key, no model price, the platform's monthly ceiling, or a provider refusal before any picture\. Past the month's free images while the account is paused, `account_paused` refuses the call before the provider is called, counting and charging nothing\.

HTTP 429 `image_generation_busy` means the service has no room for another image request\. The request ends before generation starts\. Wait a few seconds before trying again\.

A token minted for a job does not receive `read_account`'s `image_generation` member\.

## Access and action metadata

```json
{
  "name": "generate_image",
  "resource": "account",
  "tier": "reversible",
  "surface": "account",
  "addresses": [
    "turnzero"
  ],
  "summary": "Generate design assets for your own app, such as a logo, icon, hero image, illustration, UI mockup, or diagram. With no `application`, your account keeps it for 7 days. `link` opens it in a browser until `expires_at`, at most one hour. `renew_image_link` gives a new link and ends the old one. Pass `application` to keep an asset in an app's storage, with no deployed code needed. Its stored-data limit can refuse the call before anything is saved or counted.\n\nThe first images of each UTC month are free. `free_images` gives how many. Later delivered images draw the account's balance by resolution. `read_account` shows use under your sign-in or an authorized computer's token.\n\nHTTP 429 `image_generation_busy` means the request ended before generation started. Wait a few seconds before trying again.\n\nA saved picture normally includes two download commands. If a link or grant cannot be made, it stays saved and counted. `detail` gives the remedy.\n\nOn MCP, `inline: true` also returns a picture at most 256 KiB as image content. Past 45 seconds, the call fails and gives the image back. A failed give-back stays counted and uncharged, as the detail says. A repeat that delivers uses another image.\n\n`resolution` is `1K`, the default, or `2K`. The platform uses one model. The prompt reaches its provider, and the platform stores nothing about it. The application form keeps the picture in `images-<application id>` until deleted. It uses `environment`, or the application's deploy target, and its download commands send a read-only grant valid for five minutes. The account form's commands fetch the link without a header.\n\nA provider block returns `blocked: true` with the reason, saves no file, and gives the image back. A saved picture or provider block includes `used`, `free_images`, and `resets_at`. A provider refusal before any picture normally gives the image back. `image_generation_unavailable` means the platform cannot make images right now, including where no key is stored. It also covers an unreadable key, no current model price, or the platform's monthly ceiling. Past the month's free images while the account is paused, `account_paused` refuses the call before the provider is called, counting and charging nothing. The account store keeps PNG, JPEG and WebP. Any other provider type fails `image_generation_failed`, with nothing saved and the image given back.",
  "annotations": {
    "readOnlyHint": false,
    "destructiveHint": false,
    "openWorldHint": true
  }
}
```

## MCP catalog entry

```json
{
  "name": "generate_image",
  "title": "Create an image for a UI, site or design",
  "tier": "reversible",
  "scenario": "ACB-L0-93",
  "summary": "Generate design assets for your own app, such as a logo, icon, hero image, illustration, UI mockup, or diagram. With no `application`, your account keeps it 7 days. `link` opens it in a browser until `expires_at`, at most one hour. `renew_image_link` replaces the link. With `application`, it uses app storage with no deployed code needed. That app's stored-data limit can refuse it before saving or counting.\n\nThe first images of each UTC month are free. `free_images` gives how many. Later delivered images draw the balance by resolution. `read_account` shows use under your sign-in or an authorized computer's token.\n\nA saved picture normally has two download commands. If link or grant creation fails, it stays saved and counted. `detail` gives the remedy.\n\nMCP `inline: true` returns pictures up to 256 KiB as image content. Past 45 seconds, the call fails and gives the image back. A failed give-back stays counted, uncharged. A repeat that delivers uses another image.",
  "owners": [
    "ACB-L0-93",
    "PRC-L0-18",
    "MCP-08",
    "OST-L0-01",
    "OST-L0-08",
    "API-L0-17",
    "SEC-L0-07",
    "PLD-L0-96"
  ]
}
```

## request

| JSON pointer | Description and constraints |
|---|---|
| "" \(root\) | Type: object<br>Required fields: \["prompt"\] |
| /<wbr>properties/<wbr>application | An application id from `list_applications`, to keep the picture in its storage\. Leave it out to keep the picture in your account for 7 days\. An empty or non\-text value is refused `invalid_request`\.<br><br>Type: string |
| /<wbr>properties/<wbr>environment | With `application` only: the partition receiving the file, or the app's deploy target if omitted\. Without `application`, refused `invalid_request`\. An environment the app lacks refuses `environment_not_created`\.<br><br>Type: string<br>Pattern: ^\(development\|production\)$ |
| /<wbr>properties/<wbr>prompt | The design asset to make, such as a hero image for your site or an app icon\. It is sent to the model's provider\. The platform keeps nothing about it\.<br><br>Type: string<br>Minimum length: 1<br>Maximum length: 8000 |
| /<wbr>properties/<wbr>resolution | The image's size class; absent, `1K`\.<br><br>Type: string<br>Allowed values: \["1K","2K"\] |
| /<wbr>properties/<wbr>inline | When true, a saved picture also appears as MCP image content if it is at most 256 KiB\. A larger file, or a call over HTTP, includes no image content; the result explains why\.<br><br>Type: boolean |

## response

| JSON pointer | Description and constraints |
|---|---|
| "" \(root\) | Type: object<br>Required fields: \["contract\_version","model","resolution","used","resets\_at","detail"\] |
| /<wbr>properties/<wbr>contract\_version | Required value: 1 |
| /<wbr>properties/<wbr>reference | The short reference the platform recorded your call under: ten lowercase hexadecimal characters, the value in the call’s record row\. Quote it when you report the call\.<br><br>Type: string<br>Pattern: ^\[0\-9a\-f\]\{10\}$ |
| /<wbr>properties/<wbr>application | The application in your request\. Absent in the account form\.<br><br>Type: string |
| /<wbr>properties/<wbr>model | The model the platform called\.<br><br>Type: string |
| /<wbr>properties/<wbr>resolution | The size class the call asked for\.<br><br>Type: string |
| /<wbr>properties/<wbr>used | The account's images counted this UTC month: delivered images and calls whose give\-back failed\.<br><br>Type: integer |
| /<wbr>properties/<wbr>cap | The former plans\-model limit\. Current responses omit this member\.<br><br>Type: integer |
| /<wbr>properties/<wbr>resets\_at | The first instant of the next UTC month, as an ISO 8601 instant\.<br><br>Type: string |
| /<wbr>properties/<wbr>blocked | True where the provider blocked the prompt or the picture: no file was written, the image is given back, and the file's members below are absent\. A failed give\-back stays counted and uncharged, as the detail says\.<br><br>Type: boolean |
| /<wbr>properties/<wbr>reason | With `blocked`: the provider's reason, in its own words\.<br><br>Type: string |
| /<wbr>properties/<wbr>environment | The application's partition holding the file\. Absent in the account form or where `blocked`\.<br><br>Type: string |
| /<wbr>properties/<wbr>area | The file's area, `images-<application id>`\. Absent in the account form or where `blocked`\.<br><br>Type: string |
| /<wbr>properties/<wbr>name | The file's name, which the platform chose\. Absent where `blocked`\.<br><br>Type: string |
| /<wbr>properties/<wbr>mime\_type | The file's type\. Absent where `blocked`\.<br><br>Type: string |
| /<wbr>properties/<wbr>bytes | The file's size\. Absent where `blocked`\.<br><br>Type: integer |
| /<wbr>properties/<wbr>kept\_until | In the account form: when the picture stops being kept, 7 days after its write, as an ISO 8601 instant\. Absent in the application form or where `blocked`\.<br><br>Type: string |
| /<wbr>properties/<wbr>address | The file's whole address on the platform's public origin, each segment of its name escaped\. Absent where `blocked`\.<br><br>Type: string |
| /<wbr>properties/<wbr>link | In the account form: the address with read\-only access for anyone holding it until `expires_at`\. A new `renew_image_link` ends it\. Absent where `blocked` or no link was made\.<br><br>Type: string |
| /<wbr>properties/<wbr>expires\_at | When the link or the grant in the commands stops serving, as an ISO 8601 instant\. Absent where `blocked` or minting failed\. A link ends within one hour and by `kept_until`; an application's grant lasts five minutes\.<br><br>Type: string |
| /<wbr>properties/<wbr>commands | Two download commands\. In the account form they fetch `link` without a header\. In the application form they send a read\-only grant as the bearer\. Absent where `blocked` or minting failed, as `detail` explains\.<br><br>Type: object<br>Required fields: \["curl","powershell"\]<br>Additional properties: false |
| /<wbr>properties/<wbr>commands/<wbr>properties/<wbr>curl | A curl command for a POSIX shell, writing the file under its name in the folder it runs in\. It fetches the link or sends the grant in the Authorization header\.<br><br>Type: string |
| /<wbr>properties/<wbr>commands/<wbr>properties/<wbr>powershell | An Invoke\-WebRequest command for Windows PowerShell, with \-UseBasicParsing: the same file, fetched through the link or with the grant in the Authorization header\.<br><br>Type: string |
| /<wbr>properties/<wbr>inline | Present where the call passed `inline` true\.<br><br>Type: object<br>Required fields: \["returned"\]<br>Additional properties: false |
| /<wbr>properties/<wbr>inline/<wbr>properties/<wbr>returned | Whether this answer carries the image as image content\.<br><br>Type: boolean |
| /<wbr>properties/<wbr>inline/<wbr>properties/<wbr>reason | Where not returned: the image passes the bound, or the call did not arrive over MCP\.<br><br>Type: string |
| /<wbr>properties/<wbr>detail | What happened and what to do next: the picture's place, its keep where limited, and the download's expiry, or the block's reason, with the month's use\.<br><br>Type: string |
| /<wbr>properties/<wbr>free\_images | The account's free images for this UTC month\.<br><br>Type: integer |

## Complete payload contract

```json
{
  "request": {
    "type": "object",
    "required": [
      "prompt"
    ],
    "properties": {
      "application": {
        "type": "string",
        "description": "An application id from `list_applications`, to keep the picture in its storage. Leave it out to keep the picture in your account for 7 days. An empty or non-text value is refused `invalid_request`."
      },
      "environment": {
        "type": "string",
        "pattern": "^(development|production)$",
        "description": "With `application` only: the partition receiving the file, or the app's deploy target if omitted. Without `application`, refused `invalid_request`. An environment the app lacks refuses `environment_not_created`."
      },
      "prompt": {
        "type": "string",
        "minLength": 1,
        "maxLength": 8000,
        "description": "The design asset to make, such as a hero image for your site or an app icon. It is sent to the model's provider. The platform keeps nothing about it."
      },
      "resolution": {
        "type": "string",
        "enum": [
          "1K",
          "2K"
        ],
        "description": "The image's size class; absent, `1K`."
      },
      "inline": {
        "type": "boolean",
        "description": "When true, a saved picture also appears as MCP image content if it is at most 256 KiB. A larger file, or a call over HTTP, includes no image content; the result explains why."
      }
    }
  },
  "response": {
    "type": "object",
    "required": [
      "contract_version",
      "model",
      "resolution",
      "used",
      "resets_at",
      "detail"
    ],
    "properties": {
      "contract_version": {
        "const": 1
      },
      "reference": {
        "type": "string",
        "pattern": "^[0-9a-f]{10}$",
        "description": "The short reference the platform recorded your call under: ten lowercase hexadecimal characters, the value in the call’s record row. Quote it when you report the call."
      },
      "application": {
        "type": "string",
        "description": "The application in your request. Absent in the account form."
      },
      "model": {
        "type": "string",
        "description": "The model the platform called."
      },
      "resolution": {
        "type": "string",
        "description": "The size class the call asked for."
      },
      "used": {
        "type": "integer",
        "description": "The account's images counted this UTC month: delivered images and calls whose give-back failed."
      },
      "cap": {
        "type": "integer",
        "description": "The former plans-model limit. Current responses omit this member."
      },
      "resets_at": {
        "type": "string",
        "description": "The first instant of the next UTC month, as an ISO 8601 instant."
      },
      "blocked": {
        "type": "boolean",
        "description": "True where the provider blocked the prompt or the picture: no file was written, the image is given back, and the file's members below are absent. A failed give-back stays counted and uncharged, as the detail says."
      },
      "reason": {
        "type": "string",
        "description": "With `blocked`: the provider's reason, in its own words."
      },
      "environment": {
        "type": "string",
        "description": "The application's partition holding the file. Absent in the account form or where `blocked`."
      },
      "area": {
        "type": "string",
        "description": "The file's area, `images-<application id>`. Absent in the account form or where `blocked`."
      },
      "name": {
        "type": "string",
        "description": "The file's name, which the platform chose. Absent where `blocked`."
      },
      "mime_type": {
        "type": "string",
        "description": "The file's type. Absent where `blocked`."
      },
      "bytes": {
        "type": "integer",
        "description": "The file's size. Absent where `blocked`."
      },
      "kept_until": {
        "type": "string",
        "description": "In the account form: when the picture stops being kept, 7 days after its write, as an ISO 8601 instant. Absent in the application form or where `blocked`."
      },
      "address": {
        "type": "string",
        "description": "The file's whole address on the platform's public origin, each segment of its name escaped. Absent where `blocked`."
      },
      "link": {
        "type": "string",
        "description": "In the account form: the address with read-only access for anyone holding it until `expires_at`. A new `renew_image_link` ends it. Absent where `blocked` or no link was made."
      },
      "expires_at": {
        "type": "string",
        "description": "When the link or the grant in the commands stops serving, as an ISO 8601 instant. Absent where `blocked` or minting failed. A link ends within one hour and by `kept_until`; an application's grant lasts five minutes."
      },
      "commands": {
        "type": "object",
        "required": [
          "curl",
          "powershell"
        ],
        "properties": {
          "curl": {
            "type": "string",
            "description": "A curl command for a POSIX shell, writing the file under its name in the folder it runs in. It fetches the link or sends the grant in the Authorization header."
          },
          "powershell": {
            "type": "string",
            "description": "An Invoke-WebRequest command for Windows PowerShell, with -UseBasicParsing: the same file, fetched through the link or with the grant in the Authorization header."
          }
        },
        "additionalProperties": false,
        "description": "Two download commands. In the account form they fetch `link` without a header. In the application form they send a read-only grant as the bearer. Absent where `blocked` or minting failed, as `detail` explains."
      },
      "inline": {
        "type": "object",
        "required": [
          "returned"
        ],
        "properties": {
          "returned": {
            "type": "boolean",
            "description": "Whether this answer carries the image as image content."
          },
          "reason": {
            "type": "string",
            "description": "Where not returned: the image passes the bound, or the call did not arrive over MCP."
          }
        },
        "additionalProperties": false,
        "description": "Present where the call passed `inline` true."
      },
      "detail": {
        "type": "string",
        "description": "What happened and what to do next: the picture's place, its keep where limited, and the download's expiry, or the block's reason, with the month's use."
      },
      "free_images": {
        "type": "integer",
        "description": "The account's free images for this UTC month."
      }
    }
  }
}
```

## Shared contracts

- [Refusals](/cloud/reference/refusals/): every refusal, by surface, with its cause and its remedy
- [schemas/wire\_error\.schema\.json](/cloud/reference/sources/schemas/wire-error-schema/)
- [schemas/wire\_errors\.json](/cloud/reference/sources/schemas/wire-errors/)
- [schemas/action\_payloads\.json](/cloud/reference/sources/schemas/action-payloads/) (includes shared shapes)
- [management\_api\_contract\.md](/cloud/reference/sources/management-api-contract/)
