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
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:
Go to the "API" tab
In your agent's configuration, select the fourth tab.
Click "Generate key"
A form will open to configure the key.
Give it a descriptive name
Example: "Main website" or "Mobile app".
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.
Generate and copy the key
It will look like this:
⚠️ 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.
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.
💡 Use it for: MCP Inspector, MCP clients, streaming integrations.
MCP SSE (Server-Sent Events)
SSE transport to receive real-time responses from the agent.
💡 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.
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.
In the API keys table you can see all your active keys and their information:
🚫 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.