Start now
per 1M input tokens
$0.15
Output tokens / 1M
$0.50
token context
100,000
trial credit
$0.50
requests per minute
300

OpenAI API Replacement: Migration Checklist

An openai api replacement only works smoothly if you check three things first: which endpoints your code calls, which features it relies on, and how the new model behaves on your prompts. This checklist covers all three, with commands you can run today.

Last updated

A glass pipe being rerouted between two valves beside a board of lit and unlit status panels

Summary

  • Chat completions, responses, streaming, tools and JSON mode work with the standard OpenAI SDK after a base URL change.
  • Embeddings, image, audio and fine-tuning endpoints are not available. Keep those on their current provider.
  • The model is a different one, so test prompts before cutting over. Keep a flag to switch back.
  • Billing is prepaid and per token: $0.15 per 1M input and $0.50 per 1M output.

Step 1: inventory what your code calls

Before changing anything, list which OpenAI features you actually use. Most projects use fewer than they think, and the list decides whether this swap is a five-minute job or a partial one. Run these from the project root:

# New values you will point the project at:
export OPENAI_BASE_URL="https://api.alternativeapiopenai.com/v1"
export OPENAI_API_KEY="YOUR_API_KEY"
export MODEL="uncensored"

# What does the code call today?
grep -rnE "embeddings|images\.|audio\.|fine_tuning|moderations|assistants|batches" --include="*.py" --include="*.js" --include="*.ts" .
grep -rnE "model *[=:] *['\"]" --include="*.py" --include="*.js" --include="*.ts" .

The first grep finds endpoints that this API does not offer. The second lists every hard-coded model name, which you will need to change. Put the findings into a short table with one row per feature: used, not used, and what to do about it.

Step 2: compare against what is supported

OpenAI featureHereNotes
Chat completionsYesPOST /v1/chat/completions
Responses APIYesPOST /v1/responses
List modelsYesGET /v1/models returns uncensored
StreamingYesSSE, with usage at the end
Tool callingYestools, tool_choice, streamed tool_calls, role: "tool" results
JSON modeYesresponse_format: {"type":"json_object"}
Sampling parametersYestemperature, top_p, stop, seed, penalties
EmbeddingsNoNot offered
Image, audio, video generationNoText only
Fine-tuningNoNot offered

Anything not on the supported side of this table should be treated as unavailable until you confirm it in the documentation. That includes schema-constrained output: JSON mode makes the model return valid JSON, but it does not enforce your own schema, so keep your validation code. Image inputs to a chat message are also not listed, so plan on text prompts only.

The model is a single open-weight model run by an independent provider. It is not OpenAI's model and not an official API of any vendor, and it does not route between vendors. Expect different style, different strengths and different failure modes.

Step 3: make the swap

With the official Python SDK, three values change:

from openai import OpenAI

client = OpenAI(
    base_url="https://api.alternativeapiopenai.com/v1",  # was the default OpenAI URL
    api_key="YOUR_API_KEY",                               # was your old key
)

resp = client.chat.completions.create(
    model="uncensored",                                   # was your old model name
    messages=[{"role": "user", "content": "Give me three names for a coffee shop."}],
)
print(resp.choices[0].message.content)

Better still, keep the base URL, key and model name in configuration so the same build can point at either provider. A simple pattern is three environment variables: LLM_BASE_URL, LLM_API_KEY and LLM_MODEL. Then a rollback means changing three values and restarting, not shipping a new release.

If your code uses the Responses API, the same three values apply. For frameworks such as LangChain or LlamaIndex, look for the OpenAI-compatible connector and pass the same base URL and model name.

Step 4: test before production

The risk in any model swap is behaviour, not connection. Test these in order:

  1. Connection. One request with curl. If it returns a reply, the key and URL are right.
  2. Your real prompts. Replay at least twenty production prompts and review the output. Check tone, length and instruction following.
  3. Tool calls. Run each of your tools and check the arguments the model produces. Confirm that your loop handles tool_calls in a streamed response.
  4. JSON output. Run a hundred JSON-mode calls and count how many fail your parser or schema.
  5. Long inputs. The context window is 100,000 tokens for prompt plus completion. Test a large prompt once so you know how long it takes.
  6. Limits. A full key allows 8 concurrent requests and 300 per minute. Load-test at your real peak.

Token counts will differ

If your code estimates tokens with a tokenizer library built for another model, treat the result as approximate. Use the usage object in each response for billing and budgeting, and leave a safety margin when you trim history to fit the 100,000-token window. Setting max_tokens is optional here, but a sensible cap stops a runaway reply from spending more than you planned.

What the errors look like

Over a limit, the API returns HTTP 429 with the code rate_limited (requests per minute) or concurrency (too many at once). A temporary overload also returns 429, with a Retry-After: 5 header. A streamed request holds its concurrency slot until the stream ends, so slow clients count against you. Failed or refused requests are not charged.

Step 5: check the cost

The price is $0.15 per 1M input tokens and $0.50 per 1M output tokens, paid from prepaid credit. To compare with your current bill, use your own token counts from the usage field and apply the formula: cost = input_tokens x 0.15 / 1,000,000 + output_tokens x 0.50 / 1,000,000. For other providers, check their current pricing and plug in the same counts.

A worked example: a support tool handles 30,000 requests a month with 1,200 input and 250 output tokens each. Input is 36M tokens, costing $5.40. Output is 7.5M tokens, costing $3.75. The monthly total is $9.15. If the same workload fills the context window instead, at 100,000 input tokens, each request costs $0.015 in input alone, so prompt size is the number to watch.

The pricing page lists top-up amounts. They run from $20 to $500, with +5% from $50, +10% from $100 and +15% from $200, paid in crypto only (USDT on TRC20 or USDC on Base). Credit never expires, and there is no subscription. The related guide on API pricing for uncensored models explains the cost structure in more depth.

Step 6: roll out and keep a way back

Send a small share of traffic to the new endpoint first. Log the request ID from the X-Request-Id header so you can trace a bad answer, and record X-Balance-USD after calls so credit never runs out unnoticed. Alert when the balance drops below a few days of spend.

When the shadow traffic looks good, raise the share in steps and keep the old provider's key valid for a week. For anything involving adult content, the model is meant for lawful adult use, and sexual content involving minors is always refused. Prompts are not used for training.

New accounts can claim $0.50 of trial credit with one click on the API key page, valid for 7 days, which is enough to run the whole checklist on a sample of your traffic.

Common questions

Will my existing OpenAI SDK code work?

For chat completions and responses, yes. Change the base URL, key and model name. Calls to embeddings, images, audio or fine-tuning will not work.

Is the answer quality the same as OpenAI's models?

No, it is a different open-weight model. Test your own prompts instead of assuming parity in either direction.

How do I roll back if something breaks?

Keep the base URL, key and model in configuration and keep your old provider key active. Switching back is then a configuration change.

Does it support function calling?

Yes. Use tools and tool_choice, and return results as messages with role tool. Streamed tool_calls are supported.

Key generation requires just a form

Sign up, copy your key, and update your base URL. That is all configuration required.