Overview

Models, Tools, & Agents

Unlike common LLM aggregators that only unify models, BitRouter aggregates models, tools, and agents, allowing services to be composed and integrated in a highly flexible, agent-native manner.

Service Primitives

All services registered on BitRouter fall into one of three primitives: models, tools, and agents, differentiated by their API standards.

A single service can implement multiple primitives simultaneously.

Models

Model services provide LLM inference capabilities through OpenAI/Anthropic/Google-compatible endpoints (with openai-chat/completion as default)

// Request
POST /v1/chat/completions
{
  "model": "deepseek/deepseek-v3.2",
  "messages": [
    { "role": "user", "content": "Hello" }
  ]
}

// Response
{
  "id": "chatcmpl-123",
  "choices": [{
    "message": { "role": "assistant", "content": "Hi there!" }
  }]
}

Multimodal Support

Models can support multiple input and output modalities beyond text:

  • Vision: Send images to vision-capable models for analysis, description, and OCR
  • Image Generation: Generate images from text prompts using compatible models

Multimodal inputs use the same /v1/chat/completions endpoint. Images can be provided as direct URLs (https://example.com/image.jpg) or base64-encoded data (data:image/jpeg;base64,{data}).

Visit the Marketplace to find models that support your desired modalities.

Tools (MCP)

Tool services expose functionality following the MCP (Model Context Protocol) standard via JSON-RPC 2.0. BitRouter acts as an MCP proxy, connecting your agents to MCP tool servers through a single gateway.

// Discover available tools
{ "jsonrpc": "2.0", "id": 1, "method": "tools/list" }

// Invoke a tool
{ "jsonrpc": "2.0", "id": 2, "method": "tools/call",
  "params": { "name": "web_search", "arguments": { "query": "latest AI news" } } }

Configure MCP Servers

mcp_servers:
  - name: "github"
    transport:
      type: stdio
      command: "npx"
      args: ["-y", "@modelcontextprotocol/server-github"]
      env:
        GITHUB_TOKEN: "${GITHUB_TOKEN}"

  - name: "remote-tools"
    transport:
      type: http
      url: "http://localhost:3000/mcp"
      headers:
        Authorization: "Bearer ${TOOLS_TOKEN}"
TransportDescription
stdioLaunch a local process and communicate over stdin/stdout
httpConnect to a remote MCP server via HTTP+SSE

Tool Filtering

Restrict which tools are exposed from an MCP server:

mcp_servers:
  - name: "github"
    transport:
      type: stdio
      command: "npx"
      args: ["-y", "@modelcontextprotocol/server-github"]
    tool_filter:
      allow: ["search_repositories", "get_file_contents"]

Server Groups

Organize MCP servers into named groups for access control:

mcp_groups:
  dev_tools: ["github", "jira"]
  comms: ["slack", "email"]

Supported MCP Methods

MethodDescription
initializeInitialize the MCP session
pingHealth check
tools/listList available tools
tools/callInvoke a tool
resources/listList resources
resources/readRead a resource
resources/templates/listList resource templates
resources/subscribeSubscribe to resource updates
resources/unsubscribeUnsubscribe from updates
prompts/listList available prompts
prompts/getGet a specific prompt
logging/setLevelSet server log level
completion/completeRequest completions

Endpoints: POST /mcp (JSON-RPC) and GET /mcp/sse (Server-sent events stream).

Not yet supported: tasks/*, sampling/createMessage, roots/list, elicitation/create, and Streamable HTTP transport. These are on the roadmap.

Agents (ACP)

Agent services enable autonomous agent-to-agent communication following the ACP (Agent Communication Protocol) by Zed Industries via JSON-RPC 2.0 over HTTP.

Configure Upstream Agents

acp_agents:
  - name: "research-agent"
    url: "https://research.example.com"
    headers:
      Authorization: "Bearer ${RESEARCH_TOKEN}"

  - name: "search-agent"
    url: "https://search.example.com"
    card_path: "/custom/card.json"  # defaults to /.well-known/agent-card.json

Supported ACP Methods

JSON-RPC (POST /acp):

MethodDescription
message/sendSend a message to an agent
message/streamStream a message response (SSE)
tasks/getGet task status and history
tasks/listList tasks
tasks/cancelCancel a running task
tasks/resubscribeResubscribe to task updates (SSE)
agent/getAuthenticatedExtendedCardGet the authenticated agent card

REST endpoints:

MethodPathDescription
GET/.well-known/agent-card.jsonStandard agent card discovery
POST/message:sendSend a message
POST/message:streamStream a message (SSE)
GET/tasks/{id}Get a specific task
GET/tasksList all tasks
POST/tasks/{id}:cancelCancel a task

Example: Send a Message

curl -X POST http://localhost:8787/acp \
  -H "Content-Type: application/json" \
  -d '{
    "jsonrpc": "2.0",
    "id": 1,
    "method": "message/send",
    "params": {
      "message": {
        "role": "user",
        "parts": [{"kind": "text", "text": "Summarize recent ML papers"}]
      }
    }
  }'

Transport is HTTP (JSON-RPC + REST) with SSE for streaming. gRPC is not currently supported.

Agent Skills

BitRouter supports the Agent Skills open standard for registering prompt-level knowledge that agents can discover and use. Skills are SKILL.md files — structured prompts injected into LLM context — distinct from MCP tools which provide runtime tool connectivity.

SkillsMCP Tools
WhatPrompt-level knowledge (SKILL.md)Runtime tool calls (JSON-RPC)
WhenInjected into LLM context before inferenceCalled by the LLM during inference
DiscoveryGET /v1/tools (unified)GET /v1/tools (unified)

Configure Skills

skills:
  - name: "code-review"
    description: "Reviews code for quality, security issues, and best practices"
    source: "https://github.com/anthropics/skills"
    required_apis:
      - provider: anthropic

  - name: "translate"
    description: "Translates text between languages using LLM-powered translation"

Skills can also be installed via CLI:

npx skills add BitRouterAI/agent-skills

Skills API

MethodPathDescription
POST/v1/skillsRegister a new skill
GET/v1/skillsList all registered skills
GET/v1/skills/:nameGet a specific skill
DELETE/v1/skills/:nameDelete a skill

Unified Tool Discovery

All MCP tools and Skills are discoverable through a single endpoint:

curl http://localhost:8787/v1/tools
[
  {
    "name": "code-review",
    "type": "skill",
    "description": "Reviews code for quality, security issues, and best practices"
  },
  {
    "name": "github:search_repositories",
    "type": "mcp_tool",
    "description": "Search GitHub repositories"
  }
]

Best Practices

A single service can expose different primitives depending on the use case. Choosing the appropriate primitive helps AI agents interact with BitRouter more effectively.

Example: AI Research Agent

Use CaseRecommended PrimitiveProtocol
Backend for a frontend applicationModelChat/Completion
Tool for other agents to invokeToolMCP
Autonomous agent-to-agent interactionAgentACP

How is this guide?

Last updated on

On this page