Section
OpenAI-compatible migration

Migrate from an OpenAI-compatible API

Swap base URL and key — keep your code.

If you're already calling an OpenAI-compatible API, you're most of the way to Token Factory. The wire shape matches — same client libraries, same request bodies, same response envelopes. Two lines change.

This page covers the swap, the model-ID shift, the parameters that don't yet round-trip, and where to find the rest.

#The two-line change

Point your existing OpenAI-compatible client at https://api.tokenfactory.omniva.com/v1 and pass a Token Factory API key.

from openai import OpenAI
import os

client = OpenAI(
  api_key=os.environ["OMNIVA_API_KEY"],
  base_url="https://api.tokenfactory.omniva.com/v1",
)

resp = client.chat.completions.create(
  model="<chat-model-id>",
  messages=[{"role": "user", "content": "Hello."}],
)
print(resp.choices[0].message.content)

Mint a Token Factory key from API keys and export it as OMNIVA_API_KEY. Full minting and rotation guidance lives in Authentication.

#Model IDs

OpenAI uses opaque short names — gpt-4, text-embedding-3-small. Token Factory ids are explicit and prefixed, in the form provider/model-name, and the prefix carries meaning. An Omniva/… id (for example Omniva/glm-5.2) is an Omniva-optimized build of an open model — tuned and quantized for low-latency serving. The same base model may also be offered as raw upstream open weights under its author prefix (for example zai-org/GLM-5.2). Pass the exact catalog id as model.

Pick a model ID from your workspace catalog in Models overview, or list them programmatically with GET /v1/models. The ID you choose goes straight into the model field.

#Parameters dropped today

The chat-completions handler currently reads model, messages, temperature, max_tokens, and stream. The following OpenAI request fields are accepted in the body but ignored — they will not change the response:

  • top_p, n, seed
  • presence_penalty, frequency_penalty
  • stop
  • tools, tool_choice, response_format
  • user, logprobs, service_tier

If your existing code sets any of these, the call will succeed but those knobs won't take effect. Full list with status is on the Chat completions reference.

#Errors

OpenAI returns a nested envelope ({ "error": { "message", "type", "param", "code" } }). Token Factory returns the same nested shape on the public API surface, but inspect the status and code fields with care — the catalog of codes is Token Factory's, not OpenAI's. The full error catalog and retry guidance is in Errors.

If you're on a corporate network and your first call hits CERTIFICATE_VERIFY_FAILED, see Errors → SSL for the proxy / CA-bundle remediation.

#What about embeddings and tools?

#What next

Was this page helpful?