NAVNavbar
cURL php NodeJS Python cSharp

Get LLM Responses Chat GPT Results by id


Chat GPT LLM Responses endpoint allows you to retrieve structured responses from a specific Chat GPT model, based on the input parameters.

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.

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

<?php

/**
 * Method: GET
 * Endpoint: https://api.dataforseo.com/v3/ai_optimization/chat_gpt/llm_responses/task_get/$id
 * @see https://docs.dataforseo.com/v3/ai_optimization/chat_gpt/llm_responses/task_get
 */

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

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

try {
    $taskId = '07211938-0696-0613-0000-674a0f948d6b';
    $result = $client->get("/v3/ai_optimization/chat_gpt/llm_responses/task_get/{$taskId}");
    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()
    );
}

?>

The above command returns JSON structured like this:

{
  "version": "0.1.20250724",
  "status_code": 20000,
  "status_message": "Ok.",
  "time": "0.0849 sec.",
  "cost": 0,
  "tasks_count": 1,
  "tasks_error": 0,
  "tasks": [
    {
      "id": "02249714-1807-0791-0000-0423e705a8rr",
      "status_code": 20000,
      "status_message": "Ok.",
      "time": "0.0310 sec.",
      "cost": 0,
      "result_count": 1,
      "path": [
        "v3",
        "ai_optimization",
        "chat_gpt",
        "llm_responses",
        "task_get",
        "07241735-1535-0613-0000-0722e701b5ff"
      ],
      "data": {
        "api": "ai_optimization",
        "function": "llm_responses",
        "se": "chat_gpt",
        "system_message": "communicate as if we are in a business meeting",
        "message_chain": [
          {
            "role": "user",
            "message": "Hello, what's up?"
          },
          {
            "role": "ai",
            "message": "Hello! I’m doing well, thank you. How can I assist you today? Are there any specific topics or projects you’d like to discuss in our meeting?"
          }
        ],
        "max_output_tokens": 1024,
        "temperature": 0.3,
        "top_p": 0.5,
        "web_search_country_iso_code": "FR",
        "model_name": "gpt-4.1-mini",
        "web_search": true,
        "user_prompt": "provide information on how relevant the amusement park business is in France now"
      },
      "result": [
        {
          "model_name": "gpt-4.1-mini-2025-04-14",
          "input_tokens": 374,
          "output_tokens": 594,
          "web_search": true,
          "money_spent": 0.0286,
          "datetime": "2025-07-17 11:58:28 +00:00",
          "items": [
            {
              "type": "message",
              "sections": [
                {
                  "type": "text",
                  "text": "The amusement park industry in France remains a significant contributor to the country's economy and tourism sector. In 2024, the French amusement parks market generated approximately USD 3.25 billion in revenue and is projected to reach USD 4.27 billion by 2030, growing at a compound annual growth rate (CAGR) of 4.4% from 2025 to 2030. ([grandviewresearch.com](https://www.grandviewresearch.com/horizon/outlook/amusement-parks-market/france?utm_source=openai))\n\nFrance is home to several major amusement parks that attract millions of visitors annually. Disneyland Paris, Europe's most visited theme park, welcomed over 375 million visitors by 2022. In 2023, it generated a profit of $343 million for Disney. ([en.wikipedia.org](https://en.wikipedia.org/wiki/Disneyland_Paris?utm_source=openai)) Parc Astérix, another prominent park, achieved a record attendance of over 2.8 million visitors in 2023. ([en.wikipedia.org](https://en.wikipedia.org/wiki/Parc_Ast%C3%A9rix?utm_source=openai)) Le Puy du Fou, known for its historical theme, attracted 2.8 million visitors in 2024, making it the third most visited park in France that year. ([en.wikipedia.org](https://en.wikipedia.org/wiki/Le_Puy_du_Fou?utm_source=openai))\n\nThe industry is also witnessing technological advancements, with parks incorporating augmented reality (AR) and virtual reality (VR) attractions to enhance visitor experiences. Additionally, there is a growing emphasis on sustainability, with parks implementing eco-friendly practices such as recycling programs and energy-efficient operations. ([6wresearch.com](https://www.6wresearch.com/industry-report/france-amusement-park-market-outlook?utm_source=openai))\n\nHowever, the sector faces challenges, including rising operational costs and changing consumer preferences. In 2024, the average price of a hotel night in France increased by 26% since 2019, leading to shorter vacations and a shift towards budget-friendly accommodations. ([lemonde.fr](https://www.lemonde.fr/en/economy/article/2024/10/19/when-vacations-keep-getting-more-expensive_6729824_19.html?utm_source=openai)) Despite these challenges, the amusement park industry in France continues to be a vital and evolving part of the country's tourism landscape.\n\n\n## Rising Costs Impacting French Vacation Habits:\n- [When vacations keep getting more expensive](https://www.lemonde.fr/en/economy/article/2024/10/19/when-vacations-keep-getting-more-expensive_6729824_19.html?utm_source=openai) ",
                  "annotations": [
                    {
                      "title": "France Amusement Parks Market Size & Outlook, 2030",
                      "url": "https://www.grandviewresearch.com/horizon/outlook/amusement-parks-market/france?utm_source=openai"
                    },
                    {
                      "title": "Disneyland Paris",
                      "url": "https://en.wikipedia.org/wiki/Disneyland_Paris?utm_source=openai"
                    },
                    {
                      "title": "Parc Astérix",
                      "url": "https://en.wikipedia.org/wiki/Parc_Ast%C3%A9rix?utm_source=openai"
                    },
                    {
                      "title": "Le Puy du Fou",
                      "url": "https://en.wikipedia.org/wiki/Le_Puy_du_Fou?utm_source=openai"
                    },
                    {
                      "title": "France Amusement park Market (2025-2031) | Industry & Revenue",
                      "url": "https://www.6wresearch.com/industry-report/france-amusement-park-market-outlook?utm_source=openai"
                    },
                    {
                      "title": "When vacations keep getting more expensive",
                      "url": "https://www.lemonde.fr/en/economy/article/2024/10/19/when-vacations-keep-getting-more-expensive_6729824_19.html?utm_source=openai"
                    },
                    {
                      "title": "When vacations keep getting more expensive",
                      "url": "https://www.lemonde.fr/en/economy/article/2024/10/19/when-vacations-keep-getting-more-expensive_6729824_19.html?utm_source=openai"
                    }
                  ]
                }
              ]
            }
          ]
        }
      ]
    }
  ]
}

