OpenAI-Compatible GPT-5.6 API Migration Guide
An OpenAI-compatible API migration to GPT-5.6 or Claude 5 can be a small, controlled change: point your client at https://frugalrelay.me/v1, use a Frugal Relay key, confirm the route and model slug, and run a representative test suite before shifting traffic. The public catalog currently lists 15 model entries, so the main engineering work is choosing a route, measuring token spend, and adding rollout guardrails.
OpenAI-compatible API migration: define the target
Section titled “OpenAI-compatible API migration: define the target”Start by writing down what “compatible” must mean for your application. The canonical supported-models guide says Frugal Relay models use the OpenAI-compatible chat completions API format. That gives you a stable request shape, but it does not remove the need to verify each model name and feature your code relies on.
Treat these as facts to verify, not assumptions:
- Endpoint: Your client should send requests to
https://frugalrelay.me/v1. - Route and model slug: The
modelvalue must be available to your route, such asgpt-5.6-lunaorclaude-sonnet-5. Availability can change when providers release, rename, or retire models. - Request path: Keep your existing chat-completions call shape while you test. If your application uses an operation beyond that shape, check the dashboard and your integration tests before production.
- Credentials: Create a Frugal Relay API key and store it in your secret manager or environment, just as you would any other production credential.
This short target definition prevents a common migration error: treating an OpenAI-compatible endpoint as a promise that every provider-specific option behaves identically.
1. Inventory your current integration
Section titled “1. Inventory your current integration”Before changing code, capture a baseline. List every place your application calls an AI API and record:
- the current base URL and SDK version;
- model names, fallback models, and environment-specific overrides;
- message roles, maximum output settings, streaming, tool calls, and structured response settings;
- typical input and output token counts;
- latency, error rates, and retry behavior;
- the owner and secret used by each environment.
Save a small fixture set of real prompts with sensitive content removed. Include a short question, a long-context request, a structured extraction, and one error case. This is a recommendation for a repeatable comparison; it is not a claim that the relay changes those behaviors.
Also identify where the model name is assembled. A value hidden in a feature flag, database row, or Helm chart is easy to miss when you update only the main application file. Search your repository and deployment configuration for the old model identifiers, then decide which canonical slug will replace each one.
2. Map model names and token prices
Section titled “2. Map model names and token prices”Use the pricing guide and the supported-models guide as your migration source of truth. The current featured entries are:
| Model and route | Input / output per 1M tokens | Migration use |
|---|---|---|
gpt-5.6-luna · Plus | $0.009 / $0.054 | Lowest-priced GPT-5.6 starting point |
gpt-5.6-terra · Plus | $0.09 / $0.54 | Alternative GPT-5.6 price/performance tier |
claude-sonnet-5 · Claude Sale | $0.11 / $0.55 | Lowest-priced Claude 5 entry |
claude-haiku-4-5 · Claude Sale | $0.055 / $0.275 | Lowest-priced Claude entry |
Frugal Relay prices vary by route. Do not turn an advertised discount into a hard-coded universal conversion factor. Record the route with every model price and check the live pricing catalog before a production migration.
For a planning estimate, multiply your measured tokens by the relay rate:
estimated cost = (input_tokens / 1,000,000 × input_rate) + (output_tokens / 1,000,000 × output_rate)For example, 2 million input tokens and 500,000 output tokens on gpt-5.6-luna through the Plus Account Route are approximately (2 × $0.009) + (0.5 × $0.054) = $0.045. That is an estimate using the listed route price, not a billing guarantee. Check the dashboard for the amount actually charged.
Use the AI API cost calculator to repeat the estimate with your request volume and observed retry rate.
3. Switch the endpoint with a small, reversible change
Section titled “3. Switch the endpoint with a small, reversible change”Keep the provider-specific URL in configuration so you can canary the relay without rebuilding your client abstraction. With the OpenAI Python SDK, the integration can look like this:
import osfrom openai import OpenAI
client = OpenAI( api_key=os.environ["FRUGAL_RELAY_API_KEY"], base_url="https://frugalrelay.me/v1",)
response = client.chat.completions.create( model="gpt-5.6-luna", messages=[ {"role": "user", "content": "Summarize this incident report in three bullets."} ],)
print(response.choices[0].message.content)The same endpoint is easy to exercise with curl before wiring it into a service:
curl https://frugalrelay.me/v1/chat/completions \ -H "Authorization: Bearer $FRUGAL_RELAY_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "model": "claude-sonnet-5", "messages": [{"role": "user", "content": "Classify this ticket: password reset"}] }'Use a relay-only key in local, staging, and production environments. The getting started guide covers account setup and the first request. Keep the key out of source control and logs; that is standard operational hygiene, not a Frugal Relay-specific security promise.
4. Verify behavior before moving traffic
Section titled “4. Verify behavior before moving traffic”Run the fixture prompts against the old endpoint and the relay, then compare measurements side by side. A practical migration test records:
| Check | What to measure | Pass condition |
|---|---|---|
| Connectivity | HTTP status and error body | Your client receives a normal completion or an expected, handled error |
| Output contract | JSON parsing, schema validation, tool-call handling | Existing parsers and validators succeed |
| Usage | Input and output token counts from responses or your telemetry | Counts are captured for cost estimation |
| Performance | p50/p95 latency and timeout rate | Within your service’s SLO or an explicitly approved exception |
| Quality | A human or automated rubric on fixture outputs | No unacceptable regression for the feature |
This comparison separates measured facts from recommendations. “The response parsed successfully” is evidence from your test run. “Use gpt-5.4 for every request” would be a recommendation and should be validated against your product’s quality requirements.
Test failure paths deliberately: an invalid model slug, an empty message, a timeout, and a rate or budget limit. Make sure retries have a bounded count and that your application does not accidentally retry a non-transient error. Keep a feature flag or configuration switch available until the canary has completed.
5. Roll out with credit and spend guardrails
Section titled “5. Roll out with credit and spend guardrails”Frugal Relay supports wallet-funded usage without a monthly minimum, while optional plans and restricted routes can have separate eligibility. Pay-as-you-use traffic is useful for a canary, but you still need an upper bound for buggy loops and unexpected traffic.
In the dashboard, set a daily or monthly spending cap per API key under API Keys → Limits, as documented in the pricing guide. A conservative rollout looks like this:
- Create separate keys for development, staging, and production.
- Load only the credits needed for the test window.
- Start with a small percentage of traffic or one internal tenant.
- Watch usage by model and the application’s own latency and quality metrics.
- Increase traffic only after the canary meets its error, quality, and spend thresholds.
The cap is a guardrail, not a forecast. Your application should still enforce request timeouts, bounded retries, and sensible output limits. If a cap is reached, handle the resulting error path gracefully and communicate a temporary degradation to callers.
Choose a model by task, then measure
Section titled “Choose a model by task, then measure”Model selection is often the largest controllable cost decision after traffic volume. Start by evaluating lower-priced options such as gpt-5.6-luna or claude-haiku-4-5, then compare gpt-5.6-terra, gpt-5.6-sol, or Claude 5 models when your task needs a different quality/cost tradeoff.
Turn that guidance into an explicit routing policy:
- Label each request by task type before the model call.
- Assign a default model and a reviewed fallback for each type.
- Sample outputs and track quality, latency, and tokens per successful result.
- Revisit the policy when the dashboard shows a change in model availability or price.
Do not assume a cheaper token rate automatically produces a cheaper feature. A model that needs repeated retries or lengthy corrective prompts can cost more per successful outcome. Measure the complete request path, including retries, when you compare routes.
OpenAI-compatible API migration checklist
Section titled “OpenAI-compatible API migration checklist”Use this checklist in your pull request and release runbook:
- Read the current pricing and supported-models guides.
- Confirm every model slug in the dashboard.
- Add
https://frugalrelay.me/v1as a configurable base URL. - Store a Frugal Relay key in each environment’s secret store.
- Run fixture prompts and compare parsing, quality, latency, and usage.
- Bound retries and test timeout and invalid-model behavior.
- Set a daily or monthly per-key spending cap.
- Canary a small traffic slice and document the rollback switch.
- Record observed token costs and update your budget estimate.
Do I need to rewrite my OpenAI client?
Section titled “Do I need to rewrite my OpenAI client?”Usually, no. Frugal Relay documents an OpenAI-compatible chat-completions format, so a client that already targets that interface can generally keep its request structure while you change the configurable base URL and credentials. Validate any provider-specific options in your test matrix.
Which models can I use after migration?
Section titled “Which models can I use after migration?”The public pricing catalog currently lists 15 model entries, including GPT-5.6 Luna, Terra and Sol plus Claude 5 and Claude 4.x models. Your authenticated Models page is the account-specific availability list.
Is the relay price exactly one-tenth of direct pricing?
Section titled “Is the relay price exactly one-tenth of direct pricing?”No. Prices depend on the selected model and route. Use the live pricing catalog and your dashboard rate for billing calculations.
Where should I start?
Section titled “Where should I start?”Follow the getting started guide, make one test request, and then expand the canary only after your measurements and spending caps are in place.