web_search), read the result, and decide whether to continue or answer. Prompts that work well with single-shot LLMs often underperform here, because the same text shapes tool selection, search query generation, and final response together.
Two parameters drive most of the prompt design:
instructionssets the role, tone, formatting, and grounding rules that apply regardless of the user’s question.inputholds the actual question. It also seeds the first search query, so specificity here directly improves retrieval.
Instructions
Use theinstructions parameter for role, tone, language, formatting, and grounding rules. Instructions apply on every turn of the agent loop, so put things here that hold regardless of the user’s question.
Setting
instructions with an effort level replaces the effort level’s system prompt — it does not append. Each effort level (fast, low, medium) already covers tool-call discipline, query construction, citation, and formatting, so the effort level’s prompt should be overridden only when app-specific behavior is needed. Without an effort level, instructions is the only system prompt the model sees.Instructions
You are a financial analyst writing for retail investors.
Rules:
- Aim for brief sentences and paragraphs.
- Define jargon the first time you use it.
- Prefer concrete numbers over vague qualifiers ("up 12% YoY" not "growing
strongly").
Grounding rules:
- Cite sources inline by domain, e.g. (reuters.com). Do not write full URLs.
- If searches return no relevant results after trying alternative phrasings,
or if the only matches are off-topic (different company, different fiscal year,
etc.), say so explicitly rather than substituting related results.
instructions focused. They are re-read on every turn of the agent loop, so bloat compounds across tool calls. If your block is growing long, check whether parts of it would be better expressed as request parameters: use response_format with a JSON schema for machine-readable output, web_search filters for retrieval constraints, or move query-specific framing into input.
Built-in tools like web_search and fetch_url are tuned to work well without prompt-side guidance. You don’t need to describe what they do, when to call them, or how to construct queries. Adjust tool-call count with the max_steps parameter and search constraints with web_search filters. If you’re using custom instructions and want to nudge how the model uses built-in tools, you can reference them there as well.
For custom function tools you define yourself, the model relies on the description and parameter schema you provide, so make those as clear as you can. You can reinforce the tool’s role in instructions if the description alone isn’t enough to steer behavior.
Input
Use theinput parameter for the actual query you want answered. Input strongly shapes search behavior, so descriptive and specific phrasing directly improves retrieval. Vague inputs lead to vague searches.
Example user prompt:
Input
What are the best sushi restaurants in the world currently?
API Example
from perplexity import Perplexity
client = Perplexity()
response = client.responses.create(
effort="low",
input="Explain how hosted LLM API pricing is typically structured: input vs output tokens, context window limits, and the implication for long-document workloads.",
instructions="You are a concise, well-researched assistant. If searches still return no relevant results after trying alternative phrasings, say so explicitly rather than guessing."
)
print(response.output_text)
import Perplexity from '@perplexity-ai/perplexity_ai';
const client = new Perplexity();
const response = await client.responses.create({
effort: "low",
input: "Explain how hosted LLM API pricing is typically structured: input vs output tokens, context window limits, and the implication for long-document workloads.",
instructions: "You are a concise, well-researched assistant. If searches still return no relevant results after trying alternative phrasings, say so explicitly rather than guessing."
});
console.log(response.output_text);
curl https://api.perplexity.ai/v1/agent \
-H "Authorization: Bearer $PERPLEXITY_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"effort": "low",
"input": "Explain how hosted LLM API pricing is typically structured: input vs output tokens, context window limits, and the implication for long-document workloads.",
"instructions": "You are a concise, well-researched assistant. If searches still return no relevant results after trying alternative phrasings, say so explicitly rather than guessing."
}' | jq
Response
Response
{
"id": "resp_9ad22494-e7e4-4f84-a5b1-09a339d6bf79",
"created_at": 1779391834,
"model": "openai/gpt-5.6-sol",
"object": "response",
"output": [
{
"results": [
{
"id": 1,
"snippet": "Every LLM API charges separately for **input tokens** (your prompt, system message, and any context) and **output tokens** (the model's response).\nOutput tokens always cost more — typically 2-5x the...",
"title": "How LLM Token Pricing Works: A Complete Guide to API Costs in ...",
"url": "https://benchlm.ai/blog/posts/llm-token-pricing",
"date": "2026-03-26",
"last_updated": "2026-05-20",
"source": "web"
},
{
"id": 2,
"snippet": "Token usage is tracked in several categories:\n- **Input tokens** – tokens in your request.\n- **Output tokens** – tokens generated in the response.\n...\nAPI usage is priced per token, varying by model...",
"title": "What are tokens and how to count them? - OpenAI Help Center",
"url": "https://help.openai.com/en/articles/4936856-what-are-tokens-and-how-to-count-them",
"date": "2026-03-31",
"last_updated": "2026-03-31",
"source": "web"
},
{
"id": 3,
"snippet": "When using extended thinking, all input and output tokens, including the tokens used for thinking, count toward the context window limit, with a few nuances in multi-turn situations.\nThe thinking...",
"title": "Context windows - Claude API Docs",
"url": "https://platform.claude.com/docs/en/build-with-claude/context-windows",
"date": null,
"last_updated": "2026-05-21",
"source": "web"
},
{
"id": 4,
"snippet": "Models like GPT‑4.1 and Llama 4 Maverick support context windows exceeding one million tokens, but larger windows do not inherently raise per-token prices.",
"title": "Understanding LLM Cost Per Token: A 2026 Practical Guide",
"url": "https://www.silicondata.com/blog/llm-cost-per-token",
"date": "2026-05-07",
"last_updated": "2026-05-18",
"source": "web"
},
{
"id": 5,
"snippet": "The language there is “**context window**” = 128K and “**max output tokens**” = 16386",
"title": "What is the maximum response length (output tokens) for each GPT ...",
"url": "https://community.openai.com/t/what-is-the-maximum-response-length-output-tokens-for-each-gpt-model/524066",
"date": "2023-11-24",
"last_updated": "2026-05-19",
"source": "web"
},
{
"id": 6,
"snippet": "Okay, so on pricing, now you're going to be paying flat pricing irrespective how\n{ts:38} many tokens you are using.\nSo, 900,000 tokens is going to be billed exactly the same\n{ts:44} as 9,000 tokens...",
"title": "Anthropic Just Solved Long Context - YouTube",
"url": "https://www.youtube.com/watch?v=Ow-8dYXDym8",
"date": "2026-03-16",
"last_updated": "2026-05-21",
"source": "web"
},
{
"id": 7,
"snippet": "But if your workload fills the context window, the 128K model’s per-request cost is 4x higher.\nPaying for context capacity you do not use is free; paying for capacity you fill is not.\n...\nEvery major...",
"title": "LLM Token Pricing Comparison 2026 — Cost Per Million Tokens",
"url": "https://myengineeringpath.dev/tools/llm-pricing-comparison/",
"date": "2026-03-20",
"last_updated": "2026-03-20",
"source": "web"
},
{
"id": 8,
"snippet": "$5.00 / 1M tokens\nCached input:\n$0.50 / 1M tokens\nOutput:\n$30.00 / 1M tokens\n...\n$2.50 / 1M tokens\nCached input:\n$0.25 / 1M tokens\n...\n$0.75 / 1M tokens\nCached input:\n$0.075 / 1M tokens\nOutput:\n$4.50...",
"title": "API Pricing - OpenAI",
"url": "https://openai.com/api/pricing/",
"date": "2026-04-09",
"last_updated": "2026-05-19",
"source": "web"
},
{
"id": 9,
"snippet": "The culprit is usually hiding in plain sight: output and reasoning tokens cost two to six times more than input tokens, and most teams don't realize how quickly they add up.\n...\nInput tokens include...",
"title": "Why Output & Reasoning Tokens Inflate LLM Costs (2026 Guide)",
"url": "https://www.codeant.ai/blogs/input-vs-output-vs-reasoning-tokens-cost",
"date": "2025-05-07",
"last_updated": "2026-05-15",
"source": "web"
},
{
"id": 10,
"snippet": "The rate limiter considers both input and output tokens.\n...\nThe AI model has a context window length, the maximum memory of tokens, an area for both processing your language input and for forming a...",
"title": "Inputs tokens limit, data extraction - OpenAI Developer Community",
"url": "https://community.openai.com/t/inputs-tokens-limit-data-extraction/612242",
"date": "2024-02-03",
"last_updated": "2026-04-24",
"source": "web"
},
{
"id": 11,
"snippet": "Two concepts explain almost everything: the **token** (the chunks of text an AI reads and writes — roughly 3/4 of a word per token) and the **context window** (how much text the model can consider at...",
"title": "Tokens, context windows, and what they cost - Cyberax",
"url": "https://cyberax.com/ai-playbook/tokens-context-windows-and-cost",
"date": "2026-05-11",
"last_updated": "2026-05-17",
"source": "web"
},
{
"id": 12,
"snippet": "Its most notable feature is its 100k context window.\n...\n**GPT-4** ** (OpenAI) costs per 1,000 tokens:**\n- Cost of Prompt: $0.03\n- Cost of Completion: $0.06\n**Claude 2 (Anthropic) costs per 1,000...",
"title": "Using Anthropic: Best Practices, Parameters, and Large Context ...",
"url": "https://www.prompthub.us/blog/using-anthropic-best-practices-parameters-and-large-context-windows",
"date": "2025-01-15",
"last_updated": "2026-05-15",
"source": "web"
}
],
"type": "search_results",
"queries": [
"LLM API pricing input vs output tokens context window",
"OpenAI API pricing input output tokens context limit",
"Anthropic pricing context window long documents"
]
},
{
"id": "msg_30926530-7c19-4e04-98b9-75ebae7f593b",
"content": [
{
"text": "Hosted LLM APIs generally charge separately for **input** tokens (everything you send) and **output** tokens (everything the model generates), both subject to a hard context‑window limit that caps how much text can be processed in a single call and strongly shapes the economics of long‑document workloads.[web:1][web:2][web:3][web:11] For long documents, the dominant cost is usually repeatedly paying for large input contexts rather than the model’s answer itself, unless the responses are very long or “reasoning‑heavy.”[web:7][web:9][web:11]\n\n## Input vs output tokens\n\nMost APIs meter usage as “tokens in” and “tokens out,” with different prices for each.[web:1][web:2][web:7][web:11] A token is a small chunk of text (often ~¾ of an English word), so both prompts and responses are measured in hundreds to thousands of tokens rather than characters.[web:11]\n\nCommon patterns:\n\n- Input tokens:\n - Include system prompt, user prompt, conversation history, and any retrieved context (e.g., RAG documents).[web:2][web:7][web:9]\n - Are billed per million (or thousand) tokens at the lower rate tier.[web:7][web:8][web:11]\n- Output tokens:\n - Include the final answer and any intermediate “thinking” or reasoning traces where supported.[web:3][web:9]\n - Typically cost 2–5× more than input tokens because each generated token requires a full forward pass conditioned on all prior tokens.[web:1][web:7][web:9][web:11]\n\nSome platforms also discount “cached” or reused input tokens that the model has already processed, which can matter when you reuse the same system prompt or fixed context across many calls.[web:2][web:8]\n\n## Context window limits\n\nThe context window is the maximum total number of tokens (input plus output) the model can consider in a single request.[web:3][web:10][web:11] Modern flagship models support windows from ~128K tokens up to 1M+ tokens, but the entire prompt plus the planned answer must fit within that limit.[web:4][web:5][web:7][web:11]\n\nKey implications:\n\n- All tokens count: every input token (prompt, instructions, retrieved chunks, chat history) and every output token must fit inside the context window.[web:3][web:10][web:11]\n- Per‑request ceilings: models may expose both a context‑window maximum and a separate “max output tokens” cap, so long inputs reduce the available budget for the answer.[web:3][web:5]\n- Bigger windows do not automatically mean higher per‑token prices, but they enable much larger prompts, so *actual* per‑call cost scales with how full you make the window.[web:1][web:4][web:7][web:11]\n\n## Pricing patterns across providers\n\nWhile numbers vary by vendor and model, the structure is very similar across major APIs.[web:7][web:8][web:12]\n\nTypical patterns:\n\n- Dual pricing:\n - Separate $/M input tokens and $/M output tokens lines for each model.[web:7][web:8][web:12]\n - Output rate commonly 2–5× the input rate.[web:1][web:7][web:9][web:11]\n- Specialized token types:\n - Some providers expose “reasoning,” “thinking,” or “extended‑thinking” tokens that are charged at a premium compared with normal output.[web:3][web:9]\n - Cached or previously‑seen input tokens may be billed at a discounted rate when the platform supports retrieval from a cache.[web:2][web:8]\n- Long‑context options:\n - Higher‑end models offer larger context windows (hundreds of thousands to >1M tokens) at similar or slightly different per‑token rates, but using the full window multiplies the cost of each call.[web:4][web:7][web:11]\n\nThere are also emerging flat‑pricing or “banded” schemes for ultra‑long‑context tiers, but the common denominator remains that cost scales directly with tokens processed, regardless of how they are packaged.[web:6][web:7]\n\n## Long‑document workloads\n\nFor workloads like summarization, Q&A over corpora, or codebase analysis, the interaction between per‑token pricing and context limits is crucial.[web:7][web:9][web:11]\n\nCore implications:\n\n- You pay repeatedly for context:\n - When doing retrieval‑augmented generation (RAG), every query includes retrieved chunks, so the retrieved context often dominates the input token count.[web:7][web:9][web:11]\n - For example, five 500‑token chunks (2,500 tokens) per request, at $2.50 per million input tokens, costs ~$2.50 per 1,000 calls just for those chunks, or ~$2,500 per million calls.[web:7]\n- “Fill the window” gets expensive:\n - If you regularly send prompts close to a 128K–1M token context limit, each call can be tens to hundreds of times more expensive than a short‑prompt call, even at the same per‑token price.[web:4][web:7][web:11]\n - Long chat sessions or accreting code review threads can quietly grow context size over time, increasing cost per request as more history is resent each time.[web:9][web:11]\n- Trade-offs in chunking vs. single‑shot:\n - Splitting a huge document into multiple smaller prompts can keep each call well under the context limit, at the cost of extra orchestration and possibly some loss of global coherence.[web:11]\n - Using a single enormous context window is simpler but can be much more expensive if every query resends most of the document.[web:1][web:7][web:11]\n\nFor practical system design, this means the main cost levers for long‑document use cases are: how aggressively you limit retrieved context per request, how you manage chat or history growth, and how long you allow model outputs to be, given that all three are bounded by the context window and billed per token.[web:7][web:9][web:11]",
"type": "output_text",
"annotations": [],
"logprobs": []
}
],
"role": "assistant",
"status": "completed",
"type": "message"
}
],
"status": "completed",
"error": null,
"usage": {
"input_tokens": 6297,
"output_tokens": 1408,
"total_tokens": 7705,
"cost": {
"currency": "USD",
"input_cost": 0.01085,
"output_cost": 0.02816,
"total_cost": 0.04294,
"cache_creation_cost": null,
"cache_read_cost": 0.00143,
"tool_calls_cost": 0.0025
},
"input_tokens_details": {
"cache_creation_input_tokens": 0,
"cache_read_input_tokens": 3584,
"cached_tokens": 3584
},
"tool_calls_details": {
"search_web": {
"invocation": 1
}
},
"output_tokens_details": {
"reasoning_tokens": 0
}
},
"completed_at": 1779391834
}
Best Practices
Be Specific and Descriptive
Use natural language, but include the vocabulary and context that would actually appear on relevant pages. Add a few words of context to disambiguate when a term could mean multiple things. Specificity in
input directly improves retrieval.Good Example: “Compare energy efficiency ratings of heat pumps vs. traditional HVAC for residential use”Poor Example: “Tell me which home heating is better”Cap Result Counts
If you want a list, say how long. Without an explicit cap, the model picks an arbitrary length.Good Example: “List the top 5 sushi restaurants in Tokyo”Poor Example: “Give me a list of sushi restaurants”
Use Instructions to Shape Tool Output
Can be useful if you want to nudge how the model handles tool output. Things like citation style, grounding behavior, or response formatting fit naturally here, since instructions apply on every turn of the agent loop.Example (
instructions): “Cite sources inline by domain (e.g., reuters.com). State explicitly when tool results don’t fully answer the question.”Reading Sources from the Response
Read URLs and source metadata from the response payload, not from the model’s written answer. For non-streaming responses, search results are insideresponse.output[] as items where type == "search_results" — the response contains one such item per search the model ran, all sharing a single citation id space, so collect the results from every item rather than only the first (multi-step effort levels like deep research run many searches). Pull URLs from results[].url. For streaming, listen for response.reasoning.search_results events (again, one per search). See Output Control for the full response shape.
The model has access to URLs from tool output and can include them in its response if asked, but it’s prone to mistyping or paraphrasing them. Effort Levels also configure a citation style for the model — an index that maps to the search result id (e.g., [1] or [web:1]) or inline links, depending on the effort level — so asking for URLs in prose fights the default citation format. Treat the model’s text as the prose answer and the structured search_results items as the authoritative source list.
Reduce Hallucinations
LLMs are tuned to be helpful, which can occasionally lead them to provide an answer when search results are thin or off-target rather than flagging the gap. The agent loop helps, since the model can refine queries and search again, but it does not eliminate the failure modes. Hallucination is most likely when the information isn’t web-accessible (posts that require authentication, private documents, paywalled content), when repeated searches return related but non-matching results, or when very recent information isn’t indexed yet. A few short additions toinstructions cover most of these cases. Grounding rules belong here because instructions are re-read on every turn of the agent loop, so the same rule applies to the first search and to any follow-ups.
Give the model permission to say it didn’t find anything. With an explicit out, the model is more likely to acknowledge insufficient results instead of leaning on training data to fill the gap.
Instructions
If searches do not return relevant results after trying alternative phrasings, say so explicitly rather than providing speculative information.
Instructions
If you find related but non-matching results (for example, a different year, a parent company, or a subsidiary), state the mismatch explicitly before answering.
Use Parameters, Not Prose, for Hard Constraints
For source, date, or region constraints, prefer theweb_search parameters over describing the constraint in prose. Parameters are applied by the search backend on every call, while prose-based filters are interpreted by the model and may not carry through every turn of the loop.
Keep input focused on the question itself, and move structural constraints into the tool config:
Avoid
client.responses.create(
effort="low",
input="Using only Wikipedia as a source, summarize the history of the Apollo program: each crewed mission, their objectives, and key outcomes."
)
Response
Response
{
"id": "resp_50148504-902d-4f26-8432-2930506d13af",
"created_at": 1779895991,
"model": "openai/gpt-5.6-sol",
"object": "response",
"output": [
{
"results": [
{
"id": 1,
"snippet": "The **Apollo program**, also known as **Project Apollo**, was the United States human spaceflight program led by NASA, which landed the first humans on the Moon in 1969.\nApollo was conceived in 1960...",
"title": "Apollo program - Wikipedia",
"url": "https://en.wikipedia.org/wiki/Apollo_program",
"date": "2001-09-24",
"last_updated": "2026-05-21",
"source": "web"
},
{
"id": 2,
"snippet": "**Apollo 7** (October 11–22, 1968) was the first crewed flight in NASA's Apollo program, and saw the resumption of human spaceflight by the agency after the fire that killed the three Apollo 1...",
"title": "Apollo 7 - Wikipedia",
"url": "https://en.wikipedia.org/wiki/Apollo_7",
"date": "2001-08-27",
"last_updated": "2026-05-27",
"source": "web"
},
{
"id": 3,
"snippet": "**Apollo 8** (December 21–27, 1968) was the first crewed spacecraft to leave Earth's gravitational sphere of influence, and the first human spaceflight to reach the Moon.\nThe crew orbited the Moon...",
"title": "Apollo 8 - Wikipedia",
"url": "https://en.wikipedia.org/wiki/Apollo_8",
"date": "2001-03-17",
"last_updated": "2026-05-22",
"source": "web"
},
{
"id": 4,
"snippet": "**Apollo 9** (March 3–13, 1969) was the third human spaceflight in NASA's Apollo program, which successfully tested systems and procedures critical to landing on the Moon.\nThe three-man crew...",
"title": "Apollo 9 - Wikipedia",
"url": "https://en.wikipedia.org/wiki/Apollo_9",
"date": "2001-08-27",
"last_updated": "2026-05-22",
"source": "web"
},
{
"id": 5,
"snippet": "**Apollo 10** (May 18–26, 1969) was the fourth human spaceflight in the United States' Apollo program and the second to orbit the Moon.\nNASA, the mission's operator, described it as a \"dress...",
"title": "Apollo 10 - Wikipedia",
"url": "https://en.wikipedia.org/wiki/Apollo_10",
"date": "2001-09-22",
"last_updated": "2026-05-22",
"source": "web"
},
{
"id": 6,
"snippet": "The Apollo program was a United States human spaceflight program carried out from 1961 to 1972 by the National Aeronautics and Space Administration (NASA), which landed the first astronauts on the...",
"title": "List of Apollo missions - Wikipedia",
"url": "https://en.wikipedia.org/wiki/List_of_Apollo_missions",
"date": "2007-02-13",
"last_updated": "2026-05-10",
"source": "web"
},
{
"id": 7,
"snippet": "**Many are familiar with Apollo 11, the mission that landed humans on the Moon for the first time.\nIt was part of the larger Apollo program.\n**\n**There were several missions during the Apollo program...",
"title": "The Apollo Missions | National Air and Space Museum",
"url": "https://airandspace.si.edu/explore/stories/apollo-missions",
"date": "2021-11-04",
"last_updated": "2026-05-17",
"source": "web"
},
{
"id": 8,
"snippet": "**Apollo 7** was a mission in the NASA's Apollo program.\nIt was the first crewed mission in the Apollo program and the first crewed US space flight after Apollo 1 disaster.\nThe mission was a C type...",
"title": "Apollo 7 - Simple English Wikipedia, the free encyclopedia",
"url": "https://simple.wikipedia.org/wiki/Apollo_7",
"date": "2012-02-29",
"last_updated": "2026-05-26",
"source": "web"
},
{
"id": 9,
"snippet": "**Apollo 8** was a mission in the Apollo program in December 1968.\nIt was the first crewed spaceflight to leave Earth orbit and first to orbit the Moon.\nCommander Frank Borman, Pilot Jim Lovell and...",
"title": "Apollo 8 - Simple English Wikipedia, the free encyclopedia",
"url": "https://simple.wikipedia.org/wiki/Apollo_8",
"date": "2012-01-20",
"last_updated": "2026-05-23",
"source": "web"
},
{
"id": 10,
"snippet": "**Apollo 9** was a mission in NASA's Apollo program.\nIt was the third crewed mission in the Apollo program and was the first flight of the Command/Service Module (CSM) with the Lunar Module (LM).\nThe...",
"title": "Apollo 9 - Simple English Wikipedia, the free encyclopedia",
"url": "https://simple.wikipedia.org/wiki/Apollo_9",
"date": "2012-05-17",
"last_updated": "2026-04-01",
"source": "web"
},
{
"id": 11,
"snippet": "The national effort that enabled Astronaut Neil Armstrong to speak those words as he stepped onto the lunar surface fulfilled a dream as old as humanity.\nProject Apollo’s goals went beyond landing...",
"title": "The Apollo Program - NASA",
"url": "https://www.nasa.gov/the-apollo-program/",
"date": "2023-03-23",
"last_updated": "2026-05-18",
"source": "web"
},
{
"id": 12,
"snippet": "**On October 11, 1968 Apollo 7 was launched on a Saturn IB rocket, making it the first successful crewed Apollo mission and the only crewed Apollo mission to use the Saturn IB Rocket.**\nApollo 7 was...",
"title": "Apollo 7 | National Air and Space Museum",
"url": "https://airandspace.si.edu/explore/stories/apollo-missions/apollo-7",
"date": "2021-07-29",
"last_updated": "2026-03-25",
"source": "web"
}
],
"type": "search_results",
"queries": [
"Apollo program Wikipedia",
"List of Apollo missions Wikipedia",
"Apollo 7 Wikipedia",
"Apollo 8 Wikipedia",
"Apollo 9 Wikipedia",
"Apollo 10 Wikipedia"
]
},
{
"contents": [
{
"snippet": "The Apollo program was a United States human spaceflight program carried out from 1961 to 1972 by the National Aeronautics and Space Administration (NASA), which landed the first astronauts on the...",
"title": "List of Apollo missions - Wikipedia",
"url": "https://en.wikipedia.org/wiki/List_of_Apollo_missions"
},
{
"snippet": "**Apollo program**\n| | |\n|--|--|\n|Program overview|Program overview|\n|Country|United States|\n|Organization|NASA|\n|Purpose|Crewed lunar landing|\n|Status|Completed|\n|Program history|Program history|...",
"title": "Apollo program - Wikipedia",
"url": "https://en.wikipedia.org/wiki/Apollo_program"
}
],
"type": "fetch_url_results"
},
{
"id": "msg_a5584d41-c74c-4b77-8366-7198e72bc2db",
"content": [
{
"text": "The Apollo program flew eleven crewed missions (including Apollo 1, which never launched). Each mission progressively tested spacecraft, operations, and ultimately enabled six Moon landings and a dramatic in‑flight rescue. [page:1][page:2]\n\nBelow, “objectives” are what the mission was meant to test or accomplish; “key outcomes” are the main results.\n\n---\n\n## Apollo 1\n\n- **Objectives:** First crewed flight of the Block I Apollo command and service module (CSM) in Earth orbit on a Saturn IB, to validate basic spacecraft systems for later missions. [page:1] \n- **Key outcomes:** Never launched; during a “plugs‑out” ground test on January 27, 1967, a cabin fire in a high‑pressure pure oxygen atmosphere killed Gus Grissom, Ed White, and Roger B. Chaffee and destroyed the command module. [page:1] \n - The accident led to major redesigns: mixed nitrogen–oxygen atmosphere on the pad, removal of flammable materials, a quick‑opening outward hatch, and cancellation of all crewed Block I flights. [page:1]\n\n---\n\n## Apollo 7\n\n- **Objectives:** First crewed Apollo mission (C‑type); shakedown of the redesigned Block II CSM in low Earth orbit using a Saturn IB, including propulsion, life support, navigation, rendezvous capability, and long‑duration operations. [page:1] \n- **Key outcomes:** Eleven‑day Earth‑orbital flight (10 days 20 hours) by Wally Schirra, Donn Eisele, and Walter Cunningham that successfully demonstrated the Block II CSM and made the first live television broadcasts from a U.S. crewed spacecraft. [page:1] \n - Its success gave NASA confidence to commit the next mission, Apollo 8, to the Moon. [web:8][page:1]\n\n---\n\n## Apollo 8\n\n- **Objectives:** C′‑type mission; first crewed flight of the Saturn V and first crewed CSM flight to the Moon, to test translunar injection, navigation, communications, and operations in lunar orbit. [page:1] \n- **Key outcomes:** Frank Borman, James Lovell, and William Anders became the first humans to leave Earth orbit, reach the Moon, and orbit it ten times over about 20 hours, then return safely. [web:3][page:1] \n - The crew photographed the lunar far side and the famous “Earthrise,” and the mission eliminated the need for a separate medium‑Earth‑orbit E‑type test. [web:3][page:1]\n\n---\n\n## Apollo 9\n\n- **Objectives:** D‑type mission; first crewed test of the complete Apollo spacecraft—CSM and Lunar Module (LM)—in low Earth orbit, to validate LM propulsion, rendezvous and docking, and the new lunar EVA suit and Portable Life Support System (PLSS). [web:4][page:1] \n- **Key outcomes:** James McDivitt, David Scott, and Russell “Rusty” Schweickart flew the first crewed LM (*Spider*) and CSM (*Gumdrop*) together, performed rendezvous and docking maneuvers, and conducted an EVA in the full lunar surface suit using the PLSS. [web:4][web:10][page:1] \n - The mission proved the LM was capable of independent flight and that astronauts could work outside in the suit planned for the Moon. [web:4][page:1]\n\n---\n\n## Apollo 10\n\n- **Objectives:** F‑type “dress rehearsal” for the first landing: test all operations of a lunar mission except the actual touchdown—Saturn V performance, lunar orbit operations, LM descent and ascent to near‑surface altitude, and high‑speed return. [web:5][page:1] \n- **Key outcomes:** Thomas Stafford, John Young, and Eugene Cernan flew CSM *Charlie Brown* and LM *Snoopy* to the Moon; the LM descended to about 50,000 feet (8.4 nautical miles / ~15.6 km) above the surface before returning to orbit and docking. [web:5][page:1] \n - Demonstrated that the hardware and procedures for a landing were ready, clearing the way for Apollo 11. [web:5][page:1]\n\n---\n\n## Apollo 11\n\n- **Objectives:** G‑type mission; first crewed lunar landing to fulfill Kennedy’s goal of “landing a man on the Moon and returning him safely to the Earth,” testing the full end‑to‑end profile including descent, landing, surface EVA, ascent, and sample return. [page:2] \n- **Key outcomes:** On July 20, 1969, Neil Armstrong and Buzz Aldrin landed LM *Eagle* at Tranquility Base in the Sea of Tranquility, while Michael Collins orbited in CSM *Columbia*. [page:1][page:2] \n - Armstrong and Aldrin spent about 21.5 hours on the surface (2.5 hours outside), deployed scientific instruments, and returned 21.55 kg of samples; all three safely splashed down on July 24, 1969. [page:1][page:1]\n\n---\n\n## Apollo 12\n\n- **Objectives:** H‑type mission; demonstrate a precision landing and expanded surface science with multiple EVAs, including inspecting and retrieving hardware from the earlier Surveyor 3 lander. [page:1] \n- **Key outcomes:** Charles “Pete” Conrad and Alan Bean landed LM *Intrepid* in Ocean of Storms near Surveyor 3, achieving a highly accurate touchdown, while Richard Gordon orbited in CSM *Yankee Clipper*. [page:1] \n - They performed two EVAs (7 h 45 m total), collected 34.30 kg of samples, and returned parts of Surveyor 3 for analysis; the mission also briefly transmitted color TV from the surface before the camera was accidentally pointed at the Sun and failed. [page:1]\n\n---\n\n## Apollo 13\n\n- **Objectives:** H‑type mission; planned third landing, targeting the Fra Mauro formation for geological study and further refinement of surface operations. [page:1] \n- **Key outcomes:** An oxygen tank explosion in the service module en route to the Moon crippled CSM *Odyssey*, forcing cancellation of the landing and use of LM *Aquarius* as a “lifeboat” for power, propulsion, and life support. [page:1][page:2] \n - James Lovell, Jack Swigert, and Fred Haise looped around the Moon on a free‑return path and returned safely; the mission was later described as a “successful failure” because of the safe recovery and engineering lessons. [page:1]\n\n---\n\n## Apollo 14\n\n- **Objectives:** H‑type mission reused Fra Mauro as the landing target (the geology goal from Apollo 13), to study ejecta from the Imbrium impact and conduct improved surface science and long EVAs. [page:1] \n- **Key outcomes:** Alan Shepard and Edgar Mitchell landed LM *Antares* at Fra Mauro while Stuart Roosa orbited in CSM *Kitty Hawk*. [page:1] \n - They spent 33.5 hours on the surface, performed two EVAs totaling about 9 h 21 m, returned 42.80 kg of samples, and were the first to broadcast substantial color TV from the lunar surface. [page:1]\n\n---\n\n## Apollo 15\n\n- **Objectives:** First J‑type “extended” mission: longer stay, first Lunar Roving Vehicle (LRV), more sophisticated science payloads in the LM and in the CSM’s Scientific Instrument Module, and intensive geological exploration at the Hadley–Apennine region. [page:1] \n- **Key outcomes:** David Scott and James Irwin landed LM *Falcon* near Hadley Rille while Alfred Worden orbited in CSM *Endeavour*. [page:1] \n - With three EVAs totaling 18 h 33 m, extensive LRV traverses, and 76.70 kg of samples (including the famous “Genesis Rock”), Apollo 15 inaugurated the high‑science, long‑stay phase of Apollo. [page:1]\n\n---\n\n## Apollo 16\n\n- **Objectives:** Second J‑type mission, aimed at the Descartes Highlands to sample what were thought to be ancient highland volcanic rocks and to extend rover‑supported exploration and orbital science. [page:1] \n- **Key outcomes:** John Young and Charles Duke landed LM *Orion* in the Descartes Highlands while Ken Mattingly remained in CSM *Casper*. [page:1] \n - They spent nearly three days on the surface with three EVAs totaling 20 h 14 m, drove the LRV on extensive traverses, and returned 94.30 kg of samples, while Mattingly performed a deep‑space EVA to retrieve film from the service module. [page:1]\n\n---\n\n## Apollo 17\n\n- **Objectives:** Final J‑type mission and last Apollo lunar landing; target Taurus–Littrow to sample both young volcanic deposits and older highland material, with a professional geologist on the crew for maximum scientific return. [page:1] \n- **Key outcomes:** Eugene Cernan and geologist Harrison Schmitt landed LM *Challenger* in Taurus–Littrow while Ronald Evans piloted CSM *America*; this was the only Saturn V night launch. [page:1] \n - They spent just over three days on the surface, conducted three EVAs totaling 22 h 2 m with the rover, and returned 110.40 kg of samples; Apollo 17 remains the last crewed mission to the Moon in the Apollo program. [page:1][page:2]",
"type": "output_text",
"annotations": [],
"logprobs": []
}
],
"role": "assistant",
"status": "completed",
"type": "message"
}
],
"status": "completed",
"error": null,
"usage": {
"input_tokens": 33623,
"output_tokens": 2189,
"total_tokens": 35812,
"cost": {
"currency": "USD",
"input_cost": 0.12016,
"output_cost": 0.04378,
"total_cost": 0.16837,
"cache_creation_cost": null,
"cache_read_cost": 0.00143,
"tool_calls_cost": 0.003
},
"input_tokens_details": {
"cache_creation_input_tokens": 0,
"cache_read_input_tokens": 3584,
"cached_tokens": 3584
},
"tool_calls_details": {
"fetch_url": {
"invocation": 1
},
"search_web": {
"invocation": 1
}
},
"output_tokens_details": {
"reasoning_tokens": 0
}
},
"completed_at": 1779895991
}
Prefer
client.responses.create(
effort="low",
input="Explain the structure of the 2015 Paris Agreement on climate change: nationally determined contributions, the 2°C / 1.5°C temperature goals, and the global stocktake mechanism.",
tools=[
{
"type": "web_search",
"filters": {
"search_domain_filter": ["wikipedia.org"],
"search_recency_filter": "month"
}
}
]
)
Response
Response
{
"id": "resp_b5e0e0e9-b888-4b71-ba14-4410b5b0ef6a",
"created_at": 1779391837,
"model": "openai/gpt-5.6-sol",
"object": "response",
"output": [
{
"results": [
{
"id": 1,
"snippet": "In 2015, the Paris Agreement prescribed that the first GST would take place in 2023, and then every five years.",
"title": "What is the Global Stocktake? - Grantham Research Institute ... - LSE",
"url": "https://www.lse.ac.uk/granthaminstitute/explainers/what-is-the-global-stocktake/",
"date": "2023-11-29",
"last_updated": "2026-05-20",
"source": "web"
},
{
"id": 2,
"snippet": "Nationally Determined Contributions (NDCs) detail each country's plans to reduce greenhouse gas emissions and contribute to global goals on climate change.\n...\nNDCs lay out how each country will...",
"title": "What Are NDCs and How Do They Address Climate Change?",
"url": "https://www.wri.org/insights/nationally-determined-contributions-ndcs-explained",
"date": "2025-08-28",
"last_updated": "2026-05-15",
"source": "web"
},
{
"id": 3,
"snippet": "The Paris Agreement works on a five- year cycle of increasingly ambitious climate action carried out by countries.\nEvery five years, each country is expected to submit an updated national climate...",
"title": "The Paris Agreement - the United Nations",
"url": "https://www.un.org/en/climatechange/paris-agreement",
"date": null,
"last_updated": "2026-04-20",
"source": "web"
},
{
"id": 4,
"snippet": "Every 5 years, all 195 signatories of the 2015 Paris Agreement must submit updated plans to reduce their greenhouse gas emissions to limit global warming.\nThese plans, known as Nationally Determined...",
"title": "What are Nationally Determined Contributions (NDCs)?",
"url": "https://www.woodwellclimate.org/what-are-ndc-nationally-determined-contributions/",
"date": "2025-11-05",
"last_updated": "2026-05-09",
"source": "web"
},
{
"id": 5,
"snippet": "Finally, under the Paris Agreement in 2015, countries agreed to make plans to limit their emissions of greenhouse gasses.\nThis agreement clearly defines 2° Celsius as the upper limit for global...",
"title": "Why did the IPCC choose 2° C as the goal for limiting global warming?",
"url": "https://climate.mit.edu/ask-mit/why-did-ipcc-choose-2deg-c-goal-limiting-global-warming",
"date": null,
"last_updated": "2026-05-11",
"source": "web"
},
{
"id": 6,
"snippet": "- *Nationally Determined Contributions, or NDCs, are countries’ self-defined national climate pledges under the Paris Agreement, detailing what they will do to help meet the global goal to pursue...",
"title": "What are NDCs and how do they drive climate action?",
"url": "https://climatepromise.undp.org/news-and-stories/NDCs-nationally-determined-contributions-climate-change-what-you-need-to-know",
"date": "2023-05-31",
"last_updated": "2026-04-17",
"source": "web"
},
{
"id": 7,
"snippet": "Binding under international law and global in scope, it not only sets out ambitious global goals, such as limiting the rise in average global temperature to well below 2 °C compared with...",
"title": "Global stocktake - Wikipedia",
"url": "https://en.wikipedia.org/wiki/Global_stocktake",
"date": "2020-01-22",
"last_updated": "2026-05-05",
"source": "web"
}
],
"type": "search_results",
"queries": [
"2015 Paris Agreement nationally determined contributions structure",
"Paris Agreement 2°C 1.5°C temperature goal Article 2",
"Paris Agreement global stocktake mechanism Article 14"
]
},
{
"id": "msg_d05e1753-3e3d-4abb-8cf1-04917d4be0d9",
"content": [
{
"text": "The 2015 Paris Agreement sets a long‑term temperature goal (“well below” 2°C, with efforts toward 1.5°C), then builds a cyclical system where countries file and strengthen nationally determined contributions (NDCs), which are periodically reviewed through a global stocktake to ratchet up ambition over time.[web:3][web:7] \n\n## Temperature goals (2°C / 1.5°C)\n\n- The Agreement’s core objective is to hold the increase in global average temperature to *well below* 2°C above pre‑industrial levels and to pursue efforts to limit the increase to 1.5°C.[web:3][web:4] \n- The 1.5°C reference is framed as a more desirable aspiration because it substantially reduces the risks and impacts of climate change compared with 2°C warming.[web:5] \n\n## Nationally determined contributions (NDCs)\n\n- NDCs are each country’s **self‑defined** national climate plan, setting out how it will reduce greenhouse gas emissions and often how it will adapt to climate impacts and what support it needs.[web:2][web:3][web:6] \n- Under the Paris “ambition cycle,” every Party must have an NDC, submit a new or updated one at least every five years, and each successive NDC must represent the country’s “highest possible ambition” and not fall below the previous one.[web:2][web:4][web:7] \n- Countries are legally required to prepare, communicate and pursue domestic measures to implement their NDCs, and to report on progress, but they are **not** legally bound to actually achieve the specific numerical targets in their NDCs.[web:4][web:7] \n\n## Five‑year ambition cycle\n\n- The Agreement works on a recurring five‑year cycle: countries submit NDCs, implement policies, report transparently, and then update NDCs in light of new science, capabilities, and the outcomes of the global stocktake.[web:3][web:6][web:7] \n- This iterative design replaces top‑down negotiated targets with a bottom‑up system where national pledges are progressively strengthened to collectively align with the long‑term temperature goals.[web:7] \n\n## Global stocktake mechanism\n\n- The global stocktake (GST), established in Article 14, is a collective assessment held every five years to evaluate overall progress toward achieving the purpose and long‑term goals of the Paris Agreement, including the temperature limits.[web:1][web:7] \n- The first stocktake was scheduled for 2023 and then recurs every five years; its outputs are meant to inform and shape the next round of NDCs and other climate actions, encouraging countries to increase ambition over time.[web:1][web:7] \n- The GST assesses mitigation, adaptation, and means of implementation and support (finance, technology, capacity‑building), and is linked to the Enhanced Transparency Framework under which Parties regularly report and undergo technical review.[web:1][web:3][web:7] \n\n## How the pieces fit together\n\n- The temperature goals define the overall direction (well below 2°C with efforts toward 1.5°C), while NDCs are the main vehicle through which each country specifies its contribution to that collective objective.[web:3][web:4][web:6] \n- The global stocktake and transparency rules create periodic moments of political and technical scrutiny, intended to push Parties to submit more ambitious NDCs in each cycle so that, over time, global emissions pathways converge toward the agreed temperature limits.[web:1][web:2][web:7]",
"type": "output_text",
"annotations": [],
"logprobs": []
}
],
"role": "assistant",
"status": "completed",
"type": "message"
}
],
"status": "completed",
"error": null,
"usage": {
"input_tokens": 5737,
"output_tokens": 830,
"total_tokens": 6567,
"cost": {
"currency": "USD",
"input_cost": 0.00861,
"output_cost": 0.0166,
"total_cost": 0.02914,
"cache_creation_cost": null,
"cache_read_cost": 0.00143,
"tool_calls_cost": 0.0025
},
"input_tokens_details": {
"cache_creation_input_tokens": 0,
"cache_read_input_tokens": 3584,
"cached_tokens": 3584
},
"tool_calls_details": {
"search_web": {
"invocation": 1
}
},
"output_tokens_details": {
"reasoning_tokens": 0
}
},
"completed_at": 1779391837
}
To run without tools, set
tools_disabled: true on the request. Passing tools: [] does not clear effort level tools. An empty array is treated the same as omitting the field, and the effort level’s defaults still apply.Next Steps
Output Control
Shape responses with
response_format and learn the full response payload structure.Filters
Constrain search with domain, recency, and region parameters.
Web Search
Configure the
web_search tool for source-grounded context.Effort Levels
Choose an effort level that matches your latency, depth, and tool requirements.