Request Example
The Nano Banana Tasks API can be used to query the results of the Nano Banana Images API. For information on how to use the Nano Banana Images API, please refer to the document Nano Banana Images API. We will demonstrate how to use this API with an example task ID returned by the Nano Banana Images API. Suppose we have a task ID: 4d320ead-4af4-4a55-8f3e-f2afebdf4fd0, we will show how to pass in a task ID.Task Example Image

Setting Request Headers and Request Body
Request Headers include:accept: Specifies that the response should be in JSON format, set toapplication/json.authorization: The key for calling the API, which can be selected directly after application.
id: The uploaded task ID.action: The operation method for the task.

Code Example
You can see that various language codes have been automatically generated on the right side of the page, as shown in the image:
CURL
Python
Response Example
Upon successful request, the API will return the details of the task here. For example:id: The ID of the generated task, used to uniquely identify this generation task.request: The request information in the task query.response: The return information in the task query.
Batch Query Operation
This is for querying task details for multiple task IDs, and unlike the above, the action needs to be selected asretrieve_batch.
Request Body includes:
ids: An array of uploaded task IDs.action: The operation method for the task.
Response Example
Upon successful request, the API will return the specific details of all batch tasks. For example:items: All specific details of the batch tasks. It is an array, and each element of the array has the same format as the return result of querying a single task.count: The number of tasks in this batch query.
Error Handling
When calling the API, if an error occurs, the API will return the corresponding error code and message. For example:400 token_mismatched: Bad request, possibly due to missing or invalid parameters.400 api_not_implemented: Bad request, possibly due to missing or invalid parameters.401 invalid_token: Unauthorized, invalid or missing authorization token.429 too_many_requests: Too many requests, you have exceeded the rate limit.500 api_error: Internal server error, something went wrong on the server.

