Endpoint
POST https://api.plugsky.com/v1/chat/completions
Request body
{
"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 |
|---|---|---|
model | string | Required. One of 18+ Plugsky models, or plugsky-fusion for routing. |
messages | array | Required. Array of {role, content}. Roles: system, user, assistant, tool. |
temperature | number | 0.0 to 2.0. Default 1.0. |
top_p | number | 0.0 to 1.0. Default 1.0. |
n | integer | Number of completions to generate. Default 1. |
stream | boolean | If true, stream via SSE. Default false. |
stop | string | array | Sequences where the API will stop generating. |
max_tokens | integer | Maximum tokens to generate. |
presence_penalty | number | -2.0 to 2.0. Default 0. |
frequency_penalty | number | -2.0 to 2.0. Default 0. |
tools | array | Function calling tools (OpenAI format). |
tool_choice | string | object | "none", "auto", or {"type":"function","function":{"name":"..."}} |
response_format | object | {"type":"json_object"} for JSON mode. |
user | string | Per-end-user identifier for abuse detection. |
seed | integer | For deterministic sampling (best-effort). |
Response
{
"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