DoodBrain API

Base URL: https://api.doodbrain.com/v1

Do not embed secret API keys in browser JavaScript. Call the API from your backend.

Authentication

Authorization: Bearer db_live_...

Quickstart (curl)

curl https://api.doodbrain.com/v1/models \
  -H "Authorization: Bearer $DOODBRAIN_API_KEY"

curl https://api.doodbrain.com/v1/chat/completions \
  -H "Authorization: Bearer $DOODBRAIN_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "doodbrain-auto",
    "messages": [{"role":"user","content":"Türkiye'\''nin başkenti nedir?"}]
  }'

Python (OpenAI-compatible)

from openai import OpenAI
client = OpenAI(
  api_key="DOODBRAIN_API_KEY",
  base_url="https://api.doodbrain.com/v1",
)
r = client.chat.completions.create(
  model="doodbrain-auto",
  messages=[{"role":"user","content":"Hello"}],
)
print(r.choices[0].message.content)

JavaScript

import OpenAI from "openai";
const client = new OpenAI({
  apiKey: process.env.DOODBRAIN_API_KEY,
  baseURL: "https://api.doodbrain.com/v1",
});
const r = await client.chat.completions.create({
  model: "doodbrain-auto",
  messages: [{ role: "user", content: "Hello" }],
});

PHP

$ch = curl_init("https://api.doodbrain.com/v1/chat/completions");
curl_setopt_array($ch, [
  CURLOPT_HTTPHEADER => [
    "Authorization: Bearer " . getenv("DOODBRAIN_API_KEY"),
    "Content-Type: application/json",
  ],
  CURLOPT_POST => true,
  CURLOPT_POSTFIELDS => json_encode([
    "model" => "doodbrain-auto",
    "messages" => [["role"=>"user","content"=>"Hello"]],
  ]),
  CURLOPT_RETURNTRANSFER => true,
]);
echo curl_exec($ch);

Models

Image/Video generation endpoints are not available (hardware required).

Brains

POST /v1/brains/{id}/chat
# or model: "brain:<uuid>" with scope brains:invoke

Errors

{"error":{"message":"...","type":"...","code":"..."}}

401 invalid key · 403 insufficient scope · 429 rate limit · 400 invalid request · 503 overloaded

Create API keys