DEV Community

Cover image for How to Use GPT-6.2 Astra API?
Hassann
Hassann

Posted on Originally published at apidog.com

How to Use GPT-6.2 Astra API?

Quick answer: To use the GPT-6.2 Astra API, send a request to OpenAI's Responses endpoint (POST /v1/responses) with "model": "gpt-6.2-astra", a reasoning effort such as "high", and your input. It costs $8 per million input tokens and $40 per million output tokens, takes up to 922K input tokens and returns up to 128K. Don't set effort to none: the API rejects it.

OpenAI released GPT-6.2 Astra and its cheaper sibling GPT-6.2 Sol on November 17, 2026. If you've called GPT-6 Astra before, most of your code carries over. This guide walks through the GPT-6.2 Astra API from your first request to tool calls, effort tuning, pricing traps and a repeatable test your coding agent can run for you.

Try Apidog today

What you need before your first GPT-6.2 Astra API call

You need four things, and you probably have three of them already:

  1. An OpenAI API key from the platform dashboard, exported as OPENAI_API_KEY.
  2. A paid usage tier. OpenAI's model page lists Astra rate limits starting at the Build tier (5,000 requests and 1M tokens per minute).
  3. The model ID gpt-6.2-astra. The cheaper model is gpt-6.2-sol.
  4. A supported endpoint: Responses, Chat Completions or Batch. Realtime, Assistants and fine-tuning don't support either model.

These specs come from OpenAI's GPT-6.2 Astra model page, checked on November 18, 2026.

Spec GPT-6.2 Astra
Model ID gpt-6.2-astra
Context window 1,050,000 tokens
Max input 922,000 tokens
Max output 128,000 tokens
Knowledge cutoff May 18, 2026
Endpoints Responses, Chat Completions, Batch
Features Streaming, function calling, structured outputs, image input, prompt caching

How to make your first GPT-6.2 Astra API request

The Responses API is the endpoint OpenAI builds new features for, so start there. Here are the steps:

  1. Export your key: export OPENAI_API_KEY=sk-...
  2. Send a request with the model ID and an effort level.
  3. Read output_text for the answer and usage for the token count.

With curl:

curl https://api.openai.com/v1/responses \
  -H "Authorization: Bearer $OPENAI_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "gpt-6.2-astra",
    "reasoning": { "effort": "high" },
    "input": "Review this migration plan and list the three biggest risks."
  }'
Enter fullscreen mode Exit fullscreen mode

With the official Python SDK (pip install --upgrade openai):

from openai import OpenAI

client = OpenAI()  # reads OPENAI_API_KEY

response = client.responses.create(
    model="gpt-6.2-astra",
    reasoning={"effort": "high"},
    input="Review this migration plan and list the three biggest risks.",
)

print(response.output_text)
print(response.usage)
Enter fullscreen mode Exit fullscreen mode

With Node.js (npm install openai):

import OpenAI from "openai";

const client = new OpenAI();

const response = await client.responses.create({
  model: "gpt-6.2-astra",
  reasoning: { effort: "high" },
  input: "Review this migration plan and list the three biggest risks.",
});

console.log(response.output_text);
Enter fullscreen mode Exit fullscreen mode

Check the usage block on every early call. Astra spends reasoning tokens before it writes a word, and those are billed as output. A short answer can still cost more than you expect.

Diagram of a GPT-6.2 Astra API request

Pick a reasoning effort for GPT-6.2 Astra

Reasoning effort is the biggest lever on both quality and cost. OpenAI's reasoning guide lists the values none, minimal, low, medium, high, xhigh and max, and says each model supports only a subset. For GPT-6.2 Astra and Sol, the one confirmed rule is that none is rejected, so every call does some reasoning.

Effort Use it for
low / medium Simple edits, extraction, short answers
high Code review, planning, most hard prompts. A sensible default to start testing
xhigh Long agent runs and async work, only when evals show a clear win
max Your hardest problems, where a better answer pays for several times the tokens

OpenAI doesn't state Astra's default effort, so set it explicitly on every request. That keeps your bills and your test results reproducible.

How much does effort change the bill? Simon Willison ran the same image prompt through each model at three effort levels on launch day and published the costs. Astra cost 11.55 cents at high, 17.70 cents at xhigh and 88.71 cents at max. Going from high to max multiplied the cost by almost eight.

Bar chart of cost per run for GPT models at different efforts

Notice that GPT-6.2 Astra was cheaper than GPT-6 Astra at high and xhigh but pricier at max. Per-token price fell 20%, yet max effort thinks longer. Measure cost per finished task, not cost per million tokens.

Use tools and structured outputs with the GPT-6.2 Astra API

Astra supports function calling, structured outputs and a long list of hosted tools in the Responses API: web search, file search, image generation, code interpreter, hosted shell, apply patch, skills, computer use, MCP and tool search.

A function tool looks the same as it did for GPT-6 Astra:

response = client.responses.create(
    model="gpt-6.2-astra",
    reasoning={"effort": "high"},
    tools=[{
        "type": "function",
        "name": "get_order_status",
        "description": "Look up an order by its ID.",
        "parameters": {
            "type": "object",
            "properties": {"order_id": {"type": "string"}},
            "required": ["order_id"],
        },
    }],
    input="Where is order A-1042?",
)

for item in response.output:
    if item.type == "function_call":
        print(item.name, item.arguments)
Enter fullscreen mode Exit fullscreen mode

