Back to prouter.io

User Documentation

Prouter User Guide

Prouter is a local-first AI gateway for chat, API routing, media generation, agents, and app building. This guide explains how to get started, choose the right routing mode, control spend, and use the platform efficiently.

Best DefaultUse Auto routing first
Spend ControlLocal-first, wallet-gated cloud
Developer APIhttps://prouter.io/v1

Start Here

  1. Sign in to Prouter with your account.
  2. Use the Chat workspace first if you are testing prompts, writing, summarizing, researching, or debugging.
  3. Create an API key only when you want to connect another app, script, or build platform.
  4. Start with prouter-auto or Auto mode. Let Prouter choose local, low-cost, mid-cost, or high-end routing.
  5. Add wallet credits only when you need paid cloud escalation, API cloud usage, image, video, or voice generation.
  6. Check History and generated assets after important runs so you can reuse good outputs instead of regenerating them.

How To Optimize Usage

Use Auto For Normal Work

Auto is the safest default. It keeps routine tasks on local-first routes where possible and escalates only when the task needs more capability or local capacity is unavailable.

Be Specific In Prompts

Include the goal, audience, format, constraints, and examples. Better prompts reduce follow-up turns, retries, and unnecessary high-end routing.

Use Low Cost For Bulk Tasks

Choose Low Cost for classification, extraction, summaries, rewrites, tagging, simple support drafts, and batch jobs where speed and cost matter more than deep reasoning.

Save High End For Hard Work

Use High End for complex analysis, architecture decisions, risk-sensitive reasoning, legal-style review, difficult coding, or tasks where a wrong answer is expensive.

Reuse Artifacts

Import generated assets into IDE projects or reuse previous outputs from History. Reusing strong outputs is usually cheaper and faster than regenerating from scratch.

Set Budgets On Agents

Give agents a per-run budget limit. This lets agents work autonomously while still blocking runaway cloud spend or paid tool use.

Routing Profiles

ProfileUse ForOptimization TipAutoprouter-autoDefault choice for most chat, API, agent, and app-building work.Low Costprouter-low-costBulk simple tasks, summaries, extraction, drafts, and predictable workflows.Mid Costprouter-mid-costBalanced reasoning when low-cost output is not strong enough.High Endprouter-high-endComplex reasoning, high-stakes analysis, coding, and maximum-depth responses.

Workspace Guide

The signed-in workspace is the easiest way to use Prouter without writing code. Use the product tiles to switch between Chat, IDE, Image, Video, Voice, History, and Agents when those capabilities are enabled for your account.

API Quickstart

Prouter exposes an OpenAI-compatible API surface. Create an API key in the workspace, store it asPROUTER_API_KEY, and call the API with a bearer token. Never put API keys in browser code, screenshots, public repos, or client-side environment variables.

Base URLhttps://prouter.io/v1
AuthAuthorization: Bearer key
Modelsprouter-auto, low-cost, mid-cost, high-end

Chat Completion

curl https://prouter.io/v1/chat/completions \
  -H "Authorization: Bearer prouter_live_xxxxxxxxxxxx" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "prouter-auto",
    "messages": [
      { "role": "user", "content": "Summarize this customer feedback and identify action items." }
    ],
    "stream": false,
    "task_mode": "general"
  }'

Streaming Chat

curl https://prouter.io/v1/chat/completions \
  -H "Authorization: Bearer prouter_live_xxxxxxxxxxxx" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "prouter-auto",
    "messages": [
      { "role": "user", "content": "Draft a concise launch plan for this feature." }
    ],
    "stream": true
  }'

API Endpoints

MethodPathPurposeGET/v1/modelsList Prouter-compatible model aliases.POST/v1/chat/completionsRun an OpenAI-compatible chat completion with routing.POST/v1/images/generationsCreate an image generation job when paid media is enabled.POST/v1/audio/transcriptionsTranscribe audio through the configured transcription provider.

Image, Video, Voice, And Music

