Crossagent API
One API key. Any model. Memory that follows your users across Claude, GPT, and Gemini — automatically.
Base URLhttps://backend-wine-phi-85.vercel.appQuickstart — npm
The fastest way to add memory to your AI app. Zero dependencies, TypeScript-first.
npm install @tanmaysangam018/crossagentimport { Crossagent } from '@tanmaysangam018/crossagent'
const ca = new Crossagent()
// After any AI conversation, store what the user said
await ca.memory.add({
userId: 'user_123',
message: 'I prefer TypeScript and work in fintech.',
response: 'Got it, noted!',
})
// Semantic search — finds relevant memories by meaning, not keyword
const memories = await ca.memory.search('user_123', 'programming preferences')
// → [{ content: 'User prefers TypeScript', score: 0.91 }]
// Natural language Q&A over stored memories
const answer = await ca.memory.ask('user_123', 'What does this user do for work?')
// → "Based on your memories, you work in fintech."MCP server (for AI agents)
https://backend-wine-phi-85.vercel.app/mcpOverview
The Crossagent API lets your app send a message, and get back a response from the best-fit model — with the user's conversation history pulled automatically from semantic memory.
Authentication
All endpoints (except /v1/keys) require a Bearer token.
Authorization: Bearer ca_live_<your_key>Get your key via POST /v1/keys. Keys are tied to an email address — one key per email on the free plan.
Chat
/v1/chatSend a message, get a response from the best-fit model with memory context injected automatically.
Request body
{
"user_id": "user_abc123", // required — scopes memory to this user
"message": "Explain async/await in JS", // required
"model": "auto", // optional: "auto" | "claude" | "groq" | "gemini"
"system": "You are a senior engineer." // optional — prepended to system prompt
}Response
{
"response": "Async/await is syntactic sugar over Promises...",
"model": "claude",
"memories_used": 2,
"routing_reason": "coding task → claude"
}Example — curl
curl -X POST https://backend-wine-phi-85.vercel.app/v1/chat \
-H "Authorization: Bearer ca_live_YOUR_KEY" \
-H "Content-Type: application/json" \
-d '{
"user_id": "user_abc123",
"message": "Explain async/await in JS"
}'Example — JavaScript
const res = await fetch('https://backend-wine-phi-85.vercel.app/v1/chat', {
method: 'POST',
headers: {
'Authorization': 'Bearer ca_live_YOUR_KEY',
'Content-Type': 'application/json',
},
body: JSON.stringify({
user_id: 'user_abc123',
message: 'Explain async/await in JS',
}),
})
const { response, model, memories_used } = await res.json()Get an API Key
/v1/keysGenerate an API key. One key per email — returns the existing key if one already exists.
curl -X POST https://backend-wine-phi-85.vercel.app/v1/keys \
-H "Content-Type: application/json" \
-d '{"email": "you@yourapp.com", "name": "My App"}'{
"key": "ca_live_4a7f3b9e2c...",
"already_existed": false // true if this email already had a key
}Usage
/v1/usageCheck request count and plan status for your API key.
curl https://backend-wine-phi-85.vercel.app/v1/usage \
-H "Authorization: Bearer ca_live_YOUR_KEY"{
"email": "you@yourapp.com",
"plan": "free",
"requests": 142,
"created_at": "2026-10-05T12:00:00Z",
"last_used": "2026-10-08T09:34:21Z"
}Memories
/v1/memoriesInspect the semantic memories stored for a user. Useful for debugging or building memory management UIs.
curl "https://backend-wine-phi-85.vercel.app/v1/memories?user_id=user_abc123" \
-H "Authorization: Bearer ca_live_YOUR_KEY"{
"count": 12,
"memories": [
{
"content": "User prefers TypeScript over Python for backend work",
"mem_type": "preference",
"src_agent": "v1-api",
"tgt_agent": "claude",
"strength": 1.0,
"created_at": "2026-10-06T14:22:10Z"
},
...
]
}Smart Routing
Pass "model": "auto" (or omit the field) and the API picks the best model based on message content.
You can always override: pass "model": "claude", "groq", or "gemini" explicitly.
Memory — Store
/memory/storeExtract facts from a conversation turn and store them as semantic memories.
await ca.memory.add({
userId: 'user_123',
message: 'I live in New York and use React.',
response: 'Got it!',
sourceAgent: 'my-app',
targetAgent: 'claude',
})curl -X POST https://backend-wine-phi-85.vercel.app/memory/store \
-H "Content-Type: application/json" \
-d '{
"userId": "user_123",
"message": "I live in New York and use React.",
"response": "Got it!",
"sourceAgent": "my-app",
"targetAgent": "claude"
}'Memory — Search
/memory/search?userId=&q=Semantic vector search over a user's memories. Returns matches by meaning, not exact keyword.
const results = await ca.memory.search('user_123', 'where does the user live')curl "https://backend-wine-phi-85.vercel.app/memory/search?userId=user_123&q=where+does+the+user+live"
// Response
{
"memories": [
{ "content": "User lives in New York", "mem_type": "fact", "score": 0.94 }
]
}Memory — Ask
/memory/askNatural language Q&A over stored memories. Uses an LLM to synthesize an answer.
const answer = await ca.memory.ask('user_123', 'What stack does this user prefer?')
// → "Based on your memories, you prefer React and TypeScript."curl -X POST https://backend-wine-phi-85.vercel.app/memory/ask \
-H "Content-Type: application/json" \
-d '{ "userId": "user_123", "question": "What stack does this user prefer?" }'Memory — List
/memory/list?userId=Return all active memories for a user, ordered by recency.
const all = await ca.memory.list('user_123')Memory — Profile
/memory/profile?userId=Pre-built user profile: permanent facts + recent activity. Ready to inject into any system prompt.
const { static_facts, dynamic_ctx } = await ca.memory.profile('user_123')
// static_facts: ['User lives in New York', 'User prefers React']
// dynamic_ctx: ['User is building a payments app']MCP Server
Connect any MCP-compatible AI agent directly to Crossagent memory. Exposes 4 tools: remember, recall, get_profile, list_memories.
MCP endpoint
https://backend-wine-phi-85.vercel.app/mcp// claude_desktop_config.json
{
"mcpServers": {
"crossagent": {
"command": "npx",
"args": ["-y", "mcp-remote", "https://backend-wine-phi-85.vercel.app/mcp"],
"env": { "MCP_HEADER_AUTHORIZATION": "Bearer eng_YOUR_KEY" }
}
}
}Rate Limits
Limits apply per API key per calendar month. Operations that cost compute (LLM calls, embeddings) are capped on the free tier. Read-only operations are always unlimited.
Errors
Ready to build?
Get your API key in 5 seconds. No credit card required.
curl -X POST https://backend-wine-phi-85.vercel.app/v1/keys \
-H "Content-Type: application/json" \
-d '{"email": "you@yourapp.com"}'