Call it
curl https://api.peume.com/v1/call/ask-chatgpt \
-H "Authorization: Bearer $PEUME_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"input": {
"user_prompt": "your user prompt",
"model_name": "your model name"
}
}'const res = await fetch("https://api.peume.com/v1/call/ask-chatgpt", {
method: "POST",
headers: {
Authorization: `Bearer ${process.env.PEUME_API_KEY}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
"input": {
"user_prompt": "your user prompt",
"model_name": "your model name"
}
}),
});
const { output, cost_usd } = await res.json();import os, requests
res = requests.post(
"https://api.peume.com/v1/call/ask-chatgpt",
headers={"Authorization": f"Bearer {os.environ['PEUME_API_KEY']}"},
json={
"input": {
"user_prompt": "your user prompt",
"model_name": "your model name"
}
},
)
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: ask-chatgpt.
Parameters
user_promptRequiredstringThe question or instruction sent to the model.
model_nameRequiredstringModel name from /ai/chatgpt-models, e.g. 'gpt-4o-mini'; a bare family name picks its latest version.
max_output_tokensintegerMaximum answer tokens (1-1024, default 1024); caps the LLM token cost.
temperaturenumberRandomness of the AI response (default 0; max 2)
top_pnumberDiversity of the AI response (default 0; max 1)
web_searchbooleanEnable web search (default false)
force_web_searchbooleanForce AI agent to use web search (default false)
web_search_country_iso_codestringISO country code of the location
web_search_citystringCity name of the location
system_messagestringInstructions for the AI behaviour
message_chainarrayMessage chain
