Feature × Audience

How does function calling work for government teams on Plugsky?

For government, function calling must be accountable: read-only first, named approval for actions, and an audit trail that supports review and appeals. 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
OversightHuman review for state-changing actions; audit every tool call
DeploymentTools can run in-region, on-prem or air-gapped on your side

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.
  • Read-only tools first; state changes stay behind named human approval.
  • Every call is attributable: model, arguments, result and approver.
  • 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. Pilot read-only tools on citizen-facing enquiries with full tracing.
  5. Require named staff approval before any state-changing action.
  6. Run tools inside the approved deployment boundary with RBAC.
1Write strict JSONschemas for eachtool with typed2Implement the loopand validate everyargument before3Log model, toolname, arguments andresult for each4Pilot read-onlytools oncitizen-facing5Require named staffapproval before anystate-changing6Run tools insidethe approveddeployment boundary

Try it yourself

Open the function calling tester →

Function calling for government teams: what changes

Government function calling connects models to case systems, registries and service workflows, so oversight matters as much as capability. Every tool call should be attributable, reviewable and bounded by the authority the user actually holds.

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

Restrict tools to approved systems and data, enforce human review for state-changing actions, and log model, arguments, result and approver for each call. Run tools in-region or air-gapped where classification requires it.

Integration pattern and rollout

Pilot with read-only tools that answer citizen enquiries or locate case status, prove the audit trail end to end, then add tools that prepare actions for staff approval. Keep the executor under your own identity and network boundary.

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

Function calling does not confer legal authority, and automation bias is a real risk: staff must retain meaningful review. Certification posture is readiness in progress, so document the controls you can evidence.

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
OversightHuman review for actions; complete audit trailLimited approval featuresYou design accountability

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.

Can function calling run air-gapped?

Yes. Tools execute in your environment, so an air-gapped deployment keeps both inference and execution inside the boundary.

How do we keep human oversight?

Restrict tools to read-only or proposal actions, and require named staff approval before any state change.

What is logged for each call?

Model, tool name, arguments, result and approver. That trail supports review, appeals and audit.