payload.country follows each engine’s country rules and defaults. Doubao always asks from mainland China. payload.location sets the question’s location on supported engines. Check the engine-specific rules below before submitting.
Country
Send an ISO 3166-1 alpha-2 code inpayload.country:
400 VALIDATION_ERROR. The default and the meaning of country depend on the engine:
Unsupported countries
AtaskType and country pair that cannot be served returns 422 REGION_UNSUPPORTED at submit. Retrying does not help.
Read
countries.policy for each engine in GET /v1/capabilities: only lists supported countries; all_except lists exclusions. Commerce lists the countries across its catalogue; each request must still match its site or product URL. Country acceptance and execution location follow the engine-specific rules above. The following error includes the cause in details:
Location
Setpayload.location to the point the question is asked from, as latitude and longitude in decimal degrees. The engine answers as a user standing there, so “near me” questions bring places around that point. country sets the market and location sets where the user stands, so send a point inside country. This request asks ChatGPT from SoHo, New York:
location must be an object with exactly two keys: latitude (-90 to 90) and longitude (-180 to 180). Other keys or out-of-range values return 400 VALIDATION_ERROR. Map apps show the coordinates of any spot you pick, and the dashboard’s Playground finds them for a place name.
List what each engine serves
GET /v1/capabilities returns every public taskType with its aliases, input fields, price, location support and country policy. It needs no API key, is read from the same rules that enforce submits, and can be cached for 5 minutes. Add ?taskType= to get one engine; aliases are accepted.
An unknown
taskType returns 400 VALIDATION_ERROR. See also the capabilities reference.