API Guides

GPT-6 Astra Responses API Guide: Text Requests, SSE and Access Checks

Use gpt-6-astra as the model ID for GPT-6 Astra in OpenAI's Responses API. For a text request, send model and input; for HTTP streaming, add stream: true and consume server-sent events (SSE).

The examples below target OpenAI's official API. For LLMAPI, check the exact model ID, your key permissions, billing mode and supported protocol separately. Do not treat a catalog entry or general OpenAI compatibility as confirmation that the same Responses request will work on your account.

1. Confirm the model ID and request scope

The OpenAI model catalog identifies GPT-6 Astra as gpt-6-astra and lists model availability through the Responses API. Use that request ID, not the display name GPT-6 Astra, in the official examples below.

This guide focuses on plain text and HTTP SSE streaming, not tool execution or WebSocket connections. The GPT-6 usage guide also documents an important configuration restriction: GPT-6 Astra does not support the none reasoning effort. The minimal requests here leave reasoning configuration unspecified.

For official model specifications and pricing, use the OpenAI model catalog. For LLMAPI availability and prices, use its own catalog and billing pages; those are separate from official vendor specifications.

2. Send an official Responses API text request

The OpenAI text-generation guide documents this HTTP endpoint and request structure. Replace YOUR_API_KEY with your official API credential for this request.

curl "https://api.openai.com/v1/responses" \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -d '{
    "model": "gpt-6-astra",
    "input": "Write a one-sentence bedtime story about a unicorn."
  }'

The same guide provides a Python SDK example using client.responses.create. With your official SDK credentials configured:

from openai import OpenAI

client = OpenAI()

response = client.responses.create(
    model="gpt-6-astra",
    input="Write a one-sentence bedtime story about a unicorn.",
)

print(response.output_text)

The bedtime-story prompt is a documentation example, not a fixed expected response or a benchmark. Use it as a small initial request before substituting your application prompt.

Read the returned text without assuming an array position

In the HTTP response, generated content appears in the output array. That array can contain more than a single assistant message, including tool calls and reasoning-related items. Do not assume text is always at output[0].content[0].text.

For the Python example, response.output_text is the documented convenience property that aggregates text outputs into one string. If you process raw response objects instead, inspect the output item and content types rather than relying on the first array element.

3. Stream the official response over SSE

OpenAI's streaming guide distinguishes the default full HTTP response from streaming: streaming lets you process the beginning of the output while generation continues. Its HTTP streaming mechanism is SSE, enabled with stream=True in Python or stream: true in JavaScript.

This Python example follows the documented event-iteration pattern:

from openai import OpenAI

client = OpenAI()

stream = client.responses.create(
    model="gpt-6-astra",
    input=[
        {
            "role": "user",
            "content": "Say 'double bubble bath' ten times fast.",
        },
    ],
    stream=True,
)

for event in stream:
    print(event)

This prints event objects, not just the generated text. It is useful as an initial inspection example because Responses streaming uses typed semantic events.

For text rendering, the guide documents the following JavaScript event-handling pattern. This example combines its request and handler:

import { OpenAI } from "openai";

const client = new OpenAI();

const stream = await client.responses.create({
  model: "gpt-6-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);
  }
}

The roles of these branches are distinct:

  • response.output_text.delta: append a text fragment.
  • response.completed: handle the completion event.
  • error: report the event's error message.

These are selected event types, not a complete application lifecycle handler. The streaming documentation also lists failure, refusal and tool-related event types. Review the events relevant to your application before treating this text-only example as a complete integration.

SSE is not WebSocket transport. Keep this request path separate from any evaluation of persistent WebSocket connections or incremental inputs.

4. Check LLMAPI access before adapting the examples

Start with LLMAPI client documentation and model selection by billing mode. The documentation lists https://llmapi.pro/v1 as the OpenAI-protocol base URL, but the model-selection guide makes model names, protocol compatibility and billing mode separate settings.

Do not simply replace the official endpoint and assume Responses support. For an LLMAPI integration, verify the following against your account and selected model or channel:

Check What to establish
Exact request ID Copy the model ID from the applicable subscription list or pay-as-you-go catalog, rather than a display name.
Key permissions Confirm that your selected key permits the model and required features.
Protocol and endpoint Confirm support for the Responses endpoint specifically, not only general OpenAI compatibility.
Streaming behavior Confirm the required SSE event interface for that model and route.
Additional capabilities Check WebSocket and tool support separately if your application needs them.
Billing mode Match the key to subscription allowance or the separate metered balance.

LLMAPI identifies the live catalog and your key permissions as authoritative for model IDs, protocols and features. Treat a catalog listing as a selection aid, not as proof of a successful request. Keep the official OpenAI examples above separate from account-specific LLMAPI validation.

5. Match the key to the billing mode

LLMAPI documents two distinct billing paths:

  • Monthly subscription: use a subscription key; supported models share the plan quota.
  • Pay-as-you-go API: use a separate API billing key and balance; charges follow the selected channel's prices.

The keys are not interchangeable. Adding API credit does not increase subscription quota. Likewise, client support for the OpenAI protocol does not mean every model is included in your subscription.

Use subscription plans for current plan terms and API channels and pricing for metered model availability, supported protocols and rates. The metered catalog states that displayed CNY prices already include the group multiplier; account-specific rules follow the console, and the final ledger is authoritative.

Before proceeding beyond an initial request, confirm the endpoint, model ID, key type and billing mode together. For official OpenAI access, use the official text and SSE examples. For LLMAPI access, establish model-specific Responses compatibility first, then validate the request under the matching account permissions and billing mode.

Share this article

Start using LLM API

Free tier available. One-line configuration for Claude Code.

Get Started Free