2027 planning guide · Evidence checked 20 November 2026

Agent gateway: the control layer for production agent runs

An agent gateway is the layer that authenticates a run, enforces a step budget, gates dangerous tools and records what happened. Plugsky documents those controls around POST /v1/agents/{agent_id}/agent/runs. This page separates the documented behaviour from the parts the docs leave open, with exact request code, limits and failure modes.

Short answer. Plugsky does not publish a separate agent gateway product. It documents an agent runs API at POST /v1/agents/{agent_id}/agent/runs, under the same documented key, plan-quota, regional routing and logging controls as chat completions. The documented controls are max_steps (10 by default, 50 self-serve, 200 Enterprise), per-tool requires_approval, per-agent memory namespaces, SSE step streaming and workspace plan limits. Everything else in this guide is labelled as engineering practice, not a platform guarantee.

What “agent gateway” means at Plugsky

The term is used two ways in the market. One is a proxy that sits between an application and several model providers. The other is a control plane for agent execution: identity, quotas, tool permissions, step budgets and traces. Plugsky’s documentation describes the second set of controls, but it does not use the phrase “agent gateway” as a product name.

That distinction matters for procurement. If you need a gateway in front of several models, the documented Plugsky surface is the OpenAI-compatible API plus the routing endpoint covered on the AI gateway page. If you need a governed place to run multi-step agents, the documented surface is the agent runs API plus the workspace controls below. Both sit behind the same workspace and key model, but they serve different jobs.

Term check. The public docs define agent runs, key scopes, plan quotas, audit logs and an MCP surface. They do not define an “agent gateway” endpoint, a gateway-specific price or a gateway SLA. This page uses the phrase for the control layer those documented parts form.

What the gateway controls

Every agent run uses the same platform controls as a chat request. The platform authenticates the key, resolves the workspace plan, checks the request against capacity limits, selects the region, and opens a request log. The run then executes against a named agent.

  • Identity. Bearer keys are project- and role-scoped, revocable without downtime, and can carry narrow scopes such as chat:write rather than admin. Third-party apps can use OAuth 2.1 with Dynamic Client Registration and PKCE instead of a pasted key.
  • Capacity. Plan RPM and concurrency are enforced at the API edge. Hobby and Starter also have daily request and token caps; Builder and Scale have no monthly token cap but still enforce fair-use concurrency and RPM. The docs do not publish a separate agent-run allowance.
  • Step budget. A run cannot plan forever. max_steps caps the number of moves, and the default is 10.
  • Tool permission. A tool can pause the run for a human decision before it executes.
  • Trace. The response includes a steps array, and every API request is logged with model, tokens, latency, status, key ID, project ID, region and request ID.

How an agent run executes

The agents reference documents a short sequence. Create or select an agent ID, define the tools it may call using OpenAI-format function schemas, and POST a goal with a step budget. The service plans, chooses tools, executes them and returns a final output with the trace.

  1. Create an agent in the workspace, or reuse an existing agent_id.
  2. Define tools with the same JSON-Schema shape used by chat completions, so existing schemas port across.
  3. POST input, tools and max_steps to the run endpoint.
  4. Set stream: true if the UI should show each planning and tool step over SSE.
  5. Mark destructive or high-cost tools with requires_approval.
  6. Read the returned steps array and log the run ID for audit and replay.

Memory is namespaced per agent. Conversation history, tool-call logs and structured state stay isolated, and vector memory can be backed by the RAG API when an agent needs to retrieve from documents. That isolation is a documented namespace boundary; confirm the storage and retention model in the DPA for regulated workloads.

Exact configuration

The examples use https://api.plugsky.com/v1. Plugsky’s public docs also show https://plugsky.com/v1; both hosts are documented, so pick one and keep it consistent across environments.

The request below uses only fields the docs name: input, tools, max_steps and stream. The requires_approval flag is documented as a per-tool flag, but the public page does not print a full annotated tool object; confirm its placement in the live reference before depending on it.

