跳转到主要内容
POST
Ask ChatGPT

授权

Authorization
string
header
必填

Your API key, sent as Authorization: Bearer <key>.

请求头

Prefer
string

wait=<seconds> holds the request at most that long, up to 290. wait=0 answers with the task id at once and queues the task when every concurrency slot is taken.

示例:

"wait=120"

请求体

application/json
prompt
string
必填

The question, for LLM engines.

country
string

ISO 3166-1 alpha-2 country code, case-insensitive. Omitted, empty or null means US (KR for NAVER_* engines). A value that is not an officially assigned code, such as UK (use GB), is rejected with 400 VALIDATION_ERROR, and a country this engine cannot serve is rejected at submit time with 422.

示例:

"US"

include
object

Optional output flags. markdown, rawResponse, searchQueries, ads and shopping are ignored by engines that do not support them. citationLinks is PERPLEXITY only and requires markdown: true. analysis on an unsupported engine is rejected with 422 VALIDATION_ERROR, html with 422 EVIDENCE_UNSUPPORTED, and screenshot: true with 400 VALIDATION_ERROR on every engine. See the engine guide for the support table.

state
string

CHATGPT, BING_AIMODE, GEMINI, GOOGLE, AIMODE and GOOGLE_SERP. A US state as its two-letter code, case-insensitive; GET /v1/states?country=US lists them. CHATGPT and BING_AIMODE ask from a residential connection in the state, GEMINI asks as a device in its largest city, and the Google engines search with the state as Google's location, so local recommendations come from that state. Sent with country US or without country; another country, a code that is not a state, or state together with uule is rejected with 400 VALIDATION_ERROR, and other engines reject it with 422 LOCATION_UNSUPPORTED. Adds 1 credit to the task. The response echoes it as state.

Pattern: ^[A-Za-z]{2}$
示例:

"TX"

location
object

CHATGPT, GEMINI, GOOGLE, AIMODE and GOOGLE_SERP. Answers as a user at this point would see it, in WGS84 decimal degrees: latitude -90 to 90, longitude -180 to 180, these two keys only. Sent together with uule, it is rejected with 400 VALIDATION_ERROR, and other engines reject it with 422 LOCATION_UNSUPPORTED. Adds 1 credit to the task. The response echoes it as location.

示例:

CHATGPT only. false asks with ChatGPT's search toggle off, so ChatGPT chooses on its own when to search. Applies to every answer of the task, followUps included. Rejected with 422 EVIDENCE_UNSUPPORTED together with include.html.

images
string[]

CHATGPT only. Photos asked with the first question, the way a user adds them with ChatGPT's photo button: JPEG, PNG, WebP or GIF, up to 10 MB each. A data URL counts toward the request body limit (1 MiB on POST /v1/async/task). followUps keep asking about the photos in the same conversation, at 1 credit per answer. Rejected with 400 VALIDATION_ERROR together with country CN or HK, or continueFrom, and with 422 EVIDENCE_UNSUPPORTED together with include.html. Other engines reject it with 400 VALIDATION_ERROR. A photo that cannot be fetched or read fails the task with BAD_PAYLOAD.

Required array length: 1 - 4 elements

A public http(s) URL, or a data URL: data:image/jpeg, png, webp or gif;base64,.

示例:
followUps
object[]

CHATGPT only. Questions asked after the first answer in the same conversation, in order. Each answer costs 1 credit. The result lists the answers in followUps and, when a select cannot be pressed, where and why the turns stopped in followUpsStopped.

Required array length: 1 - 4 elements
continueFrom
string<uuid>

CHATGPT only. The id of a completed CHATGPT task of this account: asks one more question in its conversation, under its last answer, with either prompt or select. country and state carry over; leave them out or send the same values. The result carries conversation (id, turn, expiresAt) and, when it pressed a form, selection. Rejected before any charge with 400 VALIDATION_ERROR (another account's or engine's task, a task not completed, an invalid select) or 400 CONVERSATION_EXPIRED (after conversation.expiresAt, 3 hours after the conversation's first answer).

select
object

With continueFrom, instead of prompt: press a follow-up form's button in the last answer of the continued task. Answers that show a form list them in forms (buttons in button order, choices with their name, the option selected at first and the options).

brand
string

With include.analysis: your brand's name, reported in analysis.targets with role brand.

Maximum string length: 200
brandAliases
string[]

With include.analysis and brand: other names the answer may use for your brand.

Maximum array length: 20
Maximum string length: 200
brandDomains
string[]

With include.analysis and brand: your sites, such as example.com. A citation on one of them or a subdomain has kind owned.

Maximum array length: 20
示例:
competitors
(string | object)[]

With include.analysis: competitors reported in analysis.targets with role competitor. A citation on one of their domains has kind competitor.

Maximum array length: 50
Maximum string length: 200
idempotencyKey
string

Optional. A repeat of the key within at least 30 days answers with the task that holds it, so a caller that hung up can ask again.

priority
integer
默认值:1

Compatibility field; does not guarantee execution order. Values outside 1–10 are clamped, not rejected.

必填范围: 1 <= x <= 10
webhook
object

Optional. Omit to collect the result by polling instead.

响应

The task ended: the body GET /v1/async/task/{id} returns, with the result in response or the reason in error.

success
boolean
必填
task
object
必填
credits
object
必填

Credits, with up to two decimals (for example 1.25). The submit response always shows 0: nothing is charged yet, and the task's price is held from your balance when it starts. Polling shows 0 until the task is terminal, then the settled charge: the task's price for COMPLETED, 0 for FAILED. A task webhook reports the same charge in creditsCharged; on a FAILED task it reports the task's price in creditsToCharge and 0 in creditsCharged. CITATION_ANALYSIS, GOOGLE_PLACES and GOOGLE_NEWS are charged by usage, up to the hold placed when the task starts.

response
object

The engine-specific result. Absent until the task is terminal. See the Engines guide for per-engine shapes. NAVER_AI_TAB preserves the original text, markdown, sources and cards when Naver returns HTTP success, a valid stream ending in done, and nonempty answer text with unknown_error. It includes upstreamError and returns immediately without retrying or rephrasing, even with retryQuery. COMPLETED means collection finished; the answer may still be incomplete. Empty, cut-off or malformed streams still fail. Policy refusals complete with a policy_declined notice. rawContent is returned only with include.rawResponse. With include.citationAnalysis, answer results also carry citationAnalysis (see Include). CITATION_ANALYSIS returns CitationAnalysisResult; see the Citation Analysis guide. PROMPT_RESEARCH returns PromptResearchResult; see the Prompt Research guide. GEO_SCORE returns GeoScoreResult; see the GEO Score guide. Answer engines with include.analysis add analysis (AnswerAnalysis).

error
string

Present when task.status is FAILED. A plain string, not the {code, message, timestamp} object used by request-level errors.