Introduction

Create agents, give them tasks, and stream their results through a REST API. Set user_id to scope memory, tools, and history to one end user.

An agent holds instructions and tools. A task defines the work. A run executes it and returns output and usage.

Base URL: https://api.m8tes.ai/api/v2

The SDK targets this URL by default; override it with the M8TES_BASE_URL env var or M8tes(base_url=...). A custom base URL must include the /api/v2 prefix (e.g. http://localhost:8000/api/v2 for self-hosted); without it every call 404s.

Authentication

All requests require an API key in the Authorization header. API keys use the m8_ prefix. Get yours from the Developer dashboard.

from m8tes import M8tes

client = M8tes(api_key="m8_your_key_here")
# or set M8TES_API_KEY env var and call M8tes() with no args

Create or rotate a key with POST /api/v2/token. Rotation invalidates the previous key, so update your stored secret immediately. Named keys, rotation, env-var conventions, and sessions vs. keys: Authentication. Key hygiene rules: Going Live.

Resources

ResourceDescription
AgentsInstructions, tools, and triggers
RunsTask executions that stream Server-Sent Events
Audit LogsAccount-scoped API request history and debugging
TasksReusable job definitions with triggers (schedule, webhook, email)
AppsAvailable tools and OAuth integrations
MemoriesEnd-user memory management
PermissionsTool allow-lists for end-users
UsersEnd-user profiles for multi-tenant apps
SettingsAccount-level feature configuration
UsageBilling usage, run counts, and account limits
WebhooksEvent notification subscriptions

Usage

Inspect your plan, usage, and limits with GET /api/v2/usage or client.billing.usage() (client.auth.get_usage() still works). Plans, the prepaid balance, top-ups, and usage breakdowns: Billing & Usage.

Conventions

Resource lists use cursor-based pagination; check each endpoint for its limits. All errors follow a standard format. Request rates and field sizes: Limits. Model catalog and ZDR coverage: Models.

Next: Billing & Usage · Errors · Pagination

Was this page helpful?