Get Gemini LLM Responses Completed Tasks


This endpoint is designed to provide you with a list of completed tasks, which haven’t been collected yet. If you use the Standard method without specifying the postback_url, you can receive the list of id for all completed tasks using this endpoint. Then, you can collect the results using the ‘Task GET’ endpoint.

Learn more about task completion and obtaining a list of completed tasks in this help center article.

Tasks using the Standard method may take up to 72 hours to complete. If the task is not completed within this time, it is marked as failed, and the $0.01 advance is refunded. It is also important to note that if your account balance is negative, you will not receive the results even if the task is completed successfully.

Note: due to the peculiarities of our architecture the queue of completed tasks is updated with a small delay, which can be an issue for high-volume users. If your system requires collecting over 1000 tasks a minute, we recommend using pingbacks/postbacks instead, and applying the Tasks Ready endpoint only to obtain the IDs of failed postback tasks.

checked GET
Pricing

Your account will not be charged when receiving results

Each separate task will remain on the list until it is collected. You can make up to 20 API calls per minute. With each API call, you can get 1000 tasks completed within three previous days. The list will not contain the tasks which have already been collected and the tasks that were not collected within the three days after completion.

Please note that if you specify the postback_url, the task will not be in the list of completed tasks. The task can only be found in the list if the request to your server failed, and your server returned HTTP code response less than 200 or higher than 300.

‌‌As a response of the API server, you will receive JSON-encoded data containing a tasks array with the information specific to the set tasks.

Description of the fields in the results array:

Field nameTypeDescription
versionstring

the current version of the API

status_codeinteger

general status code
you can find the full list of the response codes here
Note: we strongly recommend designing a necessary system for handling related exceptional or error conditions

status_messagestring

general informational message
you can find the full list of general informational messages here

timestring

execution time, seconds

costfloat

total tasks cost, USD

tasks_countinteger

the number of tasks in the tasks array

tasks_errorinteger

the number of tasks in the tasks array returned with an error

tasksarray

array of tasks

    idstring

task identifier
unique task identifier in our system in the UUID format

    status_codeinteger

status code of the task
generated by DataForSEO; can be within the following range: 10000-60000
you can find the full list of response codes here

    status_messagestring

informational message of the task
you can find the full list of general informational messages here

    timestring

execution time, seconds

    costfloat

cost of the task, USD

    result_countinteger

number of elements in the result array

    patharray

URL path

    dataobject

contains the parameters passed in the request's URL

resultarray

array of results

    idstring

task identifier of the completed task
unique task identifier in our system in the UUID format

    sestring

LLM model specified when setting the task

    functionstring

type of the task

    date_postedstring

date when the task was posted (in the UTC format)

    tagstring

user-defined task identifier

    endpointstring

URL for collecting the results of the task


‌‌

Instead of ‘login’ and ‘password’ use your credentials from https://app.dataforseo.com/api-access

# Instead of 'login' and 'password' use your credentials from https://app.dataforseo.com/api-access 
login="login" 
password="password" 
cred="$(printf ${login}:${password} | base64)" 
curl --location --request GET "https://api.dataforseo.com/v3/ai_optimization/gemini/llm_responses/tasks_ready" 
--header "Authorization: Basic ${cred}"  
--header "Content-Type: application/json" 
--data-raw ""
<?php

/**
 * Method: GET
 * Endpoint: https://api.dataforseo.com/v3/ai_optimization/gemini/llm_responses/tasks_ready
 * @see https://docs.dataforseo.com/v3/ai_optimization/gemini/llm_responses/tasks_ready
 */

require_once __DIR__ . '/../../../../../lib/RestClient.php';
$config = require __DIR__ . '/../../../../../lib/config.php';

$client = new RestClient($config['base_url'], null, $config['login'], $config['password']);

try {
    $result = $client->get('/v3/ai_optimization/gemini/llm_responses/tasks_ready');
    print_r($result);
    // do something with get result
} catch (RestClientException $e) {
    printf(
        "HTTP code: %dnError code: %dnMessage: %snTrace: %sn",
        $e->getHttpCode(),
        $e->getCode(),
        $e->getMessage(),
        $e->getTraceAsString()
    );
}
?>
const axios = require('axios');

axios({
    method: 'get',
    url: 'https://api.dataforseo.com/v3/ai_optimization/gemini/llm_responses/tasks_ready',
    auth: {
        username: 'login',
        password: 'password'
    },
    headers: {
        'content-type': 'application/json'
    }
}).then(function (response) {
    var result = response['data']['tasks'][0]['result'];
    // Result data
    console.log(result);
}).catch(function (error) {
    console.log(error);
});
"""
Method: GET
Endpoint: https://api.dataforseo.com/v3/ai_optimization/gemini/llm_responses/tasks_ready
@see https://docs.dataforseo.com/v3/ai_optimization/gemini/llm_responses/tasks_ready
"""

import sys
import os
sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__), '../../../../../')))
from lib.client import RestClient
from lib.config import username, password
client = RestClient(username, password)

