Back to Guides & Cookbooks
Cookbook

How to swap in Cadreen as your model provider

Change two fields in your existing OpenAI-compatible code. Same messages, same tools, same streaming — but now every response includes governance, memory, and intelligence traces.

1

What changes

Two fields. Everything else stays the same.

Field
Before (OpenAI)
After (Cadreen)
base_url
api.openai.com
accomplishanything.today/api/v1/cadreen
model
gpt-4
cadreen
messages
[...]
[...] (same)
tools
[...]
[...] (same)
response.intelligence
(does not exist)
{ governance, memory, traces }
Your codeOpenAIraw modelYour codeCadreengoverned + memory + traces

Same code, different endpoint, intelligence layer added

2

Python

PYTHON
from openai import OpenAI

# Before
# client = OpenAI(api_key="sk-...")

# After — two lines changed
client = OpenAI(
base_url="https://accomplishanything.today/api/v1/cadreen",
api_key="sk_cadreen_...",
)

response = client.chat.completions.create(
model="cadreen",
messages=[{"role": "user", "content": "Hello"}],
)

# Same response format — but now with intelligence metadata
print(response.choices[0].message.content)
print(response.intelligence) # governance, memory, traces
3

TypeScript

TYPESCRIPT
import OpenAI from "openai";

// Before
// const client = new OpenAI({ apiKey: "sk-..." });

// After — two lines changed
const client = new OpenAI({
baseURL: "https://accomplishanything.today/api/v1/cadreen",
apiKey: "sk_cadreen_...",
});

const response = await client.chat.completions.create({
model: "cadreen",
messages: [{ role: "user", content: "Hello" }],
});

console.log(response.choices[0].message.content);
console.log((response as any).intelligence); // governance, memory, traces
4

curl

BASH
curl -X POST https://accomplishanything.today/api/v1/cadreen/chat/completions \
-H "Content-Type: application/json" \
-H "Authorization: Bearer sk_cadreen_..." \
-d '{
"model": "cadreen",
"messages": [{"role": "user", "content": "Hello"}]
}'
5

What you get for free

Every response now includes an intelligence object. You can ignore it — or use it.

intelligence object
{
"intelligence": {
"capability": {
"total_available": 42,
"healthy_count": 38,
"active_integrations": ["stripe", "github"]
},
"memory": {
"healthy": true,
"knowledge_queried": 147
},
"governance": {
"active": true,
"decision": "auto",
"confidence": 0.94
},
"humility": {
"gaps_detected": 0,
"blocking": false
},
"process": {
"started_at": "2026-06-21T10:30:00Z",
"duration_ms": 840
}
}
}
GovernanceEvery tool call checked against your policies
Memory4 types of persistent memory across sessions
TracesFull decision audit trail for every request
Self-healingFailed tool calls retried automatically
Capability assessmentKnows what it can and can't do
Note
The model field is required by OpenAI-compatible clients but Cadreen ignores it. Cadreen decides which model to use internally.
Note
Next: How to add human approval to any AI tool call — governance, approval tokens, conversational blocking.