Media generation uses wallet credits. Use detailed prompts, specify the desired output style, and generate a small number of strong candidates before asking for variants. For image edits or variants, use references that clearly show the subject, layout, and style you want preserved.

curl https://prouter.io/v1/images/generations \
  -H "Authorization: Bearer prouter_live_xxxxxxxxxxxx" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "auto-smart-tier",
    "prompt": "A clean product mockup for an AI routing dashboard, dark UI, readable labels.",
    "size": "1:1",
    "quality": "mid"
  }'
curl https://prouter.io/v1/music/generations \
  -H "Authorization: Bearer prouter_live_xxxxxxxxxxxx" \
  -H "Content-Type: application/json" \
  -d '{
    "title": "Reference-Trait Pop",
    "prompt": "[Verse] Neon streets are waking up\n[Chorus] Hold the line, keep running",
    "style": "modern synth-pop, 104 BPM, hopeful mood, warm female vocal, glossy drums, wide chorus lift",
    "instrumental": false,
    "custom_mode": true,
    "duration_seconds": 150,
    "negative_tags": "copying lyrics, soundalike vocals, muddy bass"
  }'

Agents

Agents are reusable workers with instructions, routing policy, optional memory, optional tools, trace records, and budget controls. Use agents when you want a repeatable workflow rather than a one-off chat.

Endpoints

MethodPathPurposeGET/v1/agentsList agents in your organization.POST/v1/agentsCreate a governed agent.GET/v1/agents/{agent_id}Read one agent.POST/v1/agents/{agent_id}/runsRun an agent with optional file and artifact context.GET/v1/agents/{agent_id}/runsList recent runs with optional status and limit filters.GET/v1/agents/runs/{run_id}Read one run and its full trace steps.POST/v1/agents/runs/{run_id}/webhook/retryRetry completion webhook delivery for a completed run.GET/v1/agents/connectorsList connector credential metadata.POST/v1/agents/connectorsCreate connector metadata when operator-enabled.GET/v1/agents/connectors/{connector_id}Read one connector metadata record.PATCH/v1/agents/connectors/{connector_id}Update connector metadata when operator-enabled.GET/v1/agents/connectors/approvalsList connector action approvals.POST/v1/agents/connectors/approvalsApprove a connector action when operator-enabled.DELETE/v1/agents/connectors/approvals/{approval_id}Delete one connector action approval.DELETE/v1/agents/connectors/{connector_id}Delete connector metadata.GET/v1/agents/{agent_id}/schedulesList schedules with optional status and limit filters.POST/v1/agents/{agent_id}/schedulesCreate a schedule when operator-enabled.GET/v1/agents/schedules/{schedule_id}Read one schedule.PATCH/v1/agents/schedules/{schedule_id}Update, pause, or resume a schedule when operator-enabled.POST/v1/agents/schedules/{schedule_id}/runRun a saved schedule immediately when operator-enabled.POST/v1/agents/schedules/{schedule_id}/skipSkip the next scheduled occurrence when operator-enabled.DELETE/v1/agents/schedules/{schedule_id}Delete a schedule.

Create An Agent

Use a stable instruction block, a routing profile, optional tool policy, optional memory policy, and a per-run budget limit for cloud routes.

curl https://prouter.io/v1/agents \
  -H "Authorization: Bearer prouter_live_xxxxxxxxxxxx" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Support routing agent",
    "instructions": "Answer customer questions concisely. Use supplied context before general knowledge.",
    "routing_profile": "auto",
    "tool_policy": {
      "web_fetch": true,
      "webhooks": {
        "enabled": true,
        "url": "https://example.com/agent-webhook",
        "secret": "replace-with-shared-secret"
      },
      "max_tool_steps": 2
    },
    "memory_policy": { "agent_memory": true },
    "budget_limit_usd": 0.25,
    "status": "active"
  }'

Run An Agent

Use an idempotency key for every production run. Reusing the same key returns the original run instead of charging or executing again.