try:
    response = client.get('/v3/ai_optimization/gemini/llm_responses/tasks_ready')
    print(response)
    # do something with get result
except Exception as e:
    print(f'An error occurred: {e}')
using System;
using System.Linq;
using System.Net.Http;
using System.Net.Http.Headers;
using System.Text;
using System.Collections.Generic;
using System.Threading.Tasks;
using Newtonsoft.Json;
namespace DataForSeoSdk;

public class AiOptimization
{

    private static readonly HttpClient _httpClient;
    
    static AiOptimization()
    {
        _httpClient = new HttpClient
        {
            BaseAddress = new Uri("https://api.dataforseo.com/")
        };
        _httpClient.DefaultRequestHeaders.Authorization =
            new AuthenticationHeaderValue("Basic", ApiConfig.Base64Auth);
    }

    /// <summary>
    /// Method: GET
    /// Endpoint: https://api.dataforseo.com/v3/ai_optimization/gemini/llm_responses/tasks_ready
    /// </summary>
    /// <see href="https://docs.dataforseo.com/v3/ai_optimization/gemini/llm_responses/tasks_ready"/>
    
    public static async Task ChatGPTLlmResponsesTaskGet()
    {
		// #1 - using this method you can get a list of completed tasks
        using var response = await _httpClient.GetAsync("/v3/ai_optimization/gemini/llm_responses/tasks_ready");
        var tasksInfo = JsonConvert.DeserializeObject<dynamic>(await response.Content.ReadAsStringAsync());
        var tasksResponses = new List<object>();
        // you can find the full list of the response codes here https://docs.dataforseo.com/v3/appendix/errors
        if (tasksInfo.status_code == 20000)
        {
            if (tasksInfo.tasks != null)
            {
                foreach (var tasks in tasksInfo.tasks)
                {
                    if (tasks.result != null)
                    {
                        foreach (var task in tasks.result)
                        {
                            string taskEndpoint = null;                            
                            // #2 - using this method you can get results of each completed task
                            if (task.endpoint != null)
                                taskEndpoint = (string)task.endpoint;
                            
                            if (taskEndpoint != null)
                            {                                
                                using var taskGetResponse = await _httpClient.GetAsync(taskEndpoint);
                                var taskResultObj = JsonConvert.DeserializeObject<dynamic>(await taskGetResponse.Content.ReadAsStringAsync());
                                if (taskResultObj.tasks != null)
                                {
                                    var fst = taskResultObj.tasks.First;
                                    // you can find the full list of the response codes here https://docs.dataforseo.com/v3/appendix/errors
                                    if (fst.status_code >= 40000 || fst.result == null)
                                        Console.WriteLine($"error. Code: {fst.status_code} Message: {fst.status_message}");
                                    else
                                        tasksResponses.Add(fst.result);
                                }
                            }
                        }
                    }
                }
            }
            if (tasksResponses.Count > 0)
                Console.WriteLine(JsonConvert.SerializeObject(tasksResponses, Formatting.Indented));
            else
                Console.WriteLine("No completed tasks");
        }
        else
            Console.WriteLine($"error. Code: {tasksInfo.status_code} Message: {tasksInfo.status_message}");
    }

The above command returns JSON structured like this:

{
  "version": "0.1.20250526",
  "status_code": 20000,
  "status_message": "Ok.",
  "time": "0.1220 sec.",
  "cost": 0,
  "tasks_count": 1,
  "tasks_error": 0,
  "tasks": [
    {
      "id": "07151611-0696-0614-0000-2f58b489a3a1",
      "status_code": 20000,
      "status_message": "Ok.",
      "time": "0.0629 sec.",
      "cost": 0,
      "result_count": 3,
      "path": [
        "v3",
        "ai_optimization",
        "gemini",
        "llm_responses",
        "tasks_ready"
      ],
      "data": {
        "api": "ai_optimization",
        "function": "llm_responses",
        "se": "gemini"
      },
      "result": [
        {
          "id": "07141025-0696-0613-1000-29a9acb77e9c",
          "se": "gemini",
          "function": "llm_responses",
          "date_posted": "2025-07-14 07:25:54 +00:00",
          "tag": "",
          "endpoint": "/v3/ai_optimization/gemini/llm_responses/task_get/07141025-0696-0613-1000-29a9acb77e9c"
        },
        {
          "id": "07141400-0696-0613-0000-ece0beb3cbad",
          "se": "gemini",
          "function": "llm_responses",
          "date_posted": "2025-07-14 11:00:14 +00:00",
          "tag": "",
          "endpoint": "/v3/ai_optimization/gemini/llm_responses/task_get/07141400-0696-0613-0000-ece0beb3cbad"
        },
        {
          "id": "07141436-0696-0613-1000-7a2351ace6ab",
          "se": "gemini",
          "function": "llm_responses",
          "date_posted": "2025-07-14 11:36:36 +00:00",
          "tag": "",
          "endpoint": "/v3/ai_optimization/gemini/llm_responses/task_get/07141436-0696-0613-1000-7a2351ace6ab"
        }
      ]
    }
  ]
}