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 18+ 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
| Endpoint | OpenAI equivalent | Status |
|---|---|---|
POST /v1/chat/completions | ✅ Same | Full support incl. streaming, tools, vision |
POST /v1/completions | ✅ Same | Legacy completions endpoint |
POST /v1/embeddings | ✅ Same | OpenAI ada-style + custom plugsky embed models |
GET /v1/models | ✅ Same | Lists all 18+ Plugsky models |
POST /v1/audio/* | ⏳ Roadmap | TTS / STT planned Q3 |
POST /v1/images/* | ⏳ Roadmap | DALL·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
# 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_penaltymax_tokens,stop,seedresponse_format={"type":"json_object"}for JSON modetools,tool_choicefor function callingstream=truefor SSE streaminguserfor per-end-user trackinglogprobsandtop_logprobson 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.
Request limits & error shapes
Every response from the API — success or failure — is JSON with the OpenAI error schema: {"error":{"message","type","code","param"}}. You will never receive an HTML page from an API endpoint; HTML pages only exist on the marketing/docs site.
| Scenario | HTTP | code | Notes |
|---|---|---|---|
| Missing / bad API key | 401 | invalid_api_key | type: authentication_error |
| Model not on your plan | 400 | 400 | type: invalid_request_error |
| Unknown model | 400 | 400 | Lists known models in the message |
| Context window exceeded | 400 | 400 | Message includes the upstream's token counts — trim history or reduce max_tokens |
| Request body > 16 MB | 413 | request_too_large | Split the request or trim the conversation |
| Rate limited | 429 | 429 | Includes Retry-After header |
| Unknown endpoint | 404 | not_found | JSON, never HTML |
| Upstream provider failure | 502 | upstream_failure | Auto-retried + cascaded to a backup model first |
Request size: the maximum request body is 16 MB (this covers a full 128K-token context plus tool definitions and file excerpts). Requests above 16 MB return 413 request_too_large.
Context windows: all chat models advertise a 128K context window; the upstream service enforces a 1,000,000-token ceiling per request. If your agent compacts long conversations, keep the total request under these limits — 400 errors include the exact token counts so you can size your compaction strategy.
Streaming: errors during streaming are returned as JSON before the SSE stream starts (non-200 status). Once streaming begins you receive OpenAI-format SSE chunks ending in data: [DONE].
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 18+ models.
Start Free → Try the tester