curl -X POST https://api.plugsky.com/v1/agents/acme-ops/agent/runs \
  -H "Authorization: Bearer $PLUGSKY_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: run-2026-11-23-0001" \
  -d '{
    "input": "Reconcile Tuesday invoices and flag mismatches",
    "max_steps": 12,
    "stream": false,
    "tools": [
      {
        "type": "function",
        "function": {
          "name": "ledger_lookup",
          "description": "Read one invoice by ID. Read-only.",
          "parameters": {
            "type": "object",
            "properties": {"invoice_id": {"type": "string"}},
            "required": ["invoice_id"]
          }
        }
      },
      {
        "type": "function",
        "function": {
          "name": "post_adjustment",
          "description": "Write a ledger adjustment for one invoice.",
          "parameters": {
            "type": "object",
            "properties": {
              "invoice_id": {"type": "string"},
              "amount": {"type": "number"}
            },
            "required": ["invoice_id", "amount"]
          }
        },
        "requires_approval": true
      }
    ]
  }'

Read the trace before you parse the final answer. The docs say every run returns a steps array that records each thought and tool call, which is the part auditors and on-call engineers actually need.

import json
import os
import requests

resp = requests.post(
    "https://api.plugsky.com/v1/agents/acme-ops/agent/runs",
    headers={
        "Authorization": f"Bearer {os.environ['PLUGSKY_API_KEY']}",
        "Idempotency-Key": "run-2026-11-23-0001",
    },
    json={"input": "Reconcile Tuesday invoices", "max_steps": 12},
    timeout=180,
)
resp.raise_for_status()
run = resp.json()

for step in run["steps"]:
    print(json.dumps(step, indent=2))

Keep the run ID and the trace together. If a tool writes to a system of record, the trace is the only bridge between “the model said it did” and “the ledger changed”.

Limits you must design around

Three documented limits decide the shape of a production agent: the step budget, the plan’s request capacity, and plan eligibility. A fourth, the per-request context ceiling, decides how much history and tool schema you can carry into each step.

The step ceiling is 10 by default, 50 on self-serve plans and 200 on Enterprise. The docs are explicit that a workflow needing more moves should be split into sub-agents rather than given a larger budget. Agent Cloud supports named sub-agents with shared memory, so delegation is the documented scaling path.

Capacity is a plan fact, not an agent-specific allowance. Builder includes 10 concurrent requests and 600 RPM; Scale includes 16 and 1,200. The docs do not publish a separate concurrency limit for agent runs, so plan for a run to occupy the same request budget as any other call. Hobby and Starter also stop at daily request and token caps; Builder and Scale do not have a monthly token cap.

Eligibility is the third gate. The Free plan is documented as excluding agents, and Agent Cloud is listed among the locked surfaces. A paid workspace is required. That is a product boundary, not a rate limit, so retrying will not clear it.

Agent run controls, documented behaviour and where each is set
ControlDocumented behaviourWhere it is set
AuthenticationBearer key, project- and role-scoped, revocable; OAuth 2.1 with DCR for third-party appsDashboard API keys; Authorization header
Plan capacityRPM and concurrency per plan; daily caps on Hobby and Starter; no monthly token cap on Builder and ScaleWorkspace plan
Step budgetDefault 10; maximum 50 self-serve, 200 Enterprisemax_steps per run
Tool approvalThe run pauses before a flagged tool call until a person approves or rejects itrequires_approval per tool
MemoryConversation, tool logs and structured state namespaced per agent; optional vector memory via RAGAgent configuration and RAG
StreamingSSE events for each planning and tool stepstream: true
IdempotencyAll POST endpoints accept the header; the same key returns the cached result for 24 hoursIdempotency-Key header
ObservabilityRequest logs with model, tokens, latency, status, key, project, region and request ID; audit logs for key actionsDashboard and log export

Two numbers are deliberately absent from that table: a per-run price and a per-run concurrency figure. Self-serve plans are flat monthly subscriptions, so a run consumes plan capacity rather than a metered token balance. The docs do not price a run separately, and they do not publish an agent-specific concurrency pool.

Failure modes and what to do

