API & MCP Documentation
Everything you need to integrate Kognitrix AI into your applications, scripts, and AI agent workflows.
Authentication
All API requests require an API key passed in the Authorization header. Get your key from the API Keys page in your dashboard.
Authorization: Bearer kgx_live_xxxxxxxxxxxxBase URL
https://kognitrix.ai/api/v1Endpoints
GET
/servicesList all available servicesGET
/creditsCheck your credit balanceAuth
GET
/usageView usage historyAuth
POST
/generate/contentGenerate content (5 credits)Auth
POST
/generate/codeGenerate/debug code (8 credits)Auth
POST
/generate/imageGenerate images (10 credits)Auth
POST
/generate/documentAnalyze documents (6 credits)Auth
POST
/generate/extractExtract structured data (4 credits)Auth
POST
/generate/translateTranslate text (3 credits)Auth
Quick Example
cURL
curl -X POST https://kognitrix.ai/api/v1/generate/content \
-H "Authorization: Bearer kgx_live_your_key_here" \
-H "Content-Type: application/json" \
-d '{
"prompt": "Write a blog post about AI in 2026",
"type": "blog",
"tone": "professional"
}'Python
import requests
response = requests.post(
"https://kognitrix.ai/api/v1/generate/content",
headers={"Authorization": "Bearer kgx_live_your_key_here"},
json={
"prompt": "Write a blog post about AI in 2026",
"type": "blog",
"tone": "professional"
}
)
data = response.json()
print(data["data"]["content"])
print(f"Credits remaining: {data['credits_remaining']}")JavaScript
const response = await fetch("https://kognitrix.ai/api/v1/generate/content", {
method: "POST",
headers: {
"Authorization": "Bearer kgx_live_your_key_here",
"Content-Type": "application/json",
},
body: JSON.stringify({
prompt: "Write a blog post about AI in 2026",
type: "blog",
tone: "professional",
}),
});
const data = await response.json();
console.log(data.data.content);
console.log("Credits remaining:", data.credits_remaining);Response Format
{
"success": true,
"data": {
"content": "...",
"word_count": 450,
"tokens_used": 623
},
"credits_used": 5,
"credits_remaining": 45,
"request_id": "req_a1b2c3d4e5f6"
}MCP Server (for AI Agents)
AI agents can connect to Kognitrix via the Model Context Protocol (MCP). Add this to your agent's MCP config:
{
"mcpServers": {
"kognitrix": {
"url": "https://kognitrix.ai/api/mcp",
"headers": {
"Authorization": "Bearer kgx_live_your_key_here"
}
}
}
}Available MCP tools: kognitrix_generate_content, kognitrix_generate_code, kognitrix_generate_image, kognitrix_analyze_document, kognitrix_extract_data, kognitrix_translate, kognitrix_check_credits, kognitrix_list_services.
Rate Limits
| Plan | Requests/min | Requests/day |
|---|---|---|
| Free Trial | 5 | 50 |
| Starter | 30 | 1,000 |
| Pro | 60 | 5,000 |
| Enterprise | 120 | 20,000 |