@felores/kie-ai-openai-server
v0.1.1
Published
OpenAI-compatible HTTP transport for selected Kie.ai image and video models.
Maintainers
Readme
@felores/kie-ai-openai-server
OpenAI-compatible HTTP transport for selected Kie.ai image and video models.
Embedded router
The embedded router owns provider request validation and response normalization. Its host application must authenticate callers before mounting it.
import { createKieOpenAiRouter } from "@felores/kie-ai-openai-server";
app.use(
"/kie",
existingAuthentication,
createKieOpenAiRouter({
apiKey: process.env.KIE_AI_API_KEY,
dataDir: process.env.KIE_OPENAI_DATA_DIR,
}),
);GET /kie/health returns only readiness, contract version, and package version. The router never reads a local bearer token and never exposes the KIE API key.
Standalone server
KIE_AI_API_KEY=<KIE_API_KEY> \
KIE_OPENAI_TOKEN=<LOCAL_BEARER_TOKEN> \
kie-ai-openai-serverThe standalone server binds to 127.0.0.1:51311 by default and refuses non-loopback hosts. Configure it with:
KIE_OPENAI_HOST:127.0.0.1,localhost, or::1KIE_OPENAI_PORT: listening portKIE_OPENAI_TOKEN: required local bearer tokenKIE_OPENAI_ALLOWED_ORIGINS: optional comma-separated additional originsKIE_OPENAI_DATA_DIR: transport-owned task dataKIE_AI_API_KEY: server-side Kie.ai credentialKIE_AI_BASE_URL: optional Kie.ai API base URL
Every non-preflight request requires Authorization: Bearer <LOCAL_BEARER_TOKEN>. Provider credentials, callback URLs, and remote output URLs are rejected in client request bodies.
