DoAide Code

Updated 2026-10-22

DoAide Code API

Everything the free tools on this site do is available over one small REST API — the same endpoints the pages call. No API key, no sign-up: just fair-use rate limits. Use it from scripts, git hooks, CI, or your own editor plugins.

Base URL: https://code.doaide.com · All requests and responses are JSON.

POST /api/public/code-tool

Runs one tool on one snippet and returns the answer as Markdown.

curl -s https://code.doaide.com/api/public/code-tool \
  -H 'Content-Type: application/json' \
  -d '{
    "action": "review",
    "code": "def avg(nums):\n    return sum(nums) / len(nums)",
    "language": "Python"
  }'

Request body

FieldTypeRequiredMeaning
actionstringyesOne of explain, review, bugs, comments, convert, optimize, tests
codestringyesThe snippet to analyze, up to 12,000 characters
languagestringnoHint like "Python"; omit for auto-detect
targetstringconvert onlyThe language to convert to, e.g. "Go"

Response

{ "answer": "### Review\n1. **Division by zero** — `avg([])` raises `ZeroDivisionError` …" }

The answer is Markdown: render it, or pipe it to a terminal viewer like glow.

Errors

StatusMeaning
400Bad input — unknown action, empty code, over the 12,000-character limit, or convert without a target. The detail field says which.
429Rate limited — more than 8 requests in 10 minutes from your address, or the shared hourly cap. Back off and retry later.
502 / 503The AI service is busy or the tools are off on this server. Retry with backoff.

GET /api/public/tool-stats

How many snippets the tools have analyzed, ever. Handy for status pages and badges.

curl -s https://code.doaide.com/api/public/tool-stats
{ "snippets": 1234 }

Recipes

Review staged changes in a git pre-commit hook

#!/bin/sh
# .git/hooks/pre-commit — AI-review each staged file (advisory, never blocks)
git diff --cached --name-only --diff-filter=ACM | while read -r f; do
  jq -n --arg code "$(git show ":$f")" '{action:"review", code:$code}' \
  | curl -s https://code.doaide.com/api/public/code-tool \
      -H 'Content-Type: application/json' -d @- \
  | jq -r '.answer' | sed "s|^|[$f] |"
done
exit 0

Python

import requests

r = requests.post(
    "https://code.doaide.com/api/public/code-tool",
    json={"action": "tests", "code": open("utils.py").read(), "language": "Python"},
    timeout=90,
)
r.raise_for_status()
print(r.json()["answer"])

JavaScript / Node

const res = await fetch("https://code.doaide.com/api/public/code-tool", {
  method: "POST",
  headers: { "Content-Type": "application/json" },
  body: JSON.stringify({ action: "explain", code: "const f = (n) => (n <= 1 ? 1 : n * f(n - 1))" }),
})
const { answer } = await res.json()

Fair use

Try the same tools in the browser

Frequently asked questions

Do I need an API key?

No. The public endpoints are open with fair-use rate limits. If you need higher limits for a real integration, reach out via doaide.com.

Is my code stored?

Snippets are processed to produce the answer and counted in aggregate (the total on the tools page). Don't send secrets or code you cannot share.

Can I use this in CI?

Yes, within the rate limits — review the changed files of a commit rather than the whole repository, and treat failures as advisory so a busy API never blocks your pipeline.