Skip to main content

GPT-6.2 Astra and GPT-6.2 Sol are in AI Gateway, and Astra got cheaper

OpenAI’s two newest models are in AI Gateway. GPT-6.2 Astra (openai/gpt-6.2-astra) is for demanding reasoning and coding. GPT-6.2 Sol (openai/gpt-6.2-sol) is for everyday coding and agent work. Pay with your ngrok credits, or attach your own OpenAI key and let OpenAI bill you.

Astra costs 20% less than GPT-6 Astra. Sol costs the same as GPT-6.1 Sol:

Per 1M tokensGPT-6.2 AstraGPT-6 AstraGPT-6.2 SolGPT-6.1 Sol
Input$8.00$10.00$2.00$2.00
Output$40.00$50.00$10.00$10.00
Cached input$0.40$1.00$0.10$0.10
Cache write, 30 minutes$10.00$12.50$2.50$2.50

A prompt over 272K input tokens costs more: $16 input and $60 output per 1M tokens on Astra, and $4 and $15 on Sol. OpenAI’s pricing page lists every rate.

Both models have a 1.05M-token context window and return up to 128K tokens. They read text, images, and files, and images bill at the text input rate.

Try Sol first

Say your rate limiter should allow 10 requests per second with a burst of 20. A client calls it every 30 ms for a minute, so you expect 620 calls to get through. Only 520 do. The limiter resets its clock on every refill, so it throws away the extra 20 ms each time and earns a token every 120 ms instead of every 100 ms.

We showed both models that limiter, from the example below, five times each. Both answered 520 in every run and named the lost 20 ms. Only the bill was different:

ModelCorrect answersCost per answer
GPT-6.2 Sol5 of 5$0.0011 – $0.0013
GPT-6.2 Astra5 of 5$0.0043 – $0.0050

Astra cost about four times as much for the same answer. Start with Sol, and save Astra for the problems Sol gets wrong.

Check your requests before you switch

OpenAI returns a 400 error for two kinds of request to these models, and AI Gateway passes the error back to you:

  • Set reasoning_effort to low, medium, high, or xhigh. Both models reject none and max.
  • Send function tools to the Responses API (/v1/responses). On chat completions, OpenAI rejects function tools for these models.

The gateway removes temperature, top_p, logprobs, and top_logprobs, which these models don’t take, and runs the rest of the request. The Ngrok-AIG-Removed-Params response header names each field it removed.

Get started

Both models accept OpenAI chat completions and Responses requests. These steps use chat completions and the OpenAI SDK. To try the limiter before you write code, paste it into the playground.

  1. Get an access key

    Create an ngrok account or sign in. Create an access key that allows OpenAI and the GPT-6.2 models. Confirm your account has credits, or attach your own OpenAI key.

  2. Install the OpenAI SDK

    The setup guide shows the same steps when you select OpenAI and TypeScript. Install the OpenAI SDK and TypeScript runner:

    npm install openai && npm install --save-dev tsx
  3. Save your access key

    Save your ngrok access key in .env.local. Keep this file out of version control:

    AI_GATEWAY_API_KEY=your_access_key_here
  4. Save the example

    Use an ES module project ("type": "module" in package.json) for top-level await. Save this example as index.ts:

    import OpenAI from "openai"; const client = new OpenAI({	baseURL: "https://gateway.ngrok.ai/v1",	apiKey: process.env.AI_GATEWAY_API_KEY,}); const limiter = `class TokenBucket {	constructor(ratePerSecond, burst) {		this.rate = ratePerSecond;		this.burst = burst;		this.tokens = burst;		this.last = 0;	} 	take(now) {		const refill = Math.floor(((now - this.last) * this.rate) / 1000);		if (refill > 0) {			this.tokens = Math.min(this.burst, this.tokens + refill);			this.last = now;		}		if (this.tokens < 1) return false;		this.tokens -= 1;		return true;	}} const bucket = new TokenBucket(10, 20);let allowed = 0;for (let now = 0; now <= 60_000; now += 30) {	if (bucket.take(now)) allowed += 1;}`; const response = await client.chat.completions.create({	model: "openai/gpt-6.2-sol",	messages: [		{			role: "user",			content: `This rate limiter should allow 10 requests per second with a burst of 20. How many calls does the loop allow? Put only the number on the first line, then explain in one sentence.\n${limiter}`,		},	],}); console.log(response.choices[0]?.message.content);console.log("Reasoning tokens:", response.usage?.completion_tokens_details?.reasoning_tokens);
  5. Run it

    Run the example from your project directory:

    node --env-file=.env.local --import tsx index.ts

    It prints the count, a one-sentence explanation, and the reasoning token count. One run on Sol printed:

    520The loop uses the 20 initial tokens and adds one token every 120 ms, yielding 500 refills by 60,000 ms because each refill resets `last` and discards the fractional token.Reasoning tokens: 7

    The wording varies between runs. The answer is in choices[0].message.content, and usage.completion_tokens_details.reasoning_tokens counts the reasoning tokens, which bill as output. The OpenAI SDK guide covers the rest of the SDK.

  6. Check the request in Activity

    Open Activity, find the request, and inspect its model, provider, status, token usage, and cost. Then change model to "openai/gpt-6.2-astra", run the example again, and compare the two costs.