Developer + API

How do you call Plugsky from JavaScript and TypeScript?

Use the official OpenAI Node library or the Vercel AI SDK and point baseURL at https://plugsky.com/v1. You keep the SDK you already use — install openai, set the API key and base URL, then call chat.completions with a Plugsky model. Browser and edge runtimes can use plain fetch against the same endpoint.

Key facts

Installnpm install openai
Base URLhttps://plugsky.com/v1
RuntimesNode.js 18+, browser, Bun, Deno, Cloudflare Workers
FrameworksVercel AI SDK, LangChain.js supported via OpenAI-compatible clients
Streamingstream: true with the OpenAI delta format
API shapeOpenAI-compatible chat completions, tools and embeddings
Free planplugsky-micro and plugsky-lite, no card required
Product statusLive

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

  1. Run npm install openai and keep your existing TypeScript types.
  2. Create a client with apiKey from an environment variable and baseURL set to Plugsky.
  3. Call chat.completions.create with a Plugsky model and your messages.
  4. Add stream: true if you want incremental tokens in your UI.
  5. Use tools for function calling and response_format for JSON output.
  6. Store keys server-side and proxy browser calls through your backend.
1Run npm installopenai and keepyour existing2Create a clientwith apiKey from anenvironment3Callchat.completions.createwith a Plugsky4Add stream: true ifyou wantincremental tokens5Use tools forfunction callingand response_format6Store keysserver-side andproxy browser calls

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

ApproachOpenAI Node libraryVercel AI SDKRaw fetch
Setupnpm install openai, set baseURLProvider with baseURLNone — HTTP only
TypeScript typesBundledBundledYou define them
StreamingAsync iterator helperstreamText helperManual SSE parsing
Tool callingOpenAI tools arrayFramework helpersManual JSON handling
Best forMost Node servicesNext.js and React appsEdge 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.

Cite this page

Plugsky (2026). “Plugsky JavaScript SDK — Node, Browser, Edge”. Plugsky. Available at: https://plugsky.com/articles/javascript-sdk (last updated 2026-09-25).