Call it
curl https://api.peume.com/v1/call/chatgpt-answer-with-shopping-and-ads \
-H "Authorization: Bearer $PEUME_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"input": {
"prompt": "best running shoes for flat feet",
"country": "US",
"state": "CA",
"legacy": true,
"include": "your include"
}
}'const res = await fetch("https://api.peume.com/v1/call/chatgpt-answer-with-shopping-and-ads", {
method: "POST",
headers: {
Authorization: `Bearer ${process.env.PEUME_API_KEY}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
"input": {
"prompt": "best running shoes for flat feet",
"country": "US",
"state": "CA",
"legacy": true,
"include": "your include"
}
}),
});
const { output, cost_usd } = await res.json();import os, requests
res = requests.post(
"https://api.peume.com/v1/call/chatgpt-answer-with-shopping-and-ads",
headers={"Authorization": f"Bearer {os.environ['PEUME_API_KEY']}"},
json={
"input": {
"prompt": "best running shoes for flat feet",
"country": "US",
"state": "CA",
"legacy": True,
"include": "your include"
}
},
)
print(res.json()["output"])Answer: {"id": "run_…", "status": "completed", "cost_usd": …, "output": {…}}. Long jobs answer 202 with a run id to read later. From an AI agent, connect the MCP server and ask for this by name: chatgpt-answer-with-shopping-and-ads.
Parameters
promptRequiredstring1-10,000 characters
Example: best running shoes for flat feet
countryRequiredstringISO 3166-1 alpha-2. CN, CZ, HK, IR, MO, RU and VE are refused.
Example: US
statestringUS state code for state-level targeting; adds 2 credits
Example: CA
legacyRequiredbooleanthe desktop UI, where ads and shopping render; free
disableWebSearchbooleananswer from the model alone, without a web search
includeRequiredobjectads and shopping are required; markdown and html are free, and rawResponse / searchQueries are in the same paid family, so they add nothing more.
