Appearance
ChatGPT LLM Responses Fresh
The LLM Responses ChatGPT API lets you generate structured responses from ChatGPT based on your specified input parameters. Send a query — DataForSEO routes it to ChatGPT and returns the response in a structured, machine-readable format.
Use this to audit how ChatGPT describes your brand, answers category questions, or positions competitors in its responses.
Available Endpoints
| Endpoint | Description |
|---|---|
| LLM Responses ChatGPT (Live/Standard) | Submit a query and receive ChatGPT's structured response |
| LLM Responses ChatGPT Models | List available ChatGPT model versions you can target |
Methods
This API supports both Live and Standard methods:
Live method — Instant results in a single POST. Execution time up to 120 seconds (AI response generation takes time). Max 30 simultaneous Live requests per account per platform.
Standard method — Asynchronous. POST to create a task, GET to retrieve results. Tasks may take up to 72 hours to complete but are more affordable than Live. Supports pingback_url and postback_url for webhook callbacks.
Standard Method Task Flow
- POST to task creation endpoint → receive task
id - Poll 'Tasks Ready' endpoint until your task
idappears - GET results via 'Task GET' endpoint using the
id
Alternatively, set postback_url in your POST request to receive results pushed to your server on completion.
Live Endpoint
POST https://api.dataforseo.com/v3/ai_optimization/chat_gpt/llm_responses/live
Submits a query to ChatGPT and returns the structured response immediately (up to 120 second wait).
Request Parameters
| Field | Type | Required | Description |
|---|---|---|---|
keyword | string | Yes | The query or prompt to send to ChatGPT |
language_code | string | No | Language for the response (e.g., "en") |
location_code | integer | No | Location context for the query |
model | string | No | Specific ChatGPT model to use. See Models endpoint for available values. |
postback_url | string | No | Webhook URL to receive results when complete (Standard method only) |
pingback_url | string | No | URL to ping on task completion (Standard method only) |
tag | string | No | Custom task identifier. Max 255 characters. |
Models Endpoint
GET https://api.dataforseo.com/v3/ai_optimization/chat_gpt/llm_responses/models
Returns the list of ChatGPT model versions available for use with the LLM Responses endpoint. Check this endpoint to get current model IDs before submitting requests.
bash
curl --request GET \
--url https://api.dataforseo.com/v3/ai_optimization/chat_gpt/llm_responses/models \
--header 'Authorization: Basic BASE64(login:password)'cURL Example — Live Request
bash
curl --request POST \
--url https://api.dataforseo.com/v3/ai_optimization/chat_gpt/llm_responses/live \
--header 'Authorization: Basic BASE64(login:password)' \
--header 'Content-Type: application/json' \
--data '[
{
"keyword": "What are the best roofing contractors in Miami?",
"language_code": "en",
"location_code": 2840
}
]'cURL Example — Standard Method Task Post
bash
curl --request POST \
--url https://api.dataforseo.com/v3/ai_optimization/chat_gpt/llm_responses/task_post \
--header 'Authorization: Basic BASE64(login:password)' \
--header 'Content-Type: application/json' \
--data '[
{
"keyword": "What is the best CRM software for real estate agents?",
"language_code": "en",
"postback_url": "https://your-server.com/webhook/chatgpt-results"
}
]'Python Example — Live Query
python
import requests
from requests.auth import HTTPBasicAuth
import json
import time
def query_chatgpt(prompt, language_code="en", location_code=2840, model=None):
payload = [{
"keyword": prompt,
"language_code": language_code,
"location_code": location_code
}]
if model:
payload[0]["model"] = model
response = requests.post(
"https://api.dataforseo.com/v3/ai_optimization/chat_gpt/llm_responses/live",
auth=HTTPBasicAuth("your_login", "your_password"),
headers={"Content-Type": "application/json"},
data=json.dumps(payload),
timeout=130 # Allow up to 120s execution + buffer
)
data = response.json()
return data["tasks"][0]["result"]
# Audit brand mentions in ChatGPT responses
brand_queries = [
"What are the top HVAC companies in Phoenix?",
"Who are the best roofing contractors in Florida?",
"What CRM do roofing companies use?",
]
for query in brand_queries:
print(f"\nQuery: {query}")
result = query_chatgpt(query)
if result:
print(f"Response: {result[0].get('items', [{}])[0].get('text', 'No text')}")
time.sleep(2) # Respect rate limitsPython Example — Standard Method with Polling
python
import requests
from requests.auth import HTTPBasicAuth
import json
import time
LOGIN = "your_login"
PASSWORD = "your_password"
auth = HTTPBasicAuth(LOGIN, PASSWORD)
headers = {"Content-Type": "application/json"}
base_url = "https://api.dataforseo.com/v3/ai_optimization/chat_gpt/llm_responses"
def post_task(prompt):
payload = [{"keyword": prompt, "language_code": "en"}]
r = requests.post(f"{base_url}/task_post", auth=auth, headers=headers, data=json.dumps(payload))
task_id = r.json()["tasks"][0]["id"]
print(f"Task created: {task_id}")
return task_id
def poll_for_results(task_id, max_wait=7200, interval=60):
elapsed = 0
while elapsed < max_wait:
# Check Tasks Ready endpoint
r = requests.get(f"{base_url}/tasks_ready", auth=auth, headers=headers)
ready_tasks = r.json().get("tasks", [])
for task in ready_tasks:
if task["id"] == task_id:
# Retrieve results
result_r = requests.get(
f"{base_url}/task_get/{task_id}",
auth=auth,
headers=headers
)
return result_r.json()
print(f"Task not ready yet. Waiting {interval}s... ({elapsed}s elapsed)")
time.sleep(interval)
elapsed += interval
return None
# Usage
task_id = post_task("Which brands are most mentioned when people ask AI about local SEO tools?")
results = poll_for_results(task_id)
if results:
print(json.dumps(results["tasks"][0]["result"], indent=2))Use Cases
Brand Audit — Submit category-level queries ("best [product] in [city]") and check whether your brand appears in ChatGPT's response.
Competitor Comparison — Query "compare [your brand] vs [competitor]" to see how ChatGPT frames the differences.
Content Gap Detection — Identify what sources ChatGPT cites in responses about your industry. These are the pages earning AI traffic that you may not be targeting.
Messaging Alignment — Test whether ChatGPT's description of your product or service aligns with your actual positioning.
Market Research — Query industry questions to extract how ChatGPT summarizes market dynamics, common use cases, and buyer considerations.
Rate Limits and Timeouts
| Metric | Value |
|---|---|
| API calls per minute | 2,000 |
| Simultaneous Live requests per platform | 30 |
| Live method execution time | Up to 120 seconds |
| Standard method completion time | Up to 72 hours |
Set your HTTP client timeout to at least 130 seconds for Live requests to avoid premature timeouts.
Notes
- Each POST can contain one or more tasks, subject to standard API limits.
- The
modelparameter lets you target specific ChatGPT versions. Use the Models endpoint to get current valid model IDs. postback_urlpushes completed Standard method results to your webhook — the preferred pattern for batch processing without polling.- Results include the raw LLM response text and structured metadata. The exact response schema depends on the model and query type.
- Sandbox is available for free testing at no credit cost.