curl --request POST \
--url https://api.example.com/api/generate-template \
--header 'Content-Type: application/json' \
--data '
{
"prompt": "<string>",
"area": "<string>"
}
'{
"text": "<string>"
}Generate an institutional document template for Mexican government entities
curl --request POST \
--url https://api.example.com/api/generate-template \
--header 'Content-Type: application/json' \
--data '
{
"prompt": "<string>",
"area": "<string>"
}
'{
"text": "<string>"
}Documentation Index
Fetch the complete documentation index at: https://mintlify.com/JuanMateoDEv/Groqq-MicroService/llms.txt
Use this file to discover all available pages before exploring further.
POST /api/generate-template
"Oficio de solicitud de material de oficina para el departamento""Recursos Humanos", "Obras Públicas", "Secretaría General"{{Variable}} format (double braces).The template includes:{{Variable}} format with double braces (not brackets or single braces)buildSystem() function.
curl -X POST http://localhost:5055/api/generate-template \
-H "Content-Type: application/json" \
-d '{
"prompt": "Oficio de solicitud de material de oficina para el departamento",
"area": "Recursos Humanos"
}'
const response = await fetch('http://localhost:5055/api/generate-template', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
},
body: JSON.stringify({
prompt: 'Oficio de solicitud de material de oficina para el departamento',
area: 'Recursos Humanos'
})
});
const data = await response.json();
console.log(data.text);
{
"text": "AYUNTAMIENTO DE {{Municipio}}\n\nASUNTO: Solicitud de Material de Oficina\n\n{{Lugar}}, {{Fecha}}\n\n{{Destinatario}}\n{{Cargo}}\nPresente\n\nPor medio del presente, el Departamento de Recursos Humanos solicita...\n\nATENTAMENTE\n\n{{Firma}}\n{{Cargo}}\n\nC.c.p. {{Copia}}"
}
Show 400 Bad Request
prompt parameter is missing or not a string.{
"error": "prompt es requerido"
}
prompt in request body (server.js:21-23)Show 502 Bad Gateway
{
"error": "Groq error",
"details": "...error details from Groq API..."
}
GROQ_API_KEY environment variableShow 500 Internal Server Error
{
"error": "server error",
"details": "...exception message..."
}
prompt parameter is a stringllama-3.1-8b-instant and temperature 0.4data.choices[0].message.contentllama-3.1-8b-instant0.4 (balanced between consistency and creativity)