Chat Completions

POST /v1/chat/completions — OpenAI-compatible.

curl https://api.doodbrain.com/v1/chat/completions \ -H "Authorization: Bearer $DOODBRAIN_API_KEY" \ -H "Content-Type: application/json" \ -d '{"model":"doodbrain","messages":[{"role":"user","content":"Hello"}]}'

Example response shape

{
  "id": "chatcmpl-...",
  "object": "chat.completion",
  "model": "doodbrain",
  "choices": [{"index": 0, "message": {"role": "assistant", "content": "..."}, "finish_reason": "stop"}],
  "usage": {"prompt_tokens": 0, "completion_tokens": 0, "total_tokens": 0}
}

Streaming is supported when stream: true is set (SSE chunks).