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.
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 argsCreate 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
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