Skip to main content

ModelPilot Documentation

Complete guide to building reliable autonomous agents with ModelPilot's intelligent routing platform. Create routers that automatically select the best model for each workflow step—optimizing for planning, coding, and execution phases.

Core Capabilities

Agent Routing
Automatic model selection based on workflow phase (planning vs execution), task complexity, and agent type.
Universal Access
Give your agents access to 35 models from OpenAI, Anthropic, Google, and more through a single API.
Self-Healing
Automatic failover and retry logic ensures your autonomous agents don't crash in production loops.

Choose Your SDK

ModelPilot works with both our native SDK and the OpenAI SDK for easy migration.

ModelPilot SDK

Recommended
Purpose-built SDK with full ModelPilot features

Task classification

Prompts are classified by task type and routed to models optimized for that task.

javascript
const ModelPilot = require('modelpilot');

const client = new ModelPilot({
  apiKey: 'mp_xxx',
  routerId: 'router_xxx'
});

const completion = await client.chat.completions.create({
  messages: [{ role: 'user', content: 'Hello!' }]
});
View full guide
OpenAI

OpenAI SDK

baseURL change only
OpenAI-compatible endpoints, request/response formats, headers.

Core features

javascript
const { OpenAI } = require('openai');

const client = new OpenAI({
  apiKey: 'mp_xxx',
  baseURL: 'https://modelpilot.co/api/router/{routerId}'
});

const completion = await client.chat.completions.create({
  messages: [{ role: 'user', content: 'Hello!' }]
});
View migration guide

Popular Topics

Ready to get started?
Create your account and start routing AI requests intelligently.