ShareAI Platform Docs

Generate an image

Create images with the ShareAI Images API using a supported model, a text prompt and validated image-generation options.

View as Markdown
On this page
POST https://api.shareai.now/api/v1/images/generations

Generate an image from a text prompt.

Base URL
https://api.shareai.now
Authentication
Bearer API key or approved OAuth access token

Use an image model currently enabled on ShareAI and allowed by your credential. The model determines which sizes, quality levels and output options it supports.

Send a request#

cURL

curl --fail-with-body --request POST \
  "https://api.shareai.now/api/v1/images/generations" \
  -H "Authorization: Bearer $SHAREAI_API_KEY" \
  -H "Content-Type: application/json" \
  --data '{
  "model": "YOUR_IMAGE_MODEL",
  "prompt": "A quiet forest painted in watercolor.",
  "n": 1,
  "size": "1024x1024"
}'

Request fields#

FieldValue
modelAn enabled image-generation model ID.
promptA nonempty text description.
nNumber of images, from 1 to 10, subject to model support.
size / qualityOptional model-supported size and quality values.
response_format / output_formatOptional model-supported response and file-format settings.
backgroundOptional background setting supported by the model.

Read the image#

Inspect the returned data entries. Depending on the model and requested format, an entry contains an HTTPS image URL or base64 image data. Use the actual returned format; do not assume every provider returns a URL. The API does not download returned image URLs for you.

Size and timing limits#

Requests are synchronous. Combined text is limited to 256 KiB, the provider call to 120 seconds and the response to 2 MiB. Large base64 images can exceed that response limit. Select a suitable output size or a model that supports URL output.

Retry carefully#

Generating an image can incur usage. After a timeout or an ambiguous network failure, check activity before retrying; repeating the request can generate and charge for another image. The API does not automatically retry an image request after submission to a provider.

Supported operations#

This route generates images from text. Image edits, variations, multipart uploads and streaming image generation are not supported. Current billing requires a compatible model/provider token-usage contract; per-image-only providers may be unavailable.

Use customer authorization#

For an approved OAuth flow, send the access token as Bearer. Account-funded image generation requires surcharge and an accepted usage plan. All model, provider and account restrictions remain in force.

Last updated September 15, 2026

ShareAI Platform Docs
All documentation

Search by title or content.

Ask about this page

Choose an assistant to explore this page. You can also copy the page and paste it into your conversation.

Ask ChatGPTAsk ClaudeAsk GrokAsk ShareAI