OpenAI-Compatible API

OpenAI-compatible API: one-line migration

Plugsky implements the full OpenAI API surface — /v1/chat/completions, /v1/embeddings, /v1/models, function calling, JSON mode, streaming, vision — so you can swap base_url and ship in minutes, not weeks.

An OpenAI-compatible API is an HTTP service that mimics the request and response shapes of the OpenAI API. You point an OpenAI SDK at its base_url, and your code runs unchanged. Plugsky is one of these — but it also runs all public models behind the same endpoint, not just one vendor's weights.

This page explains exactly what Plugsky's OpenAI-compatible surface covers, how to migrate, and the gotchas to avoid.

What "OpenAI-compatible" actually means

OpenAI's API is a de-facto standard. The /v1/chat/completions endpoint takes a JSON body with a model, messages, and a handful of parameters, and returns a JSON response with a choices array. Hundreds of SDKs and tools — Cursor, Continue, Aider, LangChain, LlamaIndex, Vercel AI SDK, the official OpenAI libraries — speak this shape.

Plugsky replicates the surface 1:1. The endpoint URLs, request bodies, response shape, error codes, and streaming format all match. The only thing that changes is the model names and the price.

Endpoints Plugsky implements

EndpointOpenAI equivalentStatus
POST /v1/chat/completions✅ SameFull support incl. streaming, tools, vision
POST /v1/completions✅ SameLegacy completions endpoint
POST /v1/embeddings✅ SameOpenAI ada-style + custom plugsky embed models
GET /v1/models✅ SameLists all 18+ Plugsky models
POST /v1/audio/*⏳ RoadmapTTS / STT planned Q3
POST /v1/images/*⏳ RoadmapDALL·E-style image gen planned

Supported SDKs and languages

Anything that can talk HTTPS works with Plugsky. Tested daily:

  • Python: openai ≥ 1.0, httpx, requests
  • Node.js / TypeScript: openai, vercel/ai-sdk, langchainjs, llamaindex
  • Browser: fetch, openai-fetch
  • Go: sashabaranov/go-openai
  • Rust: async-openai
  • Ruby: ruby-openai
  • PHP: openai-php/laravel
  • CLI: curl, httpie

One-line migration

python
# Before (OpenAI)
client = OpenAI(api_key="sk-...")

# After (Plugsky — only base_url changes)
client = OpenAI(
    api_key="sk-live-PLUGSKY...",
    base_url="https://api.plugsky.com/v1",
)

resp = client.chat.completions.create(
    model="plugsky-pro",
    messages=[{"role":"user","content":"Hello!"}],
)

The same applies to every other SDK. Set the base URL to https://api.plugsky.com/v1 and you're done.

OpenAI parameters Plugsky honors

  • temperature, top_p, frequency_penalty, presence_penalty
  • max_tokens, stop, seed
  • response_format={"type":"json_object"} for JSON mode
  • tools, tool_choice for function calling
  • stream=true for SSE streaming
  • user for per-end-user tracking
  • logprobs and top_logprobs on supported models

Limitations vs. native OpenAI

You do not get: DALL·E, the Assistants API shape, the Threads / Messages / Runs endpoints, fine-tuning, or OpenAI's built-in moderation endpoint. For those, run OpenAI alongside Plugsky. Most teams use Plugsky for chat / completion / embeddings and keep OpenAI for image gen and TTS.

Frequently asked questions

Does Plugsky support streaming?

Yes. Pass stream: true to /v1/chat/completions and you get the same SSE event format as OpenAI.

Is function calling / tools supported?

Yes. Pass a tools array and the model returns tool calls in the same shape as OpenAI. Use tool_choice to force a specific tool or "auto".

Do I lose anything by switching?

No streaming, function calling, JSON mode, or token counting. You only lose OpenAI-specific features (DALL·E, Assistants, fine-tuning).

Can I use the official OpenAI SDKs unchanged?

Yes. The official openai Python and Node libraries, plus Vercel AI SDK, LangChain, and LlamaIndex, all work with Plugsky via a base_url change.

Switch in one line

Change the base_url to api.plugsky.com/v1 and your existing OpenAI code runs against all public models.

Start Free → Try the tester

Sources and dated checks

Checked 20 November 2026. Primary sources checked 20 November 2026: OpenAI API reference, Anthropic API getting started, Cloudflare Workers AI. Confirm current limits and pricing in the provider console before capacity planning.