1. Move secrets to environment variables
Use TKEN_API_KEY on the server. Do not ship API keys in browser bundles, mobile apps or public demo repositories.
OpenAI SDK base URL
If your app already uses the OpenAI JavaScript or Python SDK, keep the client shape and set the base URL to https://www.tken.shop/v1 for TKEN model routing.
import OpenAI from "openai";
const client = new OpenAI({
apiKey: process.env.TKEN_API_KEY,
baseURL: "https://www.tken.shop/v1"
});
const response = await client.chat.completions.create({
model: "MiniMax-M2.7",
messages: [{ role: "user", content: "Say hello in one sentence." }]
});
console.log(response.choices[0].message.content);
Keep a small smoke test in your repo so a model or route change is caught before it reaches production traffic.
import os
from openai import OpenAI
client = OpenAI(
api_key=os.environ["TKEN_API_KEY"],
base_url="https://www.tken.shop/v1",
)
result = client.chat.completions.create(
model="MiniMax-M2.7",
messages=[{"role": "user", "content": "Write one test prompt."}],
)
print(result.choices[0].message.content)
Use TKEN_API_KEY on the server. Do not ship API keys in browser bundles, mobile apps or public demo repositories.
Configure the OpenAI-compatible client base URL as https://www.tken.shop/v1. Keep a small request timeout and log non-sensitive error codes during testing.
Use the live pricing page for current model availability and cost. Do not hard-code public price claims in your own marketing or docs unless you update them whenever pricing changes.
Start with a single chat completion, confirm the model response, then move the same base URL into your app configuration.