Introduccion
BletzAI API provides programmatic access to our AI models: BletzAssist (conversational AI), BletzMind (predictive analytics), and BletzFlow (process automation).
All API requests should be made to https://bletzai.pages.dev/api/v1/*. Responses are returned in JSON format.
https://bletzai.pages.dev/api/v1
Quick Start
# 1. Get your API key curl -X POST https://bletzai.pages.dev/api/auth/register \ -H "Content-Type: application/json" \ -d '{"name": "Tu Nombre", "email": "tu@email.com"}' # 2. Use the API curl -X POST https://bletzai.pages.dev/api/v1/chat \ -H "Authorization: Bearer tu_api_key" \ -H "Content-Type: application/json" \ -d '{"message": "Hello, how can you help my business?"}'
Autenticacion
All API endpoints (except /api/v1/status) require authentication via a Bearer token in the Authorization header.
Register to receive a 48-character API key. Each email can generate one key.
Request Body
{
"name": "string (required)",
"email": "string (required, valid email)"
}
Response
{
"success": true,
"data": {
"apiKey": "bltz_a1b2c3d4e5f6...",
"name": "Tu Nombre",
"email": "tu@email.com",
"tier": "starter",
"tierLimits": {
"requestsPerDay": 1000,
"endpoints": ["/api/v1/*"]
},
"created": "2026-06-06T10:00:00.000Z",
"docs": "/docs"
}
}
Include your API key in all requests:
Authorization: Bearer bltz_a1b2c3d4e5f6g7h8i9j0...
Error Responses
All errors follow a consistent format:
{
"success": false,
"error": {
"code": "ERROR_CODE",
"message": "Human-readable description"
},
"timestamp": "2026-06-06T10:00:00.000Z"
}
| Status | Code | Description |
|---|---|---|
| 400 | VALIDATION_ERROR | Invalid or missing parameters |
| 401 | UNAUTHORIZED | Missing or malformed Authorization header |
| 401 | INVALID_API_KEY | API key not found or invalid format |
| 403 | KEY_REVOKED | API key has been deactivated |
| 409 | EMAIL_EXISTS | Email already registered (register) |
| 415 | UNSUPPORTED_MEDIA_TYPE | Content-Type must be application/json |
| 429 | RATE_LIMIT | Daily request limit exceeded |
Chat — BletzAssist
Conversational AI assistant for customer service, sales, and support automation. Understands context and generates natural responses.
Request Body
| Field | Type | Description | |
|---|---|---|---|
message | string | required | The user message |
context | object | optional | Conversation history or context |
model | string | optional | Model ID (default: bletzassist-v1) |
Example Request
curl -X POST https://bletzai.pages.dev/api/v1/chat \
-H "Authorization: Bearer bltz_your_key_here" \
-H "Content-Type: application/json" \
-d '{"message": "How can I improve my customer support?"}'
Example Response
{
"success": true,
"data": {
"reply": "I can help you qualify leads...",
"model": "bletzassist-v1",
"confidence": 0.972,
"tokens": 42,
"processingTime": "0.23s"
}
}
Analizar — BletzMind
Predictive analytics engine for market analysis, sentiment analysis, forecasting, and risk assessment.
Request Body
| Field | Type | Description | |
|---|---|---|---|
data | object | required | Your input data |
type | string | required | Analysis type: market, sentiment, forecast, risk, custom |
Example Request
curl -X POST https://bletzai.pages.dev/api/v1/analyze \
-H "Authorization: Bearer bltz_your_key_here" \
-H "Content-Type: application/json" \
-d '{"data": {"revenue": [1200, 1450, 1600]}, "type": "forecast"}'
Example Response
{
"success": true,
"data": {
"type": "forecast",
"analysis": {
"summary": "Revenue trajectory shows consistent upward trend...",
"metrics": {
"nextQuarter": "22.3%",
"nextYear": "55.7%",
"confidenceInterval": "±4.2%",
"recommendation": "Expand capacity to meet projected demand"
}
},
"confidence": 0.943,
"model": "bletzmind-v2",
"processingTime": "1.23s"
}
}
Automatizar — BletzFlow
Process automation engine that executes multi-step workflows including lead capture, invoice processing, customer onboarding, and more.
Request Body
| Field | Type | Description | |
|---|---|---|---|
workflow | string | required | Workflow ID: lead_capture, invoice_processing, customer_onboarding, inventory_sync, report_generation |
params | object | optional | Workflow-specific parameters |
Example Request
curl -X POST https://bletzai.pages.dev/api/v1/automate \
-H "Authorization: Bearer bltz_your_key_here" \
-H "Content-Type: application/json" \
-d '{"workflow": "lead_capture"}'
Example Response
{
"success": true,
"data": {
"workflow": "Lead Capture & Qualification",
"status": "completed",
"executionId": "flw_1752000000_a1b2c3",
"steps": [...],
"totalDuration": "1.2s",
"recordsProcessed": 247,
"errors": 0,
"model": "bletzflow-v1"
}
}
Estado
Public endpoint to check API health and available models. No authentication required.
Example Request
curl https://bletzai.pages.dev/api/v1/status
Example Response
{
"success": true,
"data": {
"api": "BletzAI API",
"version": "v1.0.0",
"status": "operational",
"uptime": "99.97%",
"models": [
{ "id": "bletzassist-v1", "type": "conversational", "status": "online" },
{ "id": "bletzmind-v2", "type": "analytics", "status": "online" },
{ "id": "bletzflow-v1", "type": "automation", "status": "online" }
],
"registeredClients": 42,
"docs": "/docs"
}
}
Limites
| Tier | Requests/Day | Endpoints |
|---|---|---|
| Starter | 1,000 | All /api/v1/* |
| Premium | 10,000 | All endpoints + priority |
Rate limits reset daily at 00:00 UTC. Contact hola@bletzai.com to upgrade.
SDKs & Ejemplos
JavaScript
const API_KEY = 'bltz_your_key_here';
async function chatBletz(message) {
const res = await fetch('https://bletzai.pages.dev/api/v1/chat', {
method: 'POST',
headers: {
'Authorization': `Bearer ${API_KEY}`,
'Content-Type': 'application/json'
},
body: JSON.stringify({ message })
});
return res.json();
}
Python
import requests
API_KEY = "bltz_your_key_here"
def chat(message):
res = requests.post(
"https://bletzai.pages.dev/api/v1/chat",
headers={"Authorization": f"Bearer {API_KEY}"},
json={"message": message}
)
return res.json()
cURL
curl -X POST https://bletzai.pages.dev/api/v1/chat \
-H "Authorization: Bearer bltz_your_key_here" \
-H "Content-Type: application/json" \
-d '{"message": "Hello"}'