Description of the fields for sending a request:

Field name Type Description
id string task identifier
unique task identifier in our system in the UUID format
you will be able to use it within 30 days to request the results of the task at any time


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 name Type Description
version string the current version of the API
status_code integer 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_message string general informational message
you can find the full list of general informational messages here
time string execution time, seconds
cost float total tasks cost, USD
tasks_count integer the number of tasks in the tasks array
tasks_error integer the number of tasks in the tasks array returned with an error
tasks array array of tasks
        id string task identifier
unique task identifier in our system in the UUID format
        status_code integer status code of the task
generated by DataForSEO; can be within the following range: 10000-60000
you can find the full list of the response codes here
        status_message string informational message of the task
you can find the full list of general informational messages here
        time string execution time, seconds
        cost float cost of the task, USD
includes the base task price plus the money_spent value
        result_count integer number of elements in the result array
        path array URL path
        data object contains the same parameters that you specified in the POST request
        result array array of results
            model_name string name of the AI model used
            input_tokens integer number of tokens in the input
total count of tokens processed
            output_tokens integer number of tokens in the output
total count of tokens generated in the AI response
            web_search boolean indicates if web search was used
            money_spent float cost of AI tokens, USD
the price charged by the third-party AI model provider for according to its Pricing
            datetime string date and time when the result was received
in the UTC format: “yyyy-mm-dd hh-mm-ss +00:00”
example:
2019-11-15 12:57:46 +00:00
            items array array of response items
contains structured AI response data
                type string type of the element = ‘message’
                sections array array of content sections
contains different parts of the AI response
                    type string type of element = ‘text’
                    text string AI-generated text content
                    annotations array array of references used to generate the response
equals null if the web_search parameter is not set to true
Note: annotations may return empty even when web_search is true, as the AI will attempt to retrieve web information but may not find relevant results
                       title string the domain name or title of the quoted source
                       url string URL of the quoted source

‌‌