Feature · playground

AI API playground in the browser

Open a model, send a prompt, watch it stream and compare the answer with another model. When the prompt is right, copy a cURL or Python request that reproduces it outside the browser.

Short answer. The playground opens without a key for plugsky-micro and plugsky-lite. Switch models, compare two to four answers, adjust temperature and max tokens, and stream the response. Paid models need a key. Export the request as cURL or Python when you are ready to leave the browser.

No-signup demo and model switch

The first job of a playground is to remove the setup cost. You should be able to see whether a model follows instructions before you create a key, wire billing or write a client. The free tier exists for that: Micro and Lite, no card, published limits.

CapabilityWithout a keyWith a key
Chat with Micro or LiteYesYes
Switch to paid modelsNoYes
Stream tokensYesYes
Compare 2–4 modelsFree models onlyAny models on the plan
Temperature and max tokensYesYes
Export cURL / PythonYesYes

Model choice should follow the job, not the leaderboard. Use plugsky-micro for classification and short rewrites, plugsky-lite for fast chat, plugsky-pro for reasoning and code, and plugsky-parse for documents. The quickstart lists the current model ladder.

Streaming

Streaming changes the perceived latency and the failure mode. The first token can arrive long before the last, and a stream can fail after partial output. The API uses server-sent events with data: frames and a terminal [DONE] marker, the same shape as the OpenAI chat completions stream.

curl -N https://api.plugsky.com/v1/chat/completions \
  -H "Authorization: Bearer $PLUGSKY_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "plugsky-pro",
    "stream": true,
    "messages": [{"role": "user", "content": "Count to five, one word per line."}]
  }'
from openai import OpenAI

client = OpenAI(api_key="YOUR_PLUGSKY_KEY", base_url="https://api.plugsky.com/v1")
stream = client.chat.completions.create(
    model="plugsky-pro",
    messages=[{"role": "user", "content": "Count to five, one word per line."}],
    stream=True,
)
for chunk in stream:
    print(chunk.choices[0].delta.content or "", end="", flush=True)

Buffer the partial text for display, but do not write it to a system of record until the stream finishes and the finish reason arrives. If the client disconnects, cancel the request; a runaway stream still consumes capacity.

Tool calls

A tool call is a structured detour, not a different endpoint. Send a tools array with JSON-Schema definitions, let the model return tool_calls, execute the function in your code, then send the result back as a tool message. The playground is useful for checking whether the model picks the right tool; the companion function-calling tester is built for the round trip.

tools = [{
  "type": "function",
  "function": {
    "name": "get_order_status",
    "description": "Look up an order by ID",
    "parameters": {
      "type": "object",
      "properties": {"order_id": {"type": "string"}},
      "required": ["order_id"]
    }
  }
}]

resp = client.chat.completions.create(
    model="plugsky-pro",
    messages=[{"role": "user", "content": "Where is order A-1042?"}],
    tools=tools,
    tool_choice="auto",
)
print(resp.choices[0].message.tool_calls)

Validate the arguments against the same schema before executing anything. A model can return a syntactically valid call with a missing or invented ID. Treat the tool call as untrusted input, check authorization, and log the arguments with the request ID.

JSON-schema validation

Structured output is the difference between a demo and a pipeline. Ask for a schema, then validate the response locally. The OpenAI-compatible API tester is useful for checking the shape before you wire it into an app.

import json, jsonschema

schema = {
  "type": "object",
  "required": ["sentiment", "confidence"],
  "properties": {
    "sentiment": {"enum": ["positive", "neutral", "negative"]},
    "confidence": {"type": "number", "minimum": 0, "maximum": 1}
  }
}

resp = client.chat.completions.create(
    model="plugsky-lite",
    response_format={"type": "json_schema", "json_schema": {
        "name": "sentiment", "strict": True, "schema": schema
    }},
    messages=[{"role": "user", "content": "Classify: the delivery was late but support fixed it."}],
)

data = json.loads(resp.choices[0].message.content)
jsonschema.validate(data, schema)

If validation fails, retry once with the error text, then route to review. Do not “repair” a JSON object with string replacement; that hides the failure and produces records that look valid.

Shareable request and exports

A reproducible request is a small artifact: base URL, model, messages, temperature, max tokens and any tools or schema. Share that JSON, not your key. Anyone with the same workspace can paste it into the playground or run it with cURL.

curl https://api.plugsky.com/v1/chat/completions \
  -H "Authorization: Bearer $PLUGSKY_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "plugsky-pro",
    "temperature": 0.2,
    "messages": [
      {"role": "system", "content": "Answer in one paragraph."},
      {"role": "user", "content": "Explain Little\u2019s Law for API capacity."}
    ]
  }'
from openai import OpenAI

client = OpenAI(api_key="YOUR_PLUGSKY_KEY", base_url="https://api.plugsky.com/v1")
resp = client.chat.completions.create(
    model="plugsky-pro",
    temperature=0.2,
    messages=[
        {"role": "system", "content": "Answer in one paragraph."},
        {"role": "user", "content": "Explain Little's Law for API capacity."},
    ],
)
print(resp.choices[0].message.content)

Keep the exported request next to the prompt in version control. When a model changes, the diff is the request, not a screenshot of a chat window. Redact the key before pasting into a ticket or a shared document.

Cost estimate

Plugsky is flat-rate, so the playground's cost estimate should answer “how much of my plan did this consume?”, not “what is the per-token price?” Read usage.prompt_tokens and usage.completion_tokens, add them, and divide by the plan's daily token cap.

Request size1,000 requestsShare of Hobby's 2M daily capEffective cost at full daily use
500 tokens500K tokens25%~$0.07
2,000 tokens2M tokens100%~$0.27
8,000 tokens8M tokens4 days of cap~$1.07

The formula is (plan price ÷ 30) × (tokens per 1,000 requests ÷ daily token cap). It measures capacity, not a per-token invoice. See pricing for the current caps; Builder and Scale have no monthly token cap but still enforce concurrency and RPM.

FAQ

Do I need an API key to use the playground?

The playground opens without a key for the free models, plugsky-micro and plugsky-lite. Paid models, higher limits and live API calls need a workspace key.

Can I compare models side by side?

Yes. The compare view runs the same prompt against two to four models in parallel so you can compare content, latency and token usage.

Does the playground support tool calls?

Tool-call testing is available through the companion function-calling tester and through the API. Define the tools array, send the request, then execute the returned tool_calls and send the result back.

How do I share a request?

Share the request body, model and parameters, never the API key. The JSON body plus the base URL is enough for another developer to reproduce the call in cURL or Python.

How is the cost estimate calculated?

Plugsky bills a flat plan, not per token. The estimate uses usage.prompt_tokens and usage.completion_tokens to show how much of your daily token cap the request consumes, then converts that share into an effective cost.

Sources

JSON Schema documentation for object, enum and required constraints, checked 20 November 2026: json-schema.org/understanding-json-schema. OpenAI function-calling guide for the tools and tool_calls shape, checked 20 November 2026: developers.openai.com/api/docs/guides/function-calling. MDN server-sent events guide for stream handling, checked 20 November 2026: developer.mozilla.org/Server-sent_events.

Reviewed 20 November 2026. Playground access and plan limits were checked against the Plugsky documentation on that date. Cost figures are capacity estimates from published caps, not invoices. Never paste a live API key into a shared request.