Developer
DMOOP API Reference
A REST API for generating brand-grounded marketing content. Authenticate with a key from /settings/api-keys, POST a prompt, get back generated text. Optionally attach an agent_id to ground the output in one of your brand agents.
Base URL
https://www.dmoop.com/api/v1Authentication
All requests require an Authorization header:
Authorization: Bearer dmoop_live_<your-key>Generate keys at /settings/api-keys. Each key is shown once at creation — save it in your secrets manager. If lost, revoke and regenerate. Keys inherit the owning user's brand agents and documents.
POST /api/v1/chat
Generates a completion, optionally grounded in a brand agent's voice profile + top brand documents.
Request body
| Field | Type | Required | Description |
|---|---|---|---|
prompt | string | either this | Single-shot user prompt. Simple case. |
messages | array | or this | OpenAI-style { role, content } list for multi-turn. |
agent_id | string (UUID) | optional | Your Brand Agent ID. Injects voice profile + top-4 brand chunks. |
model | string | optional | Default llama-3.3-70b-versatile. Also llama-3.1-8b-instant, meta-llama/llama-4-scout-17b-16e-instruct. |
Response
| Field | Type | Description |
|---|---|---|
response | string | The generated text. |
model_used | string | The underlying model actually invoked. |
agent_used | string | null | Name of the Brand Agent grounding the response, if any. |
usage | object | Token counts: prompt_tokens, completion_tokens, total_tokens. |
Status codes
| Code | Meaning |
|---|---|
| 200 | Success. |
| 400 | Malformed body (missing prompt/messages). |
| 401 | Missing or invalid Bearer token. |
| 403 | The provided agent_id is not owned by your account. |
| 413 | Request too large. |
| 429 | Rate limited. |
| 500 / 503 | Upstream model failure or misconfigured backend. |
Example — cURL
curl https://www.dmoop.com/api/v1/chat \
-H "Authorization: Bearer dmoop_live_YOUR_KEY_HERE" \
-H "Content-Type: application/json" \
-d '{
"prompt": "Write 3 LinkedIn ad headlines for our new AI-accelerated data platform.",
"agent_id": "YOUR_AGENT_UUID"
}'Example — Node.js (fetch)
const res = await fetch("https://www.dmoop.com/api/v1/chat", {
method: "POST",
headers: {
"Authorization": `Bearer ${process.env.DMOOP_API_KEY}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
prompt: "Write 3 LinkedIn ad headlines for our new AI-accelerated data platform.",
agent_id: process.env.DMOOP_AGENT_ID,
}),
});
const data = await res.json();
console.log(data.response);Example — Python (requests)
import os, requests
r = requests.post(
"https://www.dmoop.com/api/v1/chat",
headers={"Authorization": f"Bearer {os.environ['DMOOP_API_KEY']}"},
json={
"prompt": "Write 3 LinkedIn ad headlines for our new AI-accelerated data platform.",
"agent_id": os.environ["DMOOP_AGENT_ID"],
},
timeout=60,
)
r.raise_for_status()
print(r.json()["response"])Example — multi-turn conversation
curl https://www.dmoop.com/api/v1/chat \
-H "Authorization: Bearer dmoop_live_YOUR_KEY_HERE" \
-H "Content-Type: application/json" \
-d '{
"agent_id": "YOUR_AGENT_UUID",
"messages": [
{ "role": "user", "content": "Write a landing page hero for our AI Engineering practice." },
{ "role": "assistant", "content": "…first draft here…" },
{ "role": "user", "content": "Shorten the sub-headline to under 12 words." }
]
}'Brand grounding
When agent_idis provided (and owned by the API key's user), DMOOP injects:
- The agent's voice profile (tone, audience, preferred vocab, terms to avoid)
- The top-4 brand documents most relevant to the user prompt via similarity retrieval
No brand context is injected when agent_id is omitted. To get the most on-brand output, always pass agent_id and keep the corresponding agent's brand library up to date at /brand.
Support
Bug reports and integration questions: support@dmoop.com. Include the request timestamp and the response body — never the API key itself.
Ready to build?
Mint your first key.
Takes 20 seconds. Copy the plaintext when it's shown, drop it into your app's env vars, and you're integrating.
Get an API key