OpenAI Wrapper & Translation
The SDK acts as a true drop-in replacement client with an interface identical to OpenAI's. You do not need to learn a new API to use KeyKing.
Native Format Translation
You can send standard OpenAI-formatted messages and tools to non-OpenAI providers. The SDK automatically translates standard OpenAI chat roles (including system and developer) into the specific data structures required by Anthropic, Gemini, or Groq on the fly.
TypeScript
// Even though the model is Anthropic, use standard OpenAI format. const response = await keyking.chat.completions.create({ model: "claude-3-opus", messages: [ { role: "system", content: "You are a helpful assistant." }, { role: "user", content: "Explain quantum computing." } ] });
No Global Monkey-Patching
Unlike older proxy SDKs, KeyKing does not override globalThis.fetch globally, nor does it dangerously patch the official openai NPM package prototype. It executes HTTP requests using the native fetch API directly to the provider endpoints, injecting the decrypted API keys locally.