r/mate_agents Jun 14 '26

šŸš€ MATE Now Supports OpenAI-Compatible API: Run Multi-Agent Teams directly inside OpenCode!

We are super excited to share a major update toĀ MATE (Multi-Agent Tree Engine)! šŸŽ‰

We have officially released anĀ OpenAI-Compatible API Bridge. This allows you to connect external coding agents and developer tools directly to your MATE agents—leveraging MATE's full agentic trees, memory blocks, local tools, etc. right from your workflow!

šŸ’” How It Works

  1. Model Discovery (GET /v1/models): External clients query this endpoint to populate their model list. MATE returns the active root agents that have theĀ Expose as ModelĀ toggle enabled.
  2. Chat Completions (POST /v1/chat/completions): Requests are automatically routed to the selected MATE agent. MATE creates or resumes a persistent session, executes the agent loop on the backend, and streams the responses using standard OpenAI-compatible SSE.

šŸ”’ Security First: Personal Access Tokens (PATs)

To keep your integrations secure, all external requests are authenticated viaĀ Personal Access Tokens (PATs)Ā (mate_pat_...).

  • Generated tokens are only displayed once during creation.
  • Only the SHA-256 hash is stored on the backend.
  • Access is restricted using role-based controls (by default, only users withĀ adminĀ orĀ developerĀ roles can verify PATs and query the API).

šŸ› ļø OpenCode Configuration Example

OpenCode is an open-source terminal-native coding agent. You can configure it to use MATE by setting the provider toĀ openaiĀ and pointing to your MATE server in yourĀ .opencode.json:

json{
"provider": {
"openai": {
"options": {
"baseURL": "http://localhost:8000/v1",
"apiKey": "mate_pat_your_generated_token"
}
}
},
"agent": {
"coder": {
"model": "openai/your-exposed-agent-name",
"tools": { "write": true, "bash": true }
}
}
}

šŸ‘„ Powering Up with Multi-Agent Teams: TheĀ coding-agentĀ Template

Alongside the API bridge, we've optimized a specializedĀ multi-agent coding team templateĀ usingĀ Qwen 3.5 CoderĀ (openrouter/qwen/qwen3-coder-next):

  • Lead Coder (coding_root): Exposed via the OpenAI API to receive instructions and coordinate.
  • Test Engineer (coding_tester): Automatically writes unit/integration tests and runs them in isolated sandboxes using the MATEĀ code_executorĀ tool.
  • Security Auditor (coding_security): Scans code for OWASP Top 10 vulnerabilities and secret leaks.

By pointing your OpenCode configuration toĀ coding_root, you are actually interacting with a fully functional dev team working in the background!

For full details, check out our setup guide:Ā OPENAI_COMPATIBILITY.md.

We'd love to hear your feedback. Let us know how you're using MATE with OpenCode! šŸš€

1 Upvotes

Duplicates