TL;DR
Use the OpenAI Python SDK with a CometAPI key to send your first request to GPT-6.2 Astra. If you already run GPT-6 Astra, replay a request you know well with the new model ID. Check the answer, token usage, and any tool results before switching traffic.
Key Takeaways
- Set the SDK base URL to
https://api.cometapi.com/v1and the model togpt-6.2-astra. - Use the Responses API when your application calls tools. Chat Completions is also available for existing text conversations.
- Start with medium reasoning effort. Increase it when a measured improvement in task quality justifies the added latency.
- Keep shared instructions at the beginning of the conversation so later turns can reuse the same prefix.
What Is GPT-6.2 Astra? Model Capabilities and API Features
GPT-6.2 Astra is OpenAIโs reasoning model for demanding software, research, and document workflows. It accepts text and images and returns text. Its 1,050,000-token context window accommodates up to 922,000 input tokens and 128,000 output tokens. CometAPI added Astra on November 18, 2026 with support for Responses and Chat Completions.
Read a chart alongside the incident report
During an incident review, give Astra the latency chart, the deployment timeline, and the engineerโs notes. Ask it to identify when the spike began, quote the note that best explains it, and flag anything the evidence leaves unresolved. A chart can show that latency rose after a release. The accompanying notes help you decide which change to investigate first.
Use the context window for cross-document questions
For a migration review, send the current API contract, the proposed change, and a few representative requests together. Ask which callers would break and have Astra cite the relevant contract clause for each one. Budget for both the material you send and the answer you need. A long comparison needs more output room than a list of affected endpoints.
Choose the API feature your application needs
If a user is waiting for a written report, stream the text so they can start reading. If a dashboard needs to sort incidents, request structured output with fields for severity and recommended action. If an answer depends on live data, such as an orderโs current status, use a function call through the Responses API. Your application looks up the record and sends the result back for Astra to explain.
Choose a reasoning setting
GPT-6.2 Astra supports low, medium, high, xhigh, and max. Use reasoning.effort with Responses and reasoning_effort with Chat Completions. If a shared client sends none or minimal for another model, set it to low for this route.
Use the table to pick a starting effort. For an architecture review, run the same prompt at medium and high effort and compare the risks each answer identifies.
| Task type | Suggested starting effort | Why |
|---|---|---|
| Simple extraction | Low | Reduce unnecessary reasoning overhead |
| Routine coding assistance | Medium | Balanced quality and latency |
| Architecture review | High | Evaluate multiple constraints and trade-offs |
| Complex debugging | High / Xhigh | Explore deeper failure paths |
| Multi-step research | High / Xhigh | Better suited to synthesis and analysis |
How to Use the GPT-6.2 Astra API Through CometAPI
Step 1: Create a CometAPI API key
Sign in to CometAPI and create an API key from the API management dashboard.
In Bash, replace the placeholder with your key and export the variable in the terminal where you will run the example.
export COMETAPI_KEY="your_cometapi_api_key"
In PowerShell, set the variable for the current session with this command.
$env:COMETAPI_KEY = "your_cometapi_api_key"
Step 2: Install the OpenAI SDK
Install the SDK with the Python interpreter you plan to use for the script.
python -m pip install --upgrade openai
Step 3: Make your first GPT-6.2 Astra API request
Save this example as astra_quickstart.py. It gives the model a concrete architecture to review and checks that the response completed before printing the answer.
import os
from openai import OpenAI
client = OpenAI(
api_key=os.environ["COMETAPI_KEY"],
base_url="https://api.cometapi.com/v1",
timeout=120.0,
)
response = client.responses.create(
model="gpt-6.2-astra",
reasoning={"effort": "medium"},
input=(
"A Python API writes each request to one database and runs reports "
"on that same database. Identify two risks as traffic grows."
),
max_output_tokens=2000,
)
if response.status != "completed":
raise RuntimeError(f"Response ended with status {response.status}")
print(response.output_text)
Run python astra_quickstart.py in the terminal where you set the key. A successful run prints two risks related to sharing the database. To try the Python examples below, reuse the imports and client setup at the top of this file and replace the request.
Send the same type of request with cURL
From Bash, send a JSON payload directly to the Responses endpoint. The response body includes the output items and token usage.
curl https://api.cometapi.com/v1/responses \
-H "Authorization: Bearer $COMETAPI_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "gpt-6.2-astra",
"reasoning": {
"effort": "high"
},
"input": "Analyze the root cause of a database deadlock and propose a safe migration strategy.",
"max_output_tokens": 3000
}'
GPT-6.2 Astra API: Streaming, Function Calling, and Structured Outputs
Display streaming text
Print each text fragment as it arrives and wait for the completion event before marking the answer finished.
stream = client.responses.create(
model="gpt-6.2-astra",
input=(
"Explain how to optimize a large Python "
"data-processing pipeline."
),
reasoning={"effort": "medium"},
stream=True,
)
for event in stream:
if event.type == "response.output_text.delta":
print(event.delta, end="", flush=True)
elif event.type == "response.completed":
print("\nResponse completed.")
Look up an order with a function call
The model can ask for an orderโs status. Your application looks it up and returns the result with the matching call ID. This example uses one sample order and requests one tool call so you can follow the round trip.
import json
orders = {"A1024": "shipped"}
tool = {
"type": "function", "name": "get_order_status",
"parameters": {
"type": "object", "properties": {"order_id": {"type": "string"}},
"required": ["order_id"], "additionalProperties": False,
},
"strict": True,
}
model = "gpt-6.2-astra"
history = [{"role": "user", "content": "Has order A1024 shipped?"}]
first = client.responses.create(
model=model, input=history, tools=[tool], tool_choice="required",
parallel_tool_calls=False,
)
call = next(item for item in first.output if item.type == "function_call")
order_id = json.loads(call.arguments)["order_id"]
history.extend(item.model_dump(exclude={"id"}) for item in first.output)
history.append({
"type": "function_call_output", "call_id": call.call_id,
"output": orders.get(order_id, "Unknown order"),
})
answer = client.responses.create(model=model, input=history)
print(answer.output_text)
In a customer-facing application, verify that the signed-in customer can access the requested order before returning its status.
Generate structured JSON
Suppose your incident dashboard needs three fields from a latency report: the problem, its severity, and a recommended action. In the Responses API, use text.format to describe those fields. Set type to json_schema and strict to true, make all three fields required, and limit severity to low, medium, or high. When the request completes with a structured answer, your dashboard can read those fields directly.
Check the completion status and validate the field values before storing the result or using it to trigger an action.
GPT-6 Astra to GPT-6.2 Astra API Migration Guide
Update the model and endpoint settings
For a client using GPT-6 Astra, start with the model change below. Run the same prompt before and after the change so that you can compare the results.
response = client.responses.create(
- model="gpt-6-astra",
+ model="gpt-6.2-astra",
input="Analyze this software architecture.",
reasoning={"effort": "medium"}
)
Apply the migration settings for your endpoint to the request builder that sends the call.
- Responses: remove
temperature,top_p, andtop_logprobs. Removemessage.output_text.logprobsfrominclude. - Chat Completions: remove
temperature,top_p,logprobs, andtop_logprobs. Move workflows that call tools to Responses.
| Existing configuration | GPT-6.2 Astra migration |
|---|---|
| model="gpt-6-astra" | Change to gpt-6.2-astra |
| temperature | Remove for supported requests |
| top_p | Remove |
| top_logprobs | Remove |
| logprobs | Remove from Chat Completions |
| reasoning.effort="none" | Change to supported effort, such as low |
| Tool calling through Chat Completions | Move tool workflows to Responses API |
| prompt_cache_retention | Review and migrate to prompt_cache_options.ttl where applicable |
Preserve conversation history and cacheable instructions
GPT-6.2 appends top-level instructions after the input. Put reusable developer instructions at the start of the input array. Append each new turn after the existing history. Editing an earlier message or tool call can cause the Responses API to drop subsequent reasoning items.
This request keeps the shared coding instructions ahead of the userโs task.
messages = [
{
"role": "developer",
"content": (
"You are a senior software engineer. "
"Follow the project's coding conventions."
)
},
{
"role": "user",
"content": "Review the authentication module."
}
]
response = client.responses.create(
model="gpt-6.2-astra",
input=messages,
reasoning={"effort": "medium"}
)
print(response.output_text)
If your client still uses prompt_cache_retention from GPT-5.5 or earlier, replace it with prompt_cache_options={"ttl": "30m"} when you need a 30-minute retention window. Compare cache reads and writes on repeated requests with the same long prefix. See prompt caching settings.
How Much Does the GPT-6.2 Astra API Cost?
These OpenAI token rates apply to short-context requests and are in US dollars per million tokens. For calls billed through CometAPI, use the rates shown for GPT-6.2 Astra in CometAPI and your account when estimating spend. For a Standard request, choose the short- or long-context rows by input length. Cache reads, cache writes, and Batch processing have their own rates. Check the rate for your request configuration before estimating a production bill. Requests exceeding the model's long-context threshold and requests using other processing tiers may be billed at different rates.
| Pricing category | GPT-6 Astra | GPT-6.2 Astra | Reduction |
|---|---|---|---|
| Standard input / 1M | $10.00 | $8.00 | 20% |
| Standard output / 1M | $50.00 | $40.00 | 20% |
| Cached input / 1M | $1.00 | $0.40 | 60% |
| 30-minute cache write / 1M | $12.50 | $10.00 | 20% |
| 12-hour cache write / 1M | $25.00 | $20.00 | 20% |
| Batch input / 1M | $5.00 | $4.00 | 20% |
| Batch output / 1M | $25.00 | $20.00 | 20% |
When a request exceeds the 272,000-input-token threshold, long-context rates apply to the entire request rather than only the tokens above the threshold. At the listed Standard rates, GPT-6.2 Astra is billed at $16 per million input tokens and $60 per million output tokens for that request. This can significantly change the cost of large-context workloads.
Estimate a request at OpenAI Standard rates
With 100,000 uncached input tokens and 10,000 billed output tokens, GPT-6.2 Astra costs $0.80 for input plus $0.40 for output, or $1.20. The same token counts cost $1.50 with GPT-6 Astra. At 10,000 identical requests, the difference is $3,000.
OpenAI applies long-context pricing to the full request above 272,000 input tokens. At Standard rates that brings input to $16 and output to $60 per million tokens. Include reasoning tokens in the billed output count when comparing two runs.
Estimate a request at CometAPI rates
As of November 19, 2026, the published CometAPI rates for GPT-6.2 Astra are $6.40 per million uncached input tokens, $0.32 per million cached input tokens, and $32.00 per million output tokens.
For the same request with 100,000 uncached input tokens and 10,000 billed output tokens, input costs $0.64 and output costs $0.32. The estimated token charge is $0.96, or $0.24 less than the $1.20 OpenAI Standard estimate above.
Why Use CometAPI for GPT-6.2 Astra?
CometAPI gives a team that already uses the OpenAI Python SDK a way to try Astra with the client it already maintains. Set the CometAPI base URL and key, select gpt-6.2-astra, and replay a request from your test suite. You can compare the two models on the same input before changing the rest of the application.
Cost can also make that trial worthwhile. Using the November 19 rates in this guide, a request with 100,000 uncached input tokens and 10,000 billed output tokens comes to $0.96 through CometAPI and $1.20 at OpenAI Standard short-context rates. That is $0.24 less for this request. Use the input, output, and cache counts from your own traffic with your account rates to see whether the saving holds for your workload.
Conclusion
To get started with the GPT-6.2 Astra API through CometAPI, run one request whose answer you can check. For a GPT-6 Astra migration, replay the same request on both models. An order-support assistant, for example, should return the correct order status, finish within your latency budget, and meet your target cost per resolved case. Use those results to decide when to expand traffic.
FAQ
Is GPT-6.2 Astra API compatible with GPT-6 Astra?
Yes, with changes to some requests. You can keep the OpenAI SDK and switch the model ID to gpt-6.2-astra. Review the sampling parameters your client sends, choose a supported reasoning effort, and move tool-calling workflows to the Responses API. Then replay a known request and check its answer and tool results before directing live traffic to the new model.
Why does the Python example stop before printing an answer?
Read the status in the exception. For an incomplete response, inspect response.incomplete_details. If the reason is max_output_tokens, the generation budget was exhausted. Request a shorter answer or raise the limit, then check the status again.
What should I do if a streamed response disconnects?
Keep the text received so far as a partial result. Wait for confirmed completion before accepting generated JSON or executing a tool request. If you retry, keep the new answer separate so a user does not see duplicated text.
How can I test a model switch before moving production traffic?
Replay a small set of requests with known outcomes. Include a tool lookup, a structured response, and a multi-turn task. Compare answers against the same acceptance criteria, then review latency, retries, and total tokens for the runs that pass.


