1. Install the SDK

Shell
pip install openai

2. Set your API key

Shell
export OPENAI_API_KEY="your_api_key"

3. Send a Responses API request

Python
from openai import OpenAI

client = OpenAI()

response = client.responses.create(
    model="gpt-6-astra",
    input="Explain three practical uses of long-context reasoning."
)

print(response.output_text)

For new projects, OpenAI recommends the Responses API. Astra uses the model ID gpt-6-astra.

Use reasoning effort deliberately

Python
response = client.responses.create(
    model="gpt-6-astra",
    reasoning={"effort": "high"},
    input="Review this migration plan and identify hidden failure modes."
)

Astra supports low, medium, high, xhigh and max. Higher effort is useful for harder multi-step tasks but can increase latency and token usage.

Production checklist

  • Log request IDs and errors.
  • Set explicit timeouts and retry transient failures.
  • Measure token usage before sending very large prompts.
  • Check whether the request crosses the 272K long-context pricing threshold.
  • Pin a snapshot if reproducibility matters and a snapshot is available.

Primary sources

Specifications and prices can change. We prefer first-party documentation and record the date each page was reviewed.

  1. OpenAI Developers — GPT-6 Astra model page
  2. OpenAI Developers — Model guidance