Back to documentation

API Management

Connect your agents to your website or applications

What is an API?

An API (Application Programming Interface) is like a bridge that allows your website or app to talk to your agent.

🎯 Real-world example:

Imagine you run a restaurant. The waiter is the API: they take customers' orders to the kitchen (your agent) and bring back the responses (the dishes). Customers don’t need to go to the kitchen directly, the waiter handles the connection.

Your website → API → Your agent → API → Answer on your site

API keys
Your secure access key to the agent

An API key is like a special password you give your website so it can use your agent. Without this key, no one can access the agent, keeping it secure.

Create a new API key:

1

Go to the "API" tab

In your agent's configuration, select the fourth tab.

2

Click "Generate key"

A form will open to configure the key.

3

Give it a descriptive name

Example: "Main website" or "Mobile app".

💡 The name helps you identify where each key is being used.
4

Select the lifetime

How long the key will be valid:

  • • Permanent: never expires (more convenient).
  • • 1 year: expires in a year (more secure).
  • • 1 month: for temporary tests.
  • • 1 week: for demos or short tests.
5

Generate and copy the key

It will look like this:

agnt_sk_1234567890abcdefghijklmnopqrstuv

⚠️ VERY IMPORTANT: Copy and store the key immediately. It is shown ONLY once. If you lose it, you will have to create a new one.

API key security

  • • Never share your API key publicly (social networks, public GitHub, etc.).
  • • Store it in a safe place (password manager).
  • • If you think your key was compromised, revoke it immediately.
  • • Use different keys for different projects.
Agent endpoints
The addresses to communicate with your agent

Each agent has special URLs (endpoints) that you use to send messages and receive responses.

MCP Streamable HTTP

Streamable HTTP transport for bidirectional communication with the agent.

https://agents.matersoft.com.ar/api/mcp/agents/:agent_id/stream-http

💡 Use it for: MCP Inspector, MCP clients, streaming integrations.

MCP SSE (Server-Sent Events)

SSE transport to receive real-time responses from the agent.

https://agents.matersoft.com.ar/api/mcp/agents/:agent_id/sse

💡 Use it for: long-lived connections, real-time streaming of responses.

📋 Where do I find my endpoints?

In your agent's "API" tab you’ll find both endpoints ready to copy. You only need to add your API key when using them.

Integrate into your website
Simple example for developers

If you have a web developer, they can use this code as an example to connect the agent to your site.

// JavaScript - Enviar mensaje al agente via MCP
const response = await fetch(
  'https://tu-dominio.com/api/mcp/agents/{agent_id}/stream-http',
  {
    method: 'POST',
    headers: {
      'Authorization': 'Bearer tu_api_key_aqui',
      'Content-Type': 'application/json',
      'Accept': 'application/json'
    },
    body: JSON.stringify({
      jsonrpc: '2.0',
      id: 1,
      method: 'tools/call',
      params: {
        name: 'send_message',
        arguments: { message: '¿Cuál es el precio del producto X?' }
      }
    })
  }
);

// Leer respuesta NDJSON
const reader = response.body.getReader();
const decoder = new TextDecoder();
let result = '';
while (true) {
  const { done, value } = await reader.read();
  if (done) break;
  result += decoder.decode(value);
}
console.log(JSON.parse(result)); // Respuesta del agente

💡 Note for non-developers:

Don’t worry if this code doesn’t make sense. Just show it to your web developer together with your API key and they’ll know what to do. You can also hire help on platforms like Fiverr or Upwork.

Manage active keys

In the API keys table you can see all your active keys and their information:

Status:
Active or Revoked
Created:
When the key was generated.
Last used:
The last time it was used to access the agent.
Expires:
When it will stop working (if you set an expiration).

🚫 Revoke a key

If you need to deactivate a key (for security or because you no longer use it), click the "Revoke" button on that key’s row. The key will stop working immediately. This action cannot be undone.