# How to migrate from GPT-6.1 Sol to GPT-6.2 Astra via API: model swap, pricing and prompt compatibility checks

> AI Release · @ai_releaseorg · https://ai-release.org/guides/kak-pereyti-s-gpt-6-1-sol-na-gpt-6-2-astra-cherez-api-s_en.html

## AI summary

Time to complete: 45–60 minutes Difficulty: Intermediate

### Key facts

1. Time to complete: 45–60 minutes (source: #tldr; status: заявление источника)
2. Difficulty: Intermediate (source: #tldr; status: заявление источника)
3. You'll need: Python 3.10+, 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. (source: #tldr; status: заявление источника)
4. Linux, macOS, or WSL2. The commands below assume a POSIX shell; on Windows use PowerShell and Invoke-RestMethod instead of curl. (source: #requirements; status: заявление источника)
5. Python 3.10 or newer with the SDK: pip install --upgrade openai jq (jq comes from your package manager: brew install jq / apt install jq). (source: #requirements; status: заявление источника)
6. An API key that is authorised for both models. Keys are per-project in most providers — if Astra returns 404, the key is the first thing to check, not the code. (source: #requirements; status: заявление источника)

### Direct answers

**What is required?** — Linux, macOS, or WSL2. The commands below assume a POSIX shell; on Windows use PowerShell and Invoke-RestMethod instead of curl.; Python 3.10 or newer with the SDK: pip install --upgrade openai jq (jq comes from your package manager: brew install jq / apt install jq).; An API key that is authorised for both models.… (#requirements)
**How to do it?** — Step 1. Freeze a baseline on GPT-6.1 Sol → Step 2. Switch the model ID and re-run the same prompts → Step 3. Diff the outputs, fix prompts, cut over (#step-1)
**Which topics does it cover?** — как перейти на GPT-6.2 Astra, GPT-6.2 Astra API настройка, GPT-6.2 Astra или GPT-6.1 Sol разница, миграция на новую модель OpenAI API (#entities)
**What are the key points?** — Time to complete: 45–60 minutes Difficulty: Intermediate (#tldr)

- Canonical: https://ai-release.org/guides/kak-pereyti-s-gpt-6-1-sol-na-gpt-6-2-astra-cherez-api-s_en.html
- Markdown: https://ai-release.org/guides/kak-pereyti-s-gpt-6-1-sol-na-gpt-6-2-astra-cherez-api-s_en.md
- JSON: https://ai-release.org/guides/kak-pereyti-s-gpt-6-1-sol-na-gpt-6-2-astra-cherez-api-s_en.json

## TL;DR

- **Time to complete:** 45–60 minutes
- **Difficulty:** Intermediate
- **You'll need:** Python 3.10+, `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.

## What you'll get

- A `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.
- Three files on disk: `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).
- A signed-off compatibility checklist telling you which of your prompts need editing before cutover.

## Quick start

```bash
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.md
```

Details and verification — in the steps below.

## Requirements and setup
![Illustration: Requirements and setup](https://ai-release.org/guides/img/kak-pereyti-s-gpt-6-1-sol-na-gpt-6-2-astra-cherez-api-s-en-1.jpg?v=1796568128)


- Linux, macOS, or WSL2. The commands below assume a POSIX shell; on Windows use PowerShell and `Invoke-RestMethod` instead of `curl`.
- Python 3.10 or newer with the SDK: `pip install --upgrade openai jq` (`jq` comes from your package manager: `brew install jq` / `apt install jq`).
- An API key that is authorised for both models. Keys are per-project in most providers — if Astra returns 404, the key is the first thing to check, not the code.
- A local copy of your prompt set with real user inputs. Do not test with "hello world": prompt drift shows up on long instructions with JSON output, tools or few-shot examples.
- 5 MB of free disk space for the JSONL logs.

## Step 1. Freeze a baseline on GPT-6.1 Sol

**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.

```json
{"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:

```python
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:

```bash
wc -l prompts.jsonl baseline.jsonl
jq -r '.model' baseline.jsonl | sort -u
```

The 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.

## Step 2. Switch the model ID and re-run the same prompts
![Illustration: Step 2. Switch the model ID and re-run the same prompts](https://ai-release.org/guides/img/kak-pereyti-s-gpt-6-1-sol-na-gpt-6-2-astra-cherez-api-s-en-2.jpg?v=1796568133)


**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.

```bash
# .env — the only place the model ID should live
MODEL=gpt-6.2-astra
```

```bash
python3 run_prompts.py "$NEW_MODEL" prompts.jsonl candidate.jsonl
jq -r '.model' candidate.jsonl | sort -u
```

**Example:** 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:

```bash
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.jsonl
```

Multiply 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](https://ai-release.org/guides/luchshie-nejroseti-i-modeli-2026.html?utm_source=tg&utm_medium=channel&utm_campaign=guide_inline&utm_content=guide_to_guide).

- [ ] Model ID stored in one place only
- [ ] `candidate.jsonl` line count equals `baseline.jsonl`
- [ ] `.model` field on both files is uniform
- [ ] Token totals recorded for the cost comparison
- [ ] Rollback command written down and tested once

## Step 3. Diff the outputs, fix prompts, cut over
![Illustration: Step 3. Diff the outputs, fix prompts, cut over](https://ai-release.org/guides/img/kak-pereyti-s-gpt-6-1-sol-na-gpt-6-2-astra-cherez-api-s-en-3.jpg?v=1796568144)


**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.

```python
# 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.

```bash
python3 diff_report.py baseline.jsonl candidate.jsonl > diff_report.md
grep -c '^FAIL' diff_report.md
```

When 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](https://ai-release.org/guides/kak-podklyuchit-kimi-k3-1-pro-cherez-api-klyuchi-tseny.html?utm_source=tg&utm_medium=channel&utm_campaign=guide_inline&utm_content=guide_to_guide).

## Troubleshooting

**Problem. Every request returns 404 after the switch**

- Error: `{"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"}}`
- Cause: the ID string is wrong (a typo, a marketing name instead of the API ID), or your key's project has no access to the new model.
- Solution: `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: `{"error":{"message":"Unrecognized request argument supplied: reasoning_effort","type":"invalid_request_error","param":"reasoning_effort"}}`
- Cause: a parameter your old code passes is not accepted by the new model. Parameters differ between models even on the same endpoint.
- Solution: remove the parameter from the request body or gate it behind a per-model flag. Bisect by sending a minimal request (`model` + `messages` only) and adding fields back one at a time.

**Problem. Throughput collapses right after cutover**

- Error: `{"error":{"message":"Rate limit reached for requests","type":"requests","code":"rate_limit_exceeded"}}`
- Cause: the new model has its own quota tier, separate from the old one; your previous headroom does not transfer.
- Solution: add exponential backoff (the `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%.

## Summary and next steps

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.

## FAQ

**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.
