GPT-6.2 Astra Responses API Guide: Text, SSE Streaming and Migration
Use gpt-6.2-astra as the model ID in client.responses.create() for an official OpenAI text request. Read response.output_text for aggregated text, or enable stream to receive server-sent events (SSE). When migrating an ongoing conversation, preserve its existing prefix: GPT-6.2 drops reasoning items when it detects prefix edits, a model downgrade, or a change of end user or organization.
The examples below target the official OpenAI API. For LLMAPI, first verify the exact model ID, Responses protocol availability and key permissions for your account; an OpenAI-compatible client configuration alone is not confirmation of that combination.
Make a minimal text request
The OpenAI text generation guide documents both of these SDK calls. Keep the punctuation in the model ID: the request value is gpt-6.2-astra, not the hyphenated article slug.
These examples retain the SDK's default client initialization. Configure credentials for the service you intend to call before running them; they do not configure an LLMAPI connection.
Python
from openai import OpenAI
client = OpenAI()
response = client.responses.create(
model="gpt-6.2-astra",
input="Write a one-sentence bedtime story about a unicorn.",
)
print(response.output_text)
TypeScript
import OpenAI from "openai";
const client = new OpenAI();
const response = await client.responses.create({
model: "gpt-6.2-astra",
input: "Write a one-sentence bedtime story about a unicorn.",
});
console.log(response.output_text);
The story prompt is a sample input, not a promise of a particular generated answer.
Use output_text rather than assuming the answer lives at output[0].content[0].text. The response's output array can include multiple items, including tool calls and reasoning-related data. The SDK convenience property aggregates text outputs into one string.
Stream responses over SSE
The OpenAI streaming guide describes HTTP streaming with SSE. Without streaming, the API generates the entire output before returning it in one HTTP response. Streaming lets you process the beginning while generation continues.
Python: inspect the event stream
Set stream=True and iterate over the returned stream:
from openai import OpenAI
client = OpenAI()
stream = client.responses.create(
model="gpt-6.2-astra",
input=[
{
"role": "user",
"content": "Say 'double bubble bath' ten times fast.",
},
],
stream=True,
)
for event in stream:
print(event)
This example prints events, not just generated text. It is useful for inspecting the typed event stream before deciding which events your application should display or handle.
TypeScript: handle text deltas, completion and errors
The following combines the documented streaming request with the guide's event-handling example:
import { OpenAI } from "openai";
const client = new OpenAI();
const stream = await client.responses.create({
model: "gpt-6.2-astra",
input: [
{
role: "user",
content: "Say 'double bubble bath' ten times fast.",
},
],
stream: true,
});
for await (const event of stream) {
if (event.type === "response.output_text.delta") {
process.stdout.write(event.delta);
} else if (event.type === "response.completed") {
console.log("\nResponse completed.");
} else if (event.type === "error") {
console.error(event.message);
}
}
Responses streaming uses typed semantic events. Text deltas, completion and errors are examples, not the entire event schema. Treat this as a minimal text-streaming example rather than a complete handler for every response type.
Preserve reasoning context during migration
The GPT-6.2 migration guide identifies four changes that cause the API to drop reasoning items:
| Detected change | Integration review |
|---|---|
| Conversation-history prefix edits | Check whether earlier instructions or tool calls are being rewritten. |
| Model downgrade | Review model changes during an ongoing conversation. |
| End-user change | Check whether the continuing conversation still belongs to the same end user. |
| Organization change | Review organization changes between responses. |
When reasoning items become unavailable, answer quality can decline and the model may consume more tokens repeating earlier work. This is a migration concern even if the text request itself remains valid.
Keep the prefix unchanged when changing settings between responses. OpenAI recommends this to preserve reasoning and keep earlier input eligible for prompt caching. Eligibility is not a guarantee that any particular request will receive a cache benefit.
As an illustrative integration review—not an observed LLMAPI behavior—look for application logic that rewrites an earlier instruction or modifies an earlier tool call before continuing a conversation. Those are the kinds of history edits the migration guide asks developers to identify. Preserving the prefix does not remove the separate concerns about downgrades or identity changes.
The same guide describes Astra as more concise and direct by default than earlier models. Revisit existing instructions such as “be concise” during migration rather than carrying every style instruction forward unchanged.
Verify LLMAPI access separately from official capabilities
The official SDK examples establish the OpenAI request pattern. For an LLMAPI integration, use the model selection documentation and live channel catalogue to check your account's configuration before adapting a request.
Verify these separately:
- Model ID: Copy the exact request ID from the relevant subscription list or metered channel catalogue, rather than using a display name.
- Protocol and features: Confirm that the selected model and channel support the protocol your client will send. For these examples, explicitly check Responses API and streaming availability rather than relying on a general OpenAI-compatibility label.
- Key permissions: Check that your key can access the selected model and features.
- Billing mode: Use a subscription key for subscription allowance, or a metered API key with its separate balance. The two key types are not interchangeable.
The live catalogue and your key permissions are authoritative for LLMAPI model IDs, protocols and features. Do not interpret the official examples here as a claim that GPT-6.2 Astra Responses requests have been tested on LLMAPI or are included in your subscription.
The base URL checker and client setup tool can help check URL formatting. Its checks run locally in the browser and make no API request, so a formatting check does not validate credentials or establish model access.
Check current pricing before choosing a route
For official model specifications and current OpenAI pricing, consult the OpenAI models page. For LLMAPI metered availability and pricing, consult the channel catalogue. These are separate references: the site's channel catalogue is not the official vendor specification.
LLMAPI channel model lists, pricing and compatible protocols can differ. Account-specific adjustments follow the applicable console rules, and the final ledger is authoritative. Subscription allowance is separate from metered API balance; topping up API credit does not increase subscription quota.
Start with the minimal non-streaming example for the service you intend to use, then inspect streaming events. Before continuing existing conversations, review prefix edits, model downgrades and identity changes as a separate migration step.