Toggle theme

API Documentation

Integrate AI-powered code debugging into your own tools. Available on Pro & Expand plans.

Your API Key
Login to see your API key
Manage →

Overview

The API lets you submit code for AI analysis and get structured fixes, explanations, and optimizations.

API access requires a Pro or Expand plan. Upgrade here →

Base URL

https://www.aitenzo.com/api

Authentication

Pass your API key as a Bearer token in every request:

Authorization: Bearer abf_your_api_key_here

Or use ?token=YOUR_KEY as a query parameter (less secure, for testing only).

Error Handling

All errors return JSON with success: false and a message field.

HTTP CodeMeaning
200Success
400Bad request — check parameters
401Unauthorized — invalid or missing API key
402No credits remaining
429Rate limit exceeded
500AI processing error
POST/auth.php?action=loginGet a JWT token
FieldTypeRequiredDescription
emailstringrequiredAccount email
passwordstringrequiredAccount password

Response

{ "success": true, "token": "eyJ...", "user": { "credits": 45 } }
GET/auth.php?action=meGet current user profile

Returns the authenticated user's plan, credits, and API key.

{ "success": true, "user": { "name": "John", "plan": "Pro", "credits": 45, "api_key": "abf_..." } }
POST/fix.php?action=fix⭐ Submit code for AI analysis

The core endpoint. Submits code for AI analysis. Consumes 1 credit per request.

FieldTypeRequiredDescription
codestringrequiredCode to analyze (max 50,000 chars)
languagestringoptionalauto, php, javascript, python… Default: auto
modestringoptionalfull, fix, explain, optimize. Default: full

Response

{ "success": true, "request_id": 187, "fixed_code": "... corrected code ...", "explanation": "This function queries...", "bugs_found": [{"line": 5, "description": "SQL Injection", "severity": "critical"}], "suggestions": ["Use prepared statements"], "severity_score": 9, "confidence": 97, "tokens_used": 823, "credits_left": 44, "from_cache": false }

Live Tester

GET/fix.php?action=history
ParamTypeDefaultDescription
pageint1Page number
limitint10Results per page (max 50)
languagestringFilter by language
modestringFilter by mode
searchstringSearch code content

Supported Languages

php
javascript
typescript
python
html
css
java
go
ruby
cpp
sql
bash

Rate Limits

PlanMonthlyPer 60 seconds
Free55 requests
Pro200200 requests
Expand10001000 requests

Code Examples

JavaScript / Node.js

const res = await fetch('https://www.aitenzo.com/api/fix.php?action=fix', { method: 'POST', headers: { 'Content-Type': 'application/json', 'Authorization': 'Bearer YOUR_KEY' }, body: JSON.stringify({ code: 'your code', language: 'php', mode: 'full' }) }); const data = await res.json(); console.log(data.fixed_code, data.bugs_found);

PHP (cURL)

$ch = curl_init('https://www.aitenzo.com/api/fix.php?action=fix'); curl_setopt_array($ch, [ CURLOPT_RETURNTRANSFER => true, CURLOPT_POST => true, CURLOPT_POSTFIELDS => json_encode(['code' => $code, 'language' => 'php', 'mode' => 'full']), CURLOPT_HTTPHEADER => ['Content-Type: application/json', 'Authorization: Bearer YOUR_KEY'], ]); $data = json_decode(curl_exec($ch), true); echo $data['fixed_code'];

Python

import requests r = requests.post('https://www.aitenzo.com/api/fix.php?action=fix', headers={'Authorization': 'Bearer YOUR_KEY'}, json={'code': code, 'language': 'python', 'mode': 'full'}) print(r.json()['fixed_code'])