Docs

Chat completions — full API reference

Reference for the /v1/chat/completions endpoint on Plugsky. Same request and response shape as OpenAI, plus all the Plugsky-specific extras: streaming, function calling, JSON mode, vision, plugsky-fusion model routing.

Endpoint

POST https://api.plugsky.com/v1/chat/completions

Request body

json
{
  "model": "plugsky-pro",
  "messages": [
    {"role": "system", "content": "You are a helpful assistant."},
    {"role": "user", "content": "Hello!"}
  ],
  "temperature": 0.7,
  "max_tokens": 256,
  "stream": false
}

Parameters

Param Type Notes
modelstringRequired. One of 18+ Plugsky models, or plugsky-fusion for routing.
messagesarrayRequired. Array of {role, content}. Roles: system, user, assistant, tool.
temperaturenumber0.0 to 2.0. Default 1.0.
top_pnumber0.0 to 1.0. Default 1.0.
nintegerNumber of completions to generate. Default 1.
streambooleanIf true, stream via SSE. Default false.
stopstring | arraySequences where the API will stop generating.
max_tokensintegerMaximum tokens to generate.
presence_penaltynumber-2.0 to 2.0. Default 0.
frequency_penaltynumber-2.0 to 2.0. Default 0.
toolsarrayFunction calling tools (OpenAI format).
tool_choicestring | object"none", "auto", or {"type":"function","function":{"name":"..."}}
response_formatobject{"type":"json_object"} for JSON mode.
userstringPer-end-user identifier for abuse detection.
seedintegerFor deterministic sampling (best-effort).

Response

json
{
  "id": "chatcmpl-abc123",
  "object": "chat.completion",
  "created": 1782123456,
  "model": "plugsky-pro",
  "choices": [
    {
      "index": 0,
      "message": {
        "role": "assistant",
        "content": "Hello! How can I help you today?"
      },
      "finish_reason": "stop"
    }
  ],
  "usage": {
    "prompt_tokens": 24,
    "completion_tokens": 11,
    "total_tokens": 35
  }
}

Frequently asked questions

Is the response shape exactly the same as OpenAI?

Yes. Drop-in replacement. Same id, object, created, model, choices, message, finish_reason, usage.

Which Plugsky models support function calling?

All chat models: plugsky-micro, plugsky-lite, plugsky-plus, plugsky-pro, plugsky-max, plugsky-frontier, plugsky-reasoning.

Does streaming work the same way?

Yes. Pass stream: true and you get the same SSE event format as OpenAI. Each event has the same delta structure.

What about vision inputs?

Use model: "plugsky-vision" and pass content as an array of {type: "text"|"image_url", ...} objects. Same as OpenAI's vision format.

Try the API in your browser

7-day trial for $5. Test chat, streaming, and function calling without signing up for anything else.

Start $5 trial → See full reference