Run the function yourself, then send the result back as a function_call_output item with the matching call_id. Astra writes the final answer from it.

For machine-readable output, pass a JSON schema in text.format with "type": "json_schema" and "strict": true. The model then returns JSON that matches your schema, so you can parse it without guesswork.

Two habits help with a model this capable. First, give each tool a tight description and a strict schema; reviewers on launch day reported that Astra can wander on long, open-ended tasks. Second, set max_output_tokens on agent loops so one runaway step can't eat your budget. For background on the endpoint itself, see our OpenAI Responses API guide.

GPT-6.2 Astra API pricing and rate limits

Astra is priced per million tokens, with a surcharge for very long prompts. These rates are from the model page:

Item GPT-6.2 Astra GPT-6 Astra (for reference)
Input $8.00 $10.00
Cached input $0.40 $1.00
Cache writes (30-min retention) $10.00 n/a
Output $40.00 $50.00

The trap is the long-context rule. Once a request goes over 272K input tokens, input and cache rates double and output costs 1.5x for the whole request. A 300K-token prompt is billed at $16 input and $60 output, not just the tokens past the line. If you're feeding Astra whole repositories, chunk or cache below 272K where you can.

Batch jobs suit evals and backfills that can wait; VentureBeat reports Batch runs at half price.

Standard rate limits by tier:

Tier Requests/min Tokens/min
Build 5,000 1,000,000
Launch 10,000 4,000,000
Grow 15,000 40,000,000

Handle 429 responses with exponential backoff. A long agent run at xhigh can burn through a Build-tier token budget fast.

Migrating from GPT-6 Astra to GPT-6.2 Astra

Most code needs one change: the model string. Before you flip it in production, check these:

  • Model ID: gpt-6-astra becomes gpt-6.2-astra.
  • Effort none: if any code path sends it, it now fails. Switch to the lowest value your evals accept.
  • Prompt caching: cached input dropped from $1.00 to $0.40, so stable system prompts and tool lists are now worth caching.
  • Long prompts: re-check any request near 272K tokens against the long-context rule above.
  • Safety: OpenAI says both GPT-6.2 models reach its "Critical" cybersecurity threshold and ship with stricter safeguards. Security tooling prompts may get refusals they didn't get before.

Early reviews are mixed, so test before you switch. Ethan Mollick called Astra "very uneven & weird," and Dan Shipper said it often stopped early on end-to-end builds, per VentureBeat's roundup. Others praised its code review and computer use. Your own prompts are the only benchmark that matters. The GPT-6 Astra API guide covers what carries over from the previous generation, and if most of your traffic is routine, the GPT-6.1 Sol API guide shows the cheaper tier's request shape.

Let your coding agent test GPT-6.2 Astra with Apidog CLI

Pasting prompts into a terminal tells you how Astra did today. It won't tell you when an update breaks your schema next month. Let your coding agent build the check and run it with Apidog CLI instead; you write one prompt.

npm install -g apidog-cli@latest
apidog login --with-token <YOUR_TOKEN>
npx -y skills add https://apidog.com   # pick your agent when prompted
Enter fullscreen mode Exit fullscreen mode

Then give Claude Code, Codex or Cursor one prompt:

In Apidog project <projectId>, create a test case for POST https://api.openai.com/v1/responses
with model "gpt-6.2-astra", reasoning effort "high" and a get_order_status function tool.
Assert status 200, that the output contains a function_call named get_order_status,
that its arguments parse as JSON with an order_id, and that usage.output_tokens is under 4000.
Read the API key from the OPENAI_API_KEY variable in environment <envId>, then run it.
Enter fullscreen mode Exit fullscreen mode

The agent reads the payload schema, checks its file, creates the case and runs it:

apidog cli-schema get test-case-create
apidog cli-schema validate test-case-create --file case.json
apidog test-case create --project <projectId> --file case.json
apidog run --test-case <caseId> --project <projectId> -e <envId> -r cli,json
Enter fullscreen mode Exit fullscreen mode

Keep the key in the Apidog environment, not in the prompt, so it never sits in your agent's context. Add --upload-report to review the run in the Apidog app, or -n 5 to repeat it and see how steady Astra's tool calls are. Swap -r junit into a pipeline and the check reruns on every deploy; the Apidog CLI in CI/CD guide shows the setup, and Apidog CLI in Claude Code covers the agent side. Apidog's Free plan covers teams of up to 4 users.

FAQ

What is the GPT-6.2 Astra API model ID? gpt-6.2-astra. The cheaper sibling is gpt-6.2-sol. Both work on the Responses, Chat Completions and Batch endpoints.

How much does the GPT-6.2 Astra API cost? $8 per million input tokens, $0.40 per million cached input tokens and $40 per million output tokens. Requests over 272K input tokens pay double input and 1.5x output for the whole request.

Why does my GPT-6.2 Astra request fail with reasoning effort none? Both GPT-6.2 models reject "effort": "none". Set high, or the lowest level your tests show works for your task.

What is the GPT-6.2 Astra context window? 1,050,000 tokens in total, with up to 922,000 input tokens and 128,000 output tokens.

Can I use GPT-6.2 Astra with the Chat Completions API? Yes. It's supported, but hosted tools such as web search, computer use and apply patch are listed for the Responses API, so use Responses for agent work.

Is GPT-6.2 Astra available for free? Not in the API; every call is billed. In ChatGPT Work and Codex it's included for Plus, Pro, Enterprise and Edu plans, per OpenAI's launch announcement.

Top comments (0)