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_xxxxxxxxxxxx

Base URL

https://kognitrix.ai/api/v1

Endpoints

GET
/servicesList all available services
GET
/creditsCheck your credit balance
Auth
GET
/usageView usage history
Auth
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

PlanRequests/minRequests/day
Free Trial550
Starter301,000
Pro605,000
Enterprise12020,000