Google logo

gemini-3.1-flash-image-preview-token API

gemini-3.1-flash-image-preview-token

Generate images with gemini-3.1-flash-image-preview-token through the APINEED asynchronous media API.

Submit a task, save its ID, and poll the task endpoint for its status and result URLs.

MODALITIES
CONTEXTN/A

Playground

Generate with gemini-3.1-flash-image-preview-token, review the output, and use the same request shape in your application.

No supported image request format is published for this model yet.
Workflow
Estimating does not generate media or charge your balance. Reference files, if selected, upload to temporary private storage. Settings without published options use upstream defaults.
Sign in required. Final cost uses completed usage.
Output Ready
Nano Banana 2 generated image example 5
Sample output
Request preview
{
  "model": "gemini-3.1-flash-image-preview-token",
  "workflow": "text_to_image",
  "input": {
    "prompt": "A refined product photograph with natural lighting, realistic materials and a clean background."
  },
  "output": {
    "count": 1
  }
}

APINEED pricing

Pay as you go. Current selling prices in USD.

Get API Key

Image output

$39.00 – $62.985
APINEED rate/ 1M image tokens

Input

$0.325 – $0.524875
APINEED rate/ 1M tokens

Text output

$1.95 – $3.14925
APINEED rate/ 1M tokens

Web search

$9.10 – $14.6965
APINEED rateper thousand queries

Quick Start

Call gemini-3.1-flash-image-preview-token with the endpoint and request format shown below.

1

Create an API key

Store your APINEED key server-side as API_NEED_API_KEY.

export API_NEED_API_KEY=sk-apineed-v1-...
2

Send the request

Use gemini-3.1-flash-image-preview-token with POST /v1/media/generations.

curl https://apineed.com/v1/media/generations \
  -H "Authorization: Bearer $API_NEED_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "model": "gemini-3.1-flash-image-preview-token",
  "workflow": "text_to_image",
  "input": {
    "prompt": "A refined product photograph with natural lighting, realistic materials and a clean background."
  },
  "output": {
    "count": 1
  }
}'
3

Poll the task

Save id, then poll GET /v1/media/generations/{id} every few seconds until the task is succeeded or failed.

curl https://apineed.com/v1/media/generations/$TASK_ID -H "Authorization: Bearer $API_NEED_API_KEY"
const images = task.outputs.filter((item) => item.type === "image").map((item) => item.url);

gemini-3.1-flash-image-preview-token API Endpoint

Create an asynchronous image task, then use its task ID to retrieve status and direct object-storage output URLs.

POST/v1/media/generations
Authorization
Bearer $API_NEED_API_KEY
Content-Type
application/json
HTTP-Referer
optional - your site URL, for rankings
Model
gemini-3.1-flash-image-preview-token
GET/v1/media/generations/{id}
Authorization
Bearer $API_NEED_API_KEY
Content-Type
application/json
HTTP-Referer
optional - your site URL, for rankings
Model
gemini-3.1-flash-image-preview-token

Parameters

Use the supported parameters below. Leave optional fields out to use the service defaults.

NameTypeValuesDescription
modelstringRequiredUse gemini-3.1-flash-image-preview-token.
workflowstringtext_generation, text_to_image, image_editUse an APINEED-supported workflow.
input.promptstringRequiredDescribe the requested image.
input.assetsarrayRequired for image_editImage URLs with role input_image; up to 1 references.

gemini-3.1-flash-image-preview-token API questions

Practical answers for choosing, integrating, pricing, and operating the gemini-3.1-flash-image-preview-token API on APINEED.

Which model ID should I use for gemini-3.1-flash-image-preview-token?

Use gemini-3.1-flash-image-preview-token, exactly as returned by the API Need pricing API.

Which endpoint should I use?

Send a POST request to /v1/media/generations using your APINEED API key. Save the returned task ID, then poll GET /v1/media/generations/{id} until the task succeeds or fails. Follow the request example and parameter table on this page.

How is the API Need price calculated?

See Pricing for the current rates and discounts. Final charges use recorded usage.

How to deploy gemini-3.1-flash-image-preview-token

Connect gemini-3.1-flash-image-preview-token to your application through the APINEED media API.

1

Add credits

Add APINEED credits before submitting a billable generation.

2

Create an API key

Create and securely store an APINEED API key.

3

Configure the endpoint

Send gemini-3.1-flash-image-preview-token requests to /v1/media/generations.

4

Track the task

Poll the returned task ID and store the completed image URL from outputs[].

More live models