1. Confirm model availability
Choose an embedding model visible in your TKEN account and keep its vector dimension stable for each index.
Embeddings API
Point OpenAI-compatible SDK clients at https://www.tken.shop/v1, run a small vector smoke test, then use the same server-side pattern for search, clustering and retrieval jobs.
import OpenAI from "openai";
const client = new OpenAI({
apiKey: process.env.TKEN_API_KEY,
baseURL: "https://www.tken.shop/v1"
});
const result = await client.embeddings.create({
model: process.env.TKEN_EMBEDDING_MODEL,
input: [
"TKEN is an OpenAI-compatible API gateway.",
"Vector search works best with consistent dimensions."
]
});
console.log(result.data.map(item => item.embedding.length));
Treat embedding generation as a backend workflow. Capture only non-sensitive request metadata in logs, and keep raw documents out of shared debugging output.
import os
from openai import OpenAI
client = OpenAI(
api_key=os.environ["TKEN_API_KEY"],
base_url="https://www.tken.shop/v1",
)
response = client.embeddings.create(
model=os.environ["TKEN_EMBEDDING_MODEL"],
input="Create a vector for retrieval testing.",
)
vector = response.data[0].embedding
print(len(vector))
Choose an embedding model visible in your TKEN account and keep its vector dimension stable for each index.
Start with a short input batch, then increase throughput only after latency, error rate and billing behavior are understood.
Redact customer identifiers, raw private documents and API keys before storing logs or sharing examples.
Verify one request, confirm vector shape, then move the same https://www.tken.shop/v1 base URL into your retrieval workflow.