curl https://prouter.io/v1/agents/AGENT_ID/runs \
  -H "Authorization: Bearer prouter_live_xxxxxxxxxxxx" \
  -H "Content-Type: application/json" \
  -d '{
    "input": "Review https://example.com and draft a short answer.",
    "idempotency_key": "customer-run-001",
    "attachment_ids": [],
    "artifact_ids": []
  }'

JavaScript

const response = await fetch("https://prouter.io/v1/agents/AGENT_ID/runs", {
  method: "POST",
  headers: {
    "Authorization": `Bearer ${process.env.PROUTER_API_KEY}`,
    "Content-Type": "application/json"
  },
  body: JSON.stringify({
    input: "Summarize the selected brief and remember the outcome.",
    idempotency_key: crypto.randomUUID(),
    attachment_ids: ["ATTACHMENT_ID"],
    artifact_ids: ["ARTIFACT_ID"]
  })
});

const run = await response.json();
console.log(run.result);
console.log(run.prouter.steps);

Python

import os
import uuid
import requests

response = requests.post(
    "https://prouter.io/v1/agents/AGENT_ID/runs",
    headers={
        "Authorization": f"Bearer {os.environ['PROUTER_API_KEY']}",
        "Content-Type": "application/json",
    },
    json={
        "input": "Use the attached context and answer in three bullets.",
        "idempotency_key": str(uuid.uuid4()),
        "attachment_ids": [],
        "artifact_ids": [],
    },
    timeout=120,
)
response.raise_for_status()
print(response.json()["result"])

Response Shape

Every run returns the final answer and the Prouter trace. The trace shows routing, context loading, tool calls, observations, provider/model choice, tokens, latency, and credits charged.

{
  "id": "RUN_ID",
  "object": "agent.run",
  "created": 1786000000,
  "agent_id": "AGENT_ID",
  "result": "Final agent answer",
  "status": "completed",
  "prouter": {
    "steps": [
      { "step_type": "planning" },
      { "step_type": "routing_preview" },
      { "step_type": "file_context" },
      { "step_type": "artifact_context" },
      { "step_type": "memory" },
      { "step_type": "tool_call" },
      { "step_type": "tool_limit" },
      { "step_type": "observation" },
      { "step_type": "model_call" },
      { "step_type": "connector_plan" },
      { "step_type": "connector_execution" },
      { "step_type": "webhook" },
      { "step_type": "schedule_trigger" }
    ],
    "credits_charged": 0
  }
}

Policies And Controls

Billing Behavior

Local routes charge zero external credits. Cloud routes reserve wallet budget before execution, then capture or release the reservation based on the final run state. Agent media generation is a paid tool and charges the same wallet credits as the media workspace when a job is submitted.

IDE / App Builder

The IDE workspace is for building small apps from prompts, starter files, imported source zips, and generated assets. Use the Build flow from left to right: create or import a project, create starter files, draft a change, run build/install checks, then start or export the app.

Billing, Credits, And Spend Control

Signup is free. Routine local-first workspace chat does not consume external cloud credits. Wallet credits are used for paid cloud text routes, API cloud escalation, image generation, video generation, voice generation, and paid agent tools.

Security Basics

Troubleshooting

IssueLikely CauseWhat To Try401 or unauthorizedMissing or invalid API keyCheck the bearer token, create a fresh key, and confirm it was not revoked.Cloud route blockedWallet, cap, or approval gateUse Auto/Low Cost, shorten the prompt, or add credits if cloud capability is required.Slow responseLarge context or busy routeReduce context, use streaming, or split the task into smaller steps.Weak outputPrompt too broadAdd examples, constraints, target audience, output format, and success criteria.Media unavailablePaid media gate or provider issueCheck wallet credit, retry later, or use a simpler prompt/reference.IDE build failsMissing dependency or code errorRun Install, inspect the build output, refresh agent context, then draft a targeted fix.

Best Practice Checklist