Agents

Coming soon

An agent uses a model, instructions, and tools to decide what to do next. Use the Agents SDK to define an agent in Python, give it access to your systems, and run it locally or from a worker.

For a single model request without an agent loop, use Chat completions. For a process with explicit steps, retries, and branching, see Workflows.

Get started with the Agents SDK

Get started with the Agents SDK

  1. Install the SDK and configure your API key.
  2. Follow the quickstart to define and run an agent with a Python tool.
  3. Choose a run mode when you are ready to use a worker.

The SDK has three main concepts: an Agent defines the model and instructions, a Harness defines capabilities, and a Session manages turns and events.

Add capabilities

Add capabilities

The SDK exposes capabilities through the harness rather than the built-in tool configuration used by the Agents API:

TaskSDK guide
Call your own Python functionsTools
Connect to external systems over HTTP or MCPConnectors & MCP
Run commands and work with filesSandbox
Reuse instructions and resourcesSkills
Require approval before tool callsPermission
Check structured-output support and limitationsStructured output
Customize the agent loopCustom hooks

These are SDK capabilities, not a promise of one-to-one compatibility with the older API's tools or handoffs. Use each SDK guide to check its configuration and limitations.

Run in production

Run in production

Start in-process while developing. For durable execution, the SDK supports self-hosted workers and Mistral-managed workers. The run modes guide explains registration, deployment, sessions, tracing, and replay-safe code.

Existing Agents API users

Existing Agents API users

The SDK and Agents API are different interfaces. The runtime SDK uses Python; the Agents API guides include Python, TypeScript, and cURL examples. Existing API documentation remains available in the Deprecated navigation group:

The SDK migration guide covers upgrading the SDK from 1.0.7 to 1.1.0. It is not a migration guide from the Agents API. Do not assume that API agents, tools, handoffs, or conversation state transfer automatically to SDK agents.

Going further

Going further