Agent failures are rarely a single error. They are a run that stops making progress, a tool that fails twice, or a quota that binds halfway through a plan. Handle each one explicitly.

  • Step exhaustion. The run hits max_steps before the goal is met. The docs cap runs at max_steps and recommend splitting a workflow into sub-agents when it needs more moves; they do not publish a distinct exhaustion response. Return a partial result with the trace, narrow the tools, or split the task.
  • Tool failure. The failure is recorded in the steps. Return an error payload the model can read, and stop after the same failure repeats. A model that keeps retrying a broken dependency burns the budget without changing the outcome.
  • Approval stall. A run pauses before a flagged tool. The docs do not publish an approval timeout, so a queue with no reviewer is an outage waiting to happen. Build an approve/reject path with an owner and an escalation rule.
  • 429 rate limit. Plan RPM or concurrency is exhausted. The response includes Retry-After; honour it and add jitter. Do not treat a 429 as a model failure.
  • 402 budget block. A project-level dollar cap has been reached. Raising the cap is a finance decision, not a retry.
  • 403 scope error. The key lacks the scope the call needs. Issue a narrower key for the agent rather than promoting a production key to admin.
  • 502 or 503 upstream error. The docs describe upstream failure and failover at the API edge. Retry with backoff and check the status page; do not replay a write tool without an idempotency key.
  • Duplicate side effects. A retried run can replay a tool call that already succeeded. Use Idempotency-Key on the run and an idempotency key inside every write tool.

When not to use the agent gateway

An agent run is the wrong tool for four common jobs. Choosing chat completions or an external orchestrator is cheaper and easier to reason about.

  • Single-shot generation. Summaries, extraction, classification and one-turn chat do not need a planning loop or a step trace. Use /v1/chat/completions.
  • Durable, long-running workflows. A run is an API request with a step budget. If the process must survive a deploy, wait three days for a human, or guarantee exactly-once side effects across services, keep that state in your own workflow engine and call the model as a step.
  • Workflows above 200 steps. The documented ceiling is real. Split the job into sub-agents with narrower scopes instead of designing around a limit that will not move.
  • Federating third-party MCP servers. Plugsky documents its own MCP server, not an inbound proxy that aggregates arbitrary MCP servers. If that is the requirement, run a separate gateway and connect clients directly.

What the docs do not pin down

Four details are worth confirming in a technical evaluation before an agent goes live. The public docs do not state them, so treat any number you hear as vendor-supplied until it is in writing.

  • The exact tool-object schema for requires_approval, including whether the flag sits beside function or inside it.
  • Whether agent runs have a concurrency pool separate from plan concurrency, and how a paused approval consumes a slot.
  • How long a paused run waits before it expires, and what the expiry response looks like.
  • Retention and deletion of run traces, tool payloads and agent memory, especially for regulated data.

Frequently asked questions

Is there a separate agent gateway endpoint?

No separate endpoint is documented. Agent runs use POST /v1/agents/{agent_id}/agent/runs under the same documented key, plan and logging controls as chat completions. Plugsky uses agent gateway here for that documented control layer, not for a second product or a second host.

How many steps can one agent run take?

The default is 10 steps, set per run with max_steps. The documented maximum is 50 on self-serve plans and 200 on Enterprise. When a workflow needs more moves, the docs recommend splitting it into sub-agents rather than raising the budget indefinitely.

Can a human approve a tool call before it runs?

Yes. Set requires_approval to true on a tool and the run pauses before that call until a person approves or rejects it. Put the flag on tools that write, send or spend, and keep read-only tools ungated so the run does not stall on routine lookups.

Do agent runs work on the Free plan?

No. The Free plan is documented as excluding agents, and Agent Cloud is listed among the surfaces locked until upgrade. Agent runs require a paid workspace. The Free plan also does not include Tools and Connectors, which is the function-calling surface agent tools depend on.

How do I retry an agent run without duplicating side effects?

Send an Idempotency-Key header with each POST. The docs state that all POST endpoints accept the header and that re-sending the same key returns the cached result for 24 hours. Make every write tool idempotent as well, because a retried run can replay a tool call that already succeeded.

What happens when a tool fails inside a run?

The failure is recorded in the run steps, and the agent may retry or choose another path within its remaining step budget. The documented API does not decide your final policy: your application does. Return an error payload the model can read, and stop the run when the same tool fails twice for the same reason.

Related pages

Put a budget and a trace around the loop

Start on a paid workspace, set max_steps, gate the write tools and keep the run ID. The pricing page lists the concurrency and RPM each plan allows.

Sources

Platform behaviour is cited from Plugsky’s documentation, checked on 20 November 2026. The external references define the token and telemetry conventions used in the control guidance; they are not Plugsky specifications.

Last checked 20 November 2026. Plan limits, step ceilings and approval behaviour can change; confirm them on /pricing and in the signed order form before relying on them in production. The API host in this page is https://api.plugsky.com/v1; the docs also show https://plugsky.com/v1 as an alias.