v1 — REST API
AgentVault API
Chat, Embeddings y Transcripcion en una sola API. Compatible con OpenAI SDK. Tus datos nunca salen de nuestra infra.
Autenticacion
Todas las peticiones requieren una API key en el header. Obten tu key desde el Dashboard → API Keys.
X-API-Key: tu_api_key_aqui
Authorization: Bearer tu_api_key_aqui
Base URL: https://agentesia.lomerezco.com/api
Chat Completions
POST
/v1/chat
Envia un mensaje y recibe una respuesta del modelo IA. Puedes especificar un agente para contexto especializado.
Parametros
| Campo | Tipo | Descripcion |
message requerido | string | El mensaje del usuario |
agent_slug | string | Slug del agente (ej: "logo-creator"). Agrega contexto especializado. |
conversation_id | string | ID de conversacion para mantener contexto entre mensajes. |
Ejemplo
curl -X POST https://agentesia.lomerezco.com/api/v1/chat \
-H "X-API-Key: tu_key" \
-H "Content-Type: application/json" \
-d '{
"message": "Crea un logo minimalista para una cafeteria tech",
"agent_slug": "logo-creator"
}'
import requests
resp = requests.post(
"https://agentesia.lomerezco.com/api/v1/chat",
headers={"X-API-Key": "tu_key"},
json={
"message": "Crea un logo minimalista para una cafeteria tech",
"agent_slug": "logo-creator"
}
)
print(resp.json()["response"])
const res = await fetch("https://agentesia.lomerezco.com/api/v1/chat", {
method: "POST",
headers: {
"X-API-Key": "tu_key",
"Content-Type": "application/json"
},
body: JSON.stringify({
message: "Crea un logo minimalista para una cafeteria tech",
agent_slug: "logo-creator"
})
});
const data = await res.json();
console.log(data.response);
$response = file_get_contents('https://agentesia.lomerezco.com/api/v1/chat', false,
stream_context_create(['http' => [
'method' => 'POST',
'header' => "X-API-Key: tu_key\r\nContent-Type: application/json",
'content' => json_encode([
'message' => 'Crea un logo minimalista para una cafeteria tech',
'agent_slug' => 'logo-creator'
])
]])
);
$data = json_decode($response, true);
echo $data['response'];
Embeddings
POST
/v1/embeddings
Vectoriza texto para RAG, busqueda semantica y clasificacion. Devuelve vectores de 768 dimensiones.
| Campo | Tipo | Descripcion |
input requerido | string | string[] | Texto(s) a vectorizar |
model | string | Default: nomic-embed-text |
curl -X POST https://agentesia.lomerezco.com/api/v1/embeddings \
-H "X-API-Key: tu_key" \
-H "Content-Type: application/json" \
-d '{"input": "Texto para vectorizar"}'
import requests
resp = requests.post(
"https://agentesia.lomerezco.com/api/v1/embeddings",
headers={"X-API-Key": "tu_key"},
json={"input": ["texto 1", "texto 2"]}
)
vectors = [d["embedding"] for d in resp.json()["data"]]
const res = await fetch("https://agentesia.lomerezco.com/api/v1/embeddings", {
method: "POST",
headers: { "X-API-Key": "tu_key", "Content-Type": "application/json" },
body: JSON.stringify({ input: "Texto para vectorizar" })
});
const { data } = await res.json();
console.log(`Dimensions: ${data[0].embedding.length}`);
Transcripcion (Whisper)
POST
/v1/transcribe
Convierte audio a texto. Soporta MP3, WAV, M4A, OGG, WEBM, FLAC. Maximo 50MB.
| Campo | Tipo | Descripcion |
file requerido | file (multipart) | Archivo de audio |
language | string | Idioma: es, en, fr (default: es) |
model | string | Modelo Whisper: tiny, base, small, medium (default: base) |
curl -X POST https://agentesia.lomerezco.com/api/v1/transcribe \
-H "X-API-Key: tu_key" \
-F "file=@audio.mp3" \
-F "language=es"
import requests
with open("audio.mp3", "rb") as f:
resp = requests.post(
"https://agentesia.lomerezco.com/api/v1/transcribe",
headers={"X-API-Key": "tu_key"},
files={"file": f},
data={"language": "es"}
)
print(resp.json()["text"])
Listar Agentes
GET
/agents
Lista todos los agentes disponibles. Filtra por categoria o tier.
| Query Param | Tipo | Descripcion |
category | string | Filtrar: sales, design, robotics, marketing, engineering, etc. |
tier | string | free o pro |
lang | string | es, en, fr |
curl https://agentesia.lomerezco.com/api/agents?category=design&lang=es
Limites y Errores
| Codigo | Significado |
200 | OK |
400 | Parametros invalidos |
401 | API key invalida o faltante |
402 | Sin creditos o limite alcanzado |
429 | Rate limit (200 req/15min por default) |
500 | Error del servidor |
Planes
| Plan | Precio | Chat tokens | Embeddings | Whisper | API |
| Free | $0 | 50K/mes | 10K/mes | 5 min | Solo panel |
| Dev | $9/mes | 500K/mes | 100K/mes | 60 min | REST API |
| Startup | $29/mes | 2M/mes | 500K/mes | 5h | API + Widget |
| Business | $99/mes | 10M/mes | 2M/mes | 16h+ | Todo |
| Unlimited | $299/mes | 50M/mes | 10M/mes | 83h+ | Todo + SLA |