Canonical: https://ai-release.org/guides/kak-pereyti-s-gpt-6-1-sol-na-gpt-6-2-astra-cherez-api-s.html · Markdown · JSON · Updated: 2026-12-06
curl, jq, an API key with access to both GPT-6.1 Sol and GPT-6.2 Astra, the exact model IDs from your provider's /v1/models page, and 20–50 real prompts from your production app.switch_model.sh config switch that moves all traffic from GPT-6.1 Sol to GPT-6.2 Astra and back, without touching application code.baseline.jsonl (Sol outputs), candidate.jsonl (Astra outputs on the same prompts), and diff_report.md (a per-prompt comparison of output, token counts and JSON validity).export BASE_URL="https://<your-provider-domain>/v1"
export OPENAI_API_KEY="sk-..."
export OLD_MODEL="gpt-6.1-sol" # example id — copy yours from /v1/models
export NEW_MODEL="gpt-6.2-astra" # example id — copy yours from /v1/models
curl -s "$BASE_URL/models" -H "Authorization: Bearer $OPENAI_API_KEY" | jq -r '.data[].id' | grep -E 'sol|astra'
python3 run_prompts.py "$OLD_MODEL" prompts.jsonl baseline.jsonl
python3 run_prompts.py "$NEW_MODEL" prompts.jsonl candidate.jsonl
python3 diff_report.py baseline.jsonl candidate.jsonl > diff_report.mdDetails and verification — in the steps below.

Invoke-RestMethod instead of curl.pip install --upgrade openai jq (jq comes from your package manager: brew install jq / apt install jq).What to do: Export your 20–50 real prompts into prompts.jsonl, one JSON object per line, each with a stable id, then run them all against Sol and save the output.
Why: You cannot detect a compatibility break without a reference. The baseline is that reference — it captures exactly what Sol returns today, so any difference after the swap is attributable to the model, not to your app.
How to check: wc -l prompts.jsonl returns the number you expect, and baseline.jsonl has the same line count.
{"id":"invoice_extract_01","messages":[{"role":"system","content":"Return JSON only."},{"role":"user","content":"Invoice 8841, total 1 240.00 EUR, due 2026-03-01"}],"temperature":0}
{"id":"support_reply_02","messages":[{"role":"user","content":"My order arrived damaged. What now?"}],"temperature":0}run_prompts.py — the same script is used for both models, so the only variable is the model ID:
import json, os, sys
from openai import OpenAI
client = OpenAI(base_url=os.environ["BASE_URL"], api_key=os.environ["OPENAI_API_KEY"])
model, src, dst = sys.argv[1], sys.argv[2], sys.argv[3]
with open(src) as f, open(dst, "w") as out:
for line in f:
p = json.loads(line)
r = client.chat.completions.create(
model=model,
messages=p["messages"],
temperature=p.get("temperature", 0),
)
out.write(json.dumps({
"id": p["id"],
"model": r.model,
"output": r.choices[0].message.content,
"prompt_tokens": r.usage.prompt_tokens,
"completion_tokens": r.usage.completion_tokens,
"finish_reason": r.choices[0].finish_reason,
}) + "\n")Example: python3 run_prompts.py gpt-6.1-sol prompts.jsonl baseline.jsonl finishes silently and writes one line per prompt. Verify:
wc -l prompts.jsonl baseline.jsonl
jq -r '.model' baseline.jsonl | sort -uThe first command prints two identical numbers; the second prints exactly one model ID — the Sol one. If a request fails, the script stops, which is what you want: a partial baseline is worse than none.

What to do: Change the model string in exactly one place — an environment variable or a config file — then re-run run_prompts.py with the Astra ID against the identical prompts.jsonl.
Why: The model ID is a string, not a code path. If it lives in one place (MODEL= in .env, model: in config.yaml, or a MODEL_NAME env var in your container), the migration is a one-line change and rollback is the same one line in reverse. Hardcoded IDs scattered across files are the usual reason migrations take days instead of an hour.
How to check: jq -r '.model' candidate.jsonl | sort -u prints the Astra ID — proof the API actually routed to the new model, not a cached alias.
# .env — the only place the model ID should live
MODEL=gpt-6.2-astrapython3 run_prompts.py "$NEW_MODEL" prompts.jsonl candidate.jsonl
jq -r '.model' candidate.jsonl | sort -uExample: on a 30-prompt set the whole run takes a few minutes and depends on output length; record the wall time with time python3 run_prompts.py ... so you can compare latency later.
Pricing: per-token prices for GPT-6.1 Sol and GPT-6.2 Astra are published on your provider's pricing page — this guide deliberately contains no numbers, because prices change and a stale figure in a config comment is worse than none. Compute your own cost delta from the token counters you already collected:
jq -s '{prompt: map(.prompt_tokens)|add, completion: map(.completion_tokens)|add}' baseline.jsonl
jq -s '{prompt: map(.prompt_tokens)|add, completion: map(.completion_tokens)|add}' candidate.jsonlMultiply those totals by the two per-million rates from the pricing page. If the new model supports a different price tier or caching, the arithmetic is still valid — you are comparing identical prompt text on both sides. For a broader picture of what is available in 2026 before you commit, see Best AI models and neural networks in 2026.
candidate.jsonl line count equals baseline.jsonl.model field on both files is uniform
What to do: Compare the two JSONL files prompt by prompt, flag three classes of failure — invalid JSON, truncated output (finish_reason == "length"), and large length drift — then fix only the prompts that fail.
Why: A new model rarely breaks everything; it breaks the 2–3 prompts that depended on a quirk of the old one. Mechanical diffing finds those in minutes, whereas reading 50 free-text answers by eye finds them in an afternoon.
How to check: diff_report.md lists a FAIL count of 0, or a short explicit list of prompt IDs you have decided to rewrite.
# diff_report.py
import json, sys, re
base = {json.loads(l)["id"]: json.loads(l) for l in open(sys.argv[1])}
cand = {json.loads(l)["id"]: json.loads(l) for l in open(sys.argv[2])}
fails = 0
for pid, b in base.items():
c = cand[pid]
try:
json.loads(c["output"]); json_ok = True
except Exception:
json_ok = False
drift = abs(len(c["output"]) - len(b["output"])) / max(len(b["output"]), 1)
bad = (not json_ok) or c["finish_reason"] == "length" or drift > 0.5
fails += bad
print(f"{'FAIL' if bad else 'OK '} {pid} drift={drift:.0%} json={json_ok} finish={c['finish_reason']}")
print(f"\nFAIL {fails}/{len(base)}")Example: FAIL invoice_extract_01 drift=98% json=False finish=stop means Astra answered the invoice prompt in prose instead of JSON — the system message was not strict enough. Add an explicit schema line ("Respond with a single JSON object, no prose") and re-run just that prompt.
python3 diff_report.py baseline.jsonl candidate.jsonl > diff_report.md
grep -c '^FAIL' diff_report.mdWhen the FAIL count is 0, flip the production env var and keep the old value in MODEL_FALLBACK so rollback is export MODEL=$MODEL_FALLBACK && restart. If your prompts drive an automation flow rather than a chat, connect the switched model to your workflow engine — the wiring is identical for any OpenAI-compatible endpoint, see How to Connect Kimi K3.1 Pro via API: Keys, Pricing and OpenAI-Compatible Setup.
Problem. Every request returns 404 after the switch
{"error":{"message":"The model 'gpt-6.2-astra' does not exist or you do not have access to it","type":"invalid_request_error","code":"model_not_found"}}curl -s "$BASE_URL/models" -H "Authorization: Bearer $OPENAI_API_KEY" | jq -r '.data[].id' | grep astra and copy the string byte for byte. If nothing matches, the key lacks access — request it in the provider console.Problem. Requests that worked on Sol fail with 400
{"error":{"message":"Unrecognized request argument supplied: reasoning_effort","type":"invalid_request_error","param":"reasoning_effort"}}model + messages only) and adding fields back one at a time.Problem. Throughput collapses right after cutover
{"error":{"message":"Rate limit reached for requests","type":"requests","code":"rate_limit_exceeded"}}openai SDK retries twice by default — set max_retries=5 on the client) and request a quota increase in the console before you shift 100% of traffic. Shift in stages: 10% → 50% → 100%.The migration is three artefacts — a baseline, a candidate, a diff report — plus one environment variable, and it is reversible in a single line. Next, wire diff_report.py into CI so every future model bump is measured against the same prompt set instead of being discovered in production.
Do I have to rewrite my prompts for GPT-6.2 Astra?
Only the ones that fail the diff. Most prompts port unchanged; the usual fixes are stricter output-format instructions (JSON schema, "no prose") and removal of parameters the new model does not accept.
How much does the switch cost?
Per-token prices for both models are on your provider's pricing page — check it directly, since published rates change. Compute your own delta from the prompt_tokens and completion_tokens totals in baseline.jsonl and candidate.jsonl.
Can I run both models at the same time?
Yes, and you should during rollout. Keep the model ID in an env var per instance and route 10% of traffic to Astra, comparing error rates and token usage before widening.
What do I do if Astra output is worse for one specific task?
Keep that prompt on Sol and migrate the rest. Two model IDs in the same deployment are fine as long as each one lives in configuration, not in code.
Status: practical guide. Some statements come from vendors; verify in your environment.
Time to complete: 45–60 minutes Difficulty: Intermediate
Machine data: Citation Map JSON · JSON-LD · Semantic Embeddings — separate stage.
| Entity | Type | Role |
|---|---|---|
| как перейти на GPT-6.2 Astra | продукт/модель | упоминается в заголовке, TL;DR или разделах гайда |
| GPT-6.2 Astra API настройка | продукт/модель | упоминается в заголовке, TL;DR или разделах гайда |
| GPT-6.2 Astra или GPT-6.1 Sol разница | продукт/модель | упоминается в заголовке, TL;DR или разделах гайда |
| миграция на новую модель OpenAI API | тема/инструмент | упоминается в заголовке, TL;DR или разделах гайда |
| Python | платформа/технология | упоминается в заголовке, TL;DR или разделах гайда |
| OpenAI | компания | упоминается в заголовке, TL;DR или разделах гайда |
| GPT-6.1 | продукт/модель | упоминается в заголовке, TL;DR или разделах гайда |
| GPT-6.2 | продукт/модель | упоминается в заголовке, TL;DR или разделах гайда |
| gpt-6 | продукт/модель | упоминается в заголовке, TL;DR или разделах гайда |
No independent confirmation is provided; source claims and editorial conclusions are separated below.
| Source | Type | Role |
|---|---|---|
| No external links | — | — |
Cite as: AI Release. Как перейти с GPT-6.1 Sol на GPT-6.2 Astra через API: смена модели, цены и проверка совместимости промптов. ai-release.org.