Key facts
| Install | npm install openai |
| Base URL | https://plugsky.com/v1 |
| Runtimes | Node.js 18+, browser, Bun, Deno, Cloudflare Workers |
| Frameworks | Vercel AI SDK, LangChain.js supported via OpenAI-compatible clients |
| Streaming | stream: true with the OpenAI delta format |
| API shape | OpenAI-compatible chat completions, tools and embeddings |
| Free plan | plugsky-micro and plugsky-lite, no card required |
| Product status | Live |
TL;DR
- The OpenAI Node library works as-is with a baseURL override.
- Vercel AI SDK needs only a baseURL in the provider options.
- Browser and edge code can call the REST endpoint with fetch.
- Streaming, tools and embeddings all use OpenAI shapes.
- Start on the free plan with plugsky-micro and plugsky-lite.
How it works, step by step
- Run npm install openai and keep your existing TypeScript types.
- Create a client with apiKey from an environment variable and baseURL set to Plugsky.
- Call chat.completions.create with a Plugsky model and your messages.
- Add stream: true if you want incremental tokens in your UI.
- Use tools for function calling and response_format for JSON output.
- Store keys server-side and proxy browser calls through your backend.
Try it yourself
Open the OpenAI-compatible API tester →
Install and configure
The fastest integration is the official OpenAI Node library: run npm install openai, then construct a client with your Plugsky key and baseURL: "https://plugsky.com/v1". Everything else stays the same — types, retries and streaming helpers included. Guided installs for Go, Java, .NET and Rust follow the same pattern if your stack is mixed.
Read the key from an environment variable such as PLUGSKY_KEY and never ship it to a browser bundle.
Node.js with the OpenAI library
A minimal call passes a Plugsky model and a messages array and reads resp.choices[0].message.content. For chat UIs, set stream: true and iterate the async stream, appending chunk.choices[0].delta.content as it arrives. Function calling uses the same tools array as OpenAI, so schemas you already maintain keep working.
If you need automatic routing, set the model to plugsky-fusion and the platform picks a model per request based on your workspace strategy.
Vercel AI SDK and other frameworks
The Vercel AI SDK works through its OpenAI provider: pass openai("plugsky-pro", { baseURL, apiKey }) to generateText or streamText. LangChain.js uses ChatOpenAI with the same base URL override. Haystack, Semantic Kernel and AutoGen are supported in the same way on their respective ecosystems; the common thread is the OpenAI-compatible wire format, so no vendor-specific adapter is required.
Browser, edge and production notes
For browsers use fetch to POST to /v1/chat/completions with your bearer token. On edge runtimes the same endpoint works, but be careful with request size and timeouts: long completions should stream, and very large conversation histories should be trimmed before sending.
- Proxy browser traffic through your backend so keys are never exposed.
- Handle 429 responses using the Retry-After header; SDK retries do this automatically.
- Request bodies are capped at 16 MB — split or trim when you approach it.
Honest comparison
| Approach | OpenAI Node library | Vercel AI SDK | Raw fetch |
|---|---|---|---|
| Setup | npm install openai, set baseURL | Provider with baseURL | None — HTTP only |
| TypeScript types | Bundled | Bundled | You define them |
| Streaming | Async iterator helper | streamText helper | Manual SSE parsing |
| Tool calling | OpenAI tools array | Framework helpers | Manual JSON handling |
| Best for | Most Node services | Next.js and React apps | Edge and minimal bundles |
Frequently asked questions
Do I need a Plugsky-specific npm package?
No. The official OpenAI Node library works with a baseURL override, which keeps your dependency tree and upgrade path unchanged.
Does the Vercel AI SDK work with Plugsky?
Yes. Use the OpenAI provider with the Plugsky base URL and pass a Plugsky model name.
Can I call the API directly from a browser?
Technically yes, but it would expose your API key. Proxy requests through your backend and keep keys server-side.
Is streaming supported in JavaScript?
Yes. Set stream: true and consume the SSE deltas, or use the SDK's streaming helper.
Which runtimes are supported?
Node.js 18+, Bun, Deno and edge runtimes such as Cloudflare Workers. Runtime support is documented in the SDK section of the docs.
How do I try it without paying?
The free plan includes plugsky-micro and plugsky-lite with no card required, and every new account starts with a 14-day full-access trial.
Where do I check model names?
The live model catalogue lists current model names and capabilities; use it before hard-coding a default.
Plugsky (2026). “Plugsky JavaScript SDK — Node, Browser, Edge”. Plugsky. Available at: https://plugsky.com/articles/javascript-sdk (last updated 2026-09-25).