Feature × Audience

How does function calling work for developers on Plugsky?

For developers, reliability comes from schema discipline: strict types, argument validation, retry-once, fail-closed, and full traces. On Plugsky, function calling is a loop around /v1/chat/completions: you send a tools array, the model returns tool_calls with JSON arguments, your code executes them inside your boundary, and streaming and JSON mode are supported.

Key facts

Looptools array on /v1/chat/completions; model returns tool_calls with JSON arguments
ExecutionYour code executes tools; the model never holds credentials
StreamingFunction calling works with streaming on live chat models
JSON modePair strict tool schemas with JSON mode for structured output
Model supportTool support varies by model; verify per model in the catalogue
StatusFunction calling is live; assistants and responses endpoints are coming soon
LoopSend tools, execute tool_calls, append results, repeat
TestingValidate schemas and arguments; fail closed on invalid output

TL;DR

  • A tools array on /v1/chat/completions; your code executes every tool call.
  • Streaming and JSON mode work alongside function calling on live chat models.
  • Schema quality decides agent reliability; test with adversarial inputs.
  • Design against chat completions — assistants endpoints are coming soon.
  • Start free with plugsky-micro and plugsky-lite; a 14-day full-access trial covers larger models.

How it works, step by step

  1. Write strict JSON schemas for each tool with typed fields and enums.
  2. Implement the loop and validate every argument before execution.
  3. Log model, tool name, arguments and result for each call.
  4. Write strict schemas and test them before wiring the loop.
  5. Validate arguments, retry once, then fail closed on invalid output.
  6. Log full traces and run regression scenarios on every model change.
1Write strict JSONschemas for eachtool with typed2Implement the loopand validate everyargument before3Log model, toolname, arguments andresult for each4Write strictschemas and testthem before wiring5Validate arguments,retry once, thenfail closed on6Log full traces andrun regressionscenarios on every

Try it yourself

Open the function calling schema generator →

Function calling for developers: what changes

For developers, function calling is a predictable loop: declare tools, receive structured calls, execute, return results, repeat. The interesting work is schema design, validation and failure handling — the parts that decide whether an agent is reliable in production.

The mechanics are OpenAI-compatible: declare tools as JSON schemas in the request, receive tool_calls with structured arguments, execute them in your own service, then append the results and continue the loop. Streaming and JSON mode work alongside tool calls on live chat models, and because 30+ models sit behind one endpoint you can route steps by capability while keeping a single integration.

Architecture and controls

Write schemas with strict types and enums, validate every argument before execution, retry once on invalid output and fail closed. Keep write tools idempotent, and stream responses so users see progress while tools run.

Integration pattern and rollout

Prototype with the function calling tester, generate or check schemas, then wire the loop into your service. Test with adversarial inputs — missing fields, wrong types, repeated calls — and log the full trace for debugging.

Design for failure: models occasionally produce arguments that violate the schema, so validate strictly, retry once with the error appended, then fail closed and surface the case. Give each tool its own identity with least-privilege scope, keep an idempotency key on writes, and maintain a regression suite of tool scenarios that runs whenever a model or schema changes.

Limits, evidence and cost

Tool support varies by model, and smaller models make more schema errors, so verify per model rather than assuming. Function calling is live; assistants and responses endpoints are coming soon, so design against chat completions.

Self-serve plans are flat monthly with unlimited fair-use usage, so tool loops do not add per-token billing — check the live pricing page. The free plan covers plugsky-micro and plugsky-lite with no card, and the 14-day full-access trial lets you test the full loop before committing.

Honest comparison

ConcernPlugsky function callingVendor-locked tool platformsBuilding in-house
InterfaceOpenAI-style tools array on chat completionsProprietary assistants APICustom schema and runtime
ExecutionYour code runs tools inside your boundaryVaries; often vendor-hosted toolsYou build the executor
Model choice30+ models; tool support varies by modelVendor catalogue onlyYou host each model
ResidencyRegion-locked planes; VPC, on-prem and air-gappedLimited region choicesWherever you deploy
StatusLive on chat completionsVaries by vendorMonths of engineering
Loop ergonomicstools array and tool_calls on chat completionsProprietary runtimesYou build the runtime

Frequently asked questions

How does the function calling loop work?

You send a tools array with the request, the model returns tool_calls with JSON arguments, your code executes them, appends results and calls again until the model answers.

Does the model execute tools itself?

No. Execution happens in your code, inside your boundary. The model never receives credentials, and your executor enforces permissions and validation.

Which models support function calling?

Function calling is live on chat models, but tool support varies by model. Verify per model in the catalogue and test your schemas before production.

Where do I start with function calling?

Send a tools array on /v1/chat/completions, execute returned tool_calls, append results and repeat. Test schemas with the function calling tester.

What if the model returns invalid arguments?

Validate against the schema, retry once with the error appended, then fail closed and surface the case for review.

Does streaming work with tools?

Yes. Streaming and function calling are live, so you can show progress while tools execute.