The Responses API lets Cadreen handle the hard parts — governance, memory, tool execution — so you don't have to. It's the recommended endpoint for all new projects.
A single endpoint that does what Chat Completions does — plus governance, memory, tool execution, and conversation state. You send a request, Cadreen decides which model to use, applies your policies, executes any tools, and returns a typed response.
Think of it as the difference between calling a model directly and calling an intelligence layer. The model is one component. Cadreen is the system around it.
Send a simple request. Cadreen handles the rest.
from openai import OpenAI
client = OpenAI(
base_url="https://api.cadreen.com/api/v1/cadreen",
api_key="sk_cadreen_..."
)
response = client.responses.create(
model="cadreen",
input="What connectors do I have?",
instructions="You are a helpful AI assistant."
)
print(response.output_text)import OpenAI from "openai";
const client = new OpenAI({
baseURL: "https://api.cadreen.com/api/v1/cadreen",
apiKey: "sk_cadreen_...",
});
const response = await client.responses.create({
model: "cadreen",
input: "What connectors do I have?",
instructions: "You are a helpful AI assistant.",
});
console.log(response.output_text);curl -X POST https://api.cadreen.com/api/v1/cadreen/responses \
-H "Authorization: Bearer sk_cadreen_..." \
-H "Content-Type: application/json" \
-d '{
"model": "cadreen",
"input": "What connectors do I have?",
"instructions": "You are a helpful AI assistant."
}'Both endpoints generate text. The difference is what happens around it.
Every response has a unique ID, an output array with structured items, and a ready-to-use text helper.
{
"id": "resp_68af4030592c81938ec0a5fbab4a3e9f",
"object": "response",
"output": [
{
"id": "msg_68af40337e58819392e935fb",
"type": "message",
"status": "completed",
"content": [
{
"type": "output_text",
"text": "You have 3 active connectors: GitHub, Slack, and Linear."
}
],
"role": "assistant"
}
],
"output_text": "You have 3 active connectors: GitHub, Slack, and Linear.",
"usage": {
"input_tokens": 42,
"output_tokens": 18,
"total_tokens": 60
},
"store": true
}Set stream: true to receive text in real time. Useful for chat UIs and long responses where you don't want the user staring at a blank screen.
stream = client.responses.create(
model="cadreen",
input="Tell me about my workspace",
stream=True
)
for event in stream:
if event.type == "response.output_text.delta":
print(event.delta, end="", flush=True)Define tools just like Chat Completions. Cadreen checks your governance policies before calling any of them.
response = client.responses.create(
model="cadreen",
input="Read main.go and summarize it",
tools=[{
"type": "function",
"function": {
"name": "read",
"description": "Read a file",
"parameters": {
"type": "object",
"properties": {
"path": {"type": "string", "description": "File path"}
},
"required": ["path"]
}
}
}]
)Chat Completions requires you to store and resend the full message history. Responses gives you three options:
# Turn 1
res1 = client.responses.create(
model="cadreen",
input="What is the capital of France?",
instructions="You are a geography expert.",
store=True
)
print(res1.output_text) # "The capital of France is Paris."
# Turn 2 — Cadreen remembers the context
res2 = client.responses.create(
model="cadreen",
input="And its population?",
instructions="You are a geography expert.",
previous_response_id=res1.id,
store=True
)
print(res2.output_text) # "Paris has approximately 2.1 million people..."