Introduction
The m8tes API exposes autonomous agents as REST resources. An agent has persistent instructions and tools. A task is what it should do. A run is a single execution that streams results back to you. To embed agents per end user, set user_id on a run and its memory, tools, and history scope to that 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.
Create or rotate a key with POST /api/v2/token. Rotation invalidates the previous key, so update your stored secret immediately. Key hygiene rules: Going Live.
Resources
The API is organized around these 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
All list endpoints use cursor-based pagination. All errors follow a standard format. Request rates and field sizes: Limits. Model catalog and ZDR coverage: Models.
Next: Billing & Usage · Errors · Pagination
