GUIDE

Point the OpenAI SDK at Chernion.

Chernion speaks the OpenAI API, so you keep the SDK you already use. The whole change is the base URL and the key. Streaming and tool calls keep working, and the same call now reaches GPT, Claude, or Gemini for a fraction of official pricing.

BEFORE YOU START

Two things to have ready.

You need a Chernion key and a balance to spend against. Both take a minute.

  • Create a key in the dashboard. It looks like sk-chrn-live-… and is shown once, so copy it then.
  • Top up a prepaid balance with crypto or a card. There is no minimum, so a few dollars is plenty to test with.
PYTHON

The Python SDK.

Set base_url to the Chernion endpoint and pass your key. Everything else is unchanged.

app.py
1from openai import OpenAI
2
3client = OpenAI(
4 base_url="https://api.chernion.ai/v1",
5 api_key="sk-chrn-live-…",
6)
7
8resp = client.chat.completions.create(
9 model="gpt-5.4",
10 messages=[{"role": "user", "content": "Hi"}],
11)
NODE

The Node SDK.

Same idea in TypeScript: set the base URL and read the key from the environment.

index.ts
1import OpenAI from "openai";
2
3const client = new OpenAI({
4 baseURL: "https://api.chernion.ai/v1",
5 apiKey: process.env.CHERNION_API_KEY,
6});
NO CODE CHANGE

Or set it in the environment.

The OpenAI SDK also reads the base URL and key from the environment, so you can switch a whole project without touching the code.

shell
1# the OpenAI SDK reads these from the environment
2export OPENAI_BASE_URL=https://api.chernion.ai/v1
3export OPENAI_API_KEY=sk-chrn-live-…

Model ids such as gpt-5.4 and sonnet-4.6 are the same ones you pass in the request. The per call cost comes back in a chernion field on the response.

VERIFY

Confirm it works.

Run one request. A success returns a normal chat completion, plus a chernion field that carries the exact cost of the call, so you know billing is wired up.

shell
1curl https://api.chernion.ai/v1/chat/completions \
2 -H "Authorization: Bearer sk-chrn-live-…" \
3 -H "Content-Type: application/json" \
4 -d '{"model":"gpt-5.4","messages":[{"role":"user","content":"hi"}]}'
5
6# the response ends with, for example:
7# "chernion": { "cost_usd": "0.000070" }
IF A CALL FAILS

The three errors you might hit first.

  • A 401 means the key is missing, wrong, or revoked. Check that you sent it as a Bearer token and that it is the full secret.
  • A 404 on the model usually means the base URL is missing the version path. The OpenAI surface lives at the /v1 path.
  • A 402 means the balance is empty. Top up and retry.

The full list of error codes and limits is in the docs.

Point the OpenAI SDK at a new base URL · Chernion