Finished work from specialists, not raw model output.
Each agent has its own expertise and checks its work before handing it back. You describe the job, and the agent does it.
One call, finished result
agents.run({ agent, task }) returns the agent's finished answer, along with the tokens it used and what it cost.
Drop-in for OpenAI clients
Point any OpenAI SDK at our base URL and use cognitive-anna, cognitive-legal and other agents as models.
Inside your editor
A hosted MCP server adds Cognitive agents to Claude Code, Cursor, VS Code and Windsurf with a single command.
Clear, metered pricing
You're billed per token, and every response shows its cost. Usage comes out of your Cognitive plan, so there's no second bill to manage.
Who you can call today
Use the id shown on each agent in agents.run, or add cognitive- in front of it to use it as an OpenAI model name.
Pay for what you use.
Prices are per million tokens, and there's no minimum or seat fee.
Usage made with your key comes out of your Cognitive plan's monthly allowance, then your credits. Each response's usage.cost_usd shows exactly what it cost. If your allowance runs out, the API returns 402 and nothing more is charged. Swarm pipelines bill each stage's tokens at the Agents rate. Need volume pricing or an invoice? Email hello@cognitivedaniel.com.
Your keys
Create a key for each app or environment. Keep keys on your server; never put one in a web page or mobile app.
Checking your sign-in…
From zero to your first run in two minutes.
Create a key
Sign in and create a key above. Store it as COGNITIVE_API_KEY.
Install the SDK
JavaScript (Node 18+, Deno, Bun, edge runtimes — no dependencies):
npm install @cognitive-ai/sdk
Python (3.11+, stdlib only — no dependencies):
pip install cognitive-ai
Run an agent
import { Cognitive } from '@cognitive-ai/sdk'; const cognitive = new Cognitive(); // reads COGNITIVE_API_KEY const run = await cognitive.agents.run({ agent: 'legal', task: 'Flag anything unusual in this NDA and suggest redlines.', context: ndaText, }); console.log(run.output, run.usage.cost_usd);
Python:
from cognitive_ai import Cognitive cog = Cognitive() # reads COGNITIVE_API_KEY run = cog.agents.run(agent="legal", task="Flag anything unusual in this NDA.", context=nda_text) print(run["output"], run["usage"]["cost_usd"])
Parallel runs, files, and stateful threads
Three capabilities that set Cognitive apart from OpenAI and Meta's APIs at the agent layer.
Batch — run multiple agents in parallel
Send several agents at once and get all results back together. Not available in OpenAI or Meta's agent APIs.
const [legal, finance, qa] = await cognitive.agents.batch([ { agent: 'legal', task: 'Review this NDA.', files: [nda] }, { agent: 'finance', task: 'Summarise Q3 P&L.', context: pl }, { agent: 'qa', task: 'Write test cases for this.', context: spec }, ]);
Python:
results = cog.agents.batch([ {"agent": "legal", "task": "Review this NDA.", "files": ["nda.pdf"]}, {"agent": "finance", "task": "Summarise Q3 P&L.", "context": pl_text}, {"agent": "qa", "task": "Write test cases for this.", "context": spec}, ])
File input — send PDFs, images and documents
Attach any local file and the SDK encodes and sends it automatically. Works in Node (path string) and the browser (File/Blob).
const run = await cognitive.agents.run({ agent: 'legal', task: 'Flag the top three risks in this contract.', files: [contractFile], // File/Blob in browser, path string in Node });
Python:
run = cog.agents.run( agent="legal", task="Flag the top three risks in this contract.", files=["vendor_contract.pdf", "amendments.pdf"], # auto base64-encoded )
Threads — stateful multi-turn conversations
Keep context across turns without managing history yourself. Simpler than OpenAI Assistants: no thread IDs, no file uploads, no polling.
const thread = cognitive.threads.create({ agent: 'anna' }); await thread.send('What are our top Q3 risks?'); await thread.send('Which is most likely to slip the deadline?'); console.log(thread.lastOutput);
Python:
thread = cog.threads.create(agent="anna") thread.send("What are our top Q3 risks?") thread.send("Which is most likely to slip the deadline?") print(thread.last_output)
Add agents to your editor
A hosted MCP server puts Cognitive agents inside Claude Code, Cursor, VS Code and Windsurf. Install the helper package and run one command.
Install cognitive-ai-mcp
npm install -g cognitive-ai-mcp
Add to Claude Code
npx cognitive-ai-mcp claude cog_live_…
Or run cognitive-ai-mcp config cog_live_… to get the mcp.json snippet for Cursor, VS Code and Windsurf.
Use run_agent in your IDE
Your editor now has three tools: run_agent, list_agents and get_usage. Ask your IDE to review code, draft a contract, analyse a P&L — anything you'd send to an agent via the API.
API reference
Base URL https://cognitivedaniel.com/api/v1. Send your key as Authorization: Bearer cog_live_… (or X-API-Key).
| POST /runs | Runs an agent. Body: agent, and either task or messages. Optional: context, knowledge, max_tokens, metadata. Returns { id, output, usage: { input_tokens, output_tokens, cost_usd } }. |
| GET /runs?id= | Fetches a past run. Runs are kept for 7 days, and only your keys can read them. |
| GET /agents | Lists the agents and whether each one can be run over the API. |
| POST /chat | Multi-turn chat with an agent, with streaming (stream: true). |
| POST /swarm | Runs a multi-agent pipeline (PM → Engineer → QA → Security by default; you can pick the stages). |
| GET /usage | Shows this month's calls, tokens and cost on the key making the request. |
| GET /pricing | Returns the current prices per million tokens. |
| POST /openai/chat/completions | OpenAI-compatible chat completions, with streaming. Use model: "cognitive-<agent>". Base URL for OpenAI clients: https://cognitivedaniel.com/api/v1/openai. Also: GET /openai/models. |
| POST /api/mcp/cognitive | A hosted MCP server (Streamable HTTP, not under /api/v1/) with the tools list_agents, run_agent and get_usage. |
Errors return JSON with an error message. You'll see 401 for a bad key, 402 when your plan allowance is used up, and 429 when you go over your key's per-minute limit. Each response includes the x-ratelimit-remaining header.
What we're building next
These aren't available yet. We'll announce each one when it's ready to use.