GPT-6 Astra API Pricing: The 272K Long-Context Rule

GPT-6 Astra pricing on PiAPI depends on the input context of each request. The standard rates are input 1M = $2.00, cached input 1M = $0.20, and output 1M = $10.00. When input context exceeds 272,000 tokens, the entire request uses the long-context rates: input 1M = $4.00, cached input 1M = $0.40, and output 1M = $15.00.
The higher tier does not apply only to the tokens above the threshold. It changes the input, cached-input, and output rates for that request. That is the distinction to account for when estimating a large document analysis or a conversation with an extensive history.
PiAPI's GPT-6 Astra Price Table
All prices below are in USD per 1M tokens, as listed in the PiAPI completions documentation.
| Input context for the request | Input 1M | Cached input 1M | Output 1M |
|---|---|---|---|
| 272,000 tokens or fewer | $2.00 | $0.20 | $10.00 |
| More than 272,000 tokens | $4.00 | $0.40 | $15.00 |
PiAPI describes these rates as "Limited-time promotional pricing (20% of OpenAI's official pricing)". This is promotional pricing; check the current documentation when planning production usage. A prompt containing repeated text does not by itself establish that those tokens received cached-input pricing. Use the usage and billing information returned for the request.
What Happens at 272,000 Tokens?
The threshold is based on input context, not a combined input-and-output total. At exactly 272,000 input tokens, the standard tier still applies. At 272,001 input tokens, the request has crossed into the long-context tier.
| Request input context | Tier | What changes? |
|---|---|---|
| 271,999 tokens | Standard | Standard input, cached-input, and output rates |
| 272,000 tokens | Standard | The threshold has not been exceeded |
| 272,001 tokens | Long context | All three rates switch for the entire request |
| 300,000 tokens | Long context | The full input and output use the long-context rates |
For the 300,000-token request, it would be incorrect to price the first 272,000 input tokens at $2.00 per 1M and only the remainder at $4.00 per 1M. The input rate is $4.00 per 1M for the request; eligible cached input uses $0.40 per 1M, and its output uses $15.00 per 1M. These categories should be accounted for separately, without counting cached tokens twice.
The same threshold can matter when an application adds conversation history or retrieved material to an otherwise short user question. Budget for the complete input context that the request actually sends. A character count or a count of the latest user message is not a reliable substitute for the request's token usage.
Does OpenAI Use the Same Long-Context Mechanism?
Yes. The OpenAI GPT-6 Astra model documentation states that prompts with more than 272K input tokens use 2x input and cache rates and 1.5x output rates for the full request. PiAPI's completions documentation describes the same threshold and full-request mechanism with the PiAPI prices shown above.
Keep the provider and API route explicit when integrating. This article's example uses PiAPI's documented Chat Completions endpoint. OpenAI's model page also lists other endpoints, tools, and service modes; that list is not evidence that each one is exposed through the PiAPI route in this example.
Make a Small Chat Completions Request
Use the model ID gpt-6-astra with https://api.piapi.ai/v1/chat/completions. PiAPI documents model and messages as required request fields and uses a Bearer API key in the Authorization header.
The following example uses Node.js 22 or newer. Set your generation API key in PIAPI_API_KEY. Its --dry-run option prints the request without making a network call, so you can inspect the model, endpoint, and messages first.
const request = {
model: 'gpt-6-astra',
messages: [
{ role: 'user', content: 'Summarize the purpose of an API in one sentence.' },
],
};
const endpoint = 'https://api.piapi.ai/v1/chat/completions';
async function main() {
if (process.argv.includes('--dry-run')) {
console.log(JSON.stringify({ endpoint, method: 'POST', body: request }, null, 2));
return;
}
const key = process.env.PIAPI_API_KEY;
if (!key) throw new Error('Set PIAPI_API_KEY before submitting a completion.');
const response = await fetch(endpoint, {
method: 'POST',
headers: {
Authorization: `Bearer ${key}`,
'Content-Type': 'application/json',
},
body: JSON.stringify(request),
signal: AbortSignal.timeout(60_000),
});
if (!response.ok) throw new Error(`PiAPI returned HTTP ${response.status}.`);
const data = await response.json();
const content = data.choices?.[0]?.message?.content;
if (typeof content !== 'string') throw new Error('No text completion in the response.');
console.log(content);
if (data.usage) console.log(JSON.stringify({ usage: data.usage }, null, 2));
}
main().catch(error => {
console.error(error.message);
process.exitCode = 1;
});This example has been checked offline against the documented request shape; it is not a record of a successful live completion. It sends a short prompt to demonstrate the request format, not to test the long-context billing boundary. After a real request, inspect its reported usage and billing record when estimating costs. The example does not retry automatically: a local timeout does not establish whether the service completed a request.
Plan Long-Context Usage Deliberately
Choose the context your task needs before optimizing for a price tier. A complete source document may be necessary for one workflow; a relevant excerpt may be sufficient for another. Removing information solely to stay under a threshold can also change the answer, so evaluate that choice against the application's quality requirements.
For production estimates, keep three questions separate:
- How much total input context does the request contain?
- How much of that input is actually billed as cached input?
- How much output does the request generate?
The first determines the tier. The other two determine the usage charged within it. If the application is close to 272,000 input tokens, include the effect of a tier change in its budget rather than assuming a smooth increase from one more input token.
PiAPI's LLM documentation also recommends having another API source ready for availability issues. Validate your application's fallback behavior and costs separately from this pricing table.
Frequently Asked Questions
Is 272,000 tokens itself billed at the higher rate?
No. The long-context tier applies when input context exceeds 272,000 tokens. A request with exactly 272,000 input tokens uses the standard tier.
Is only the input above 272,000 tokens more expensive?
No. Once the request crosses the threshold, the entire request uses the long-context tier. This includes the applicable input, cached-input, and output rates.
Does generating more output trigger the long-context tier?
The documented trigger is input context. Output has its own token charge, and its rate is $10.00 per 1M in the standard tier or $15.00 per 1M in the long-context tier selected by the input.
Which endpoint and model ID should I use?
Use POST https://api.piapi.ai/v1/chat/completions with model: "gpt-6-astra" and messages. Follow the PiAPI completions reference for the current request format.
Where can I check the model and current prices?
See the GPT-6 Astra API page and the completions pricing documentation. Check the current promotional terms before choosing a production budget.



