API v1 — Live

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.app

Quickstart — npm

The fastest way to add memory to your AI app. Zero dependencies, TypeScript-first.

npm install @tanmaysangam018/crossagent
import { 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/mcp

Overview

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.

⚡
Smart Routing
Coding → Claude. Speed → Groq. Research → Gemini. Or specify any model.
🧠
Cross-Model Memory
Context persists across Claude, GPT, and Gemini. Your users don't have to repeat themselves.
🔑
One Key
Single API key, all models. No separate Anthropic / OpenAI / Google accounts needed.

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

POST/v1/chat

Send 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

POST/v1/keys

Generate 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

GET/v1/usage

Check 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

GET/v1/memories

Inspect 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.

code / debug / implement / function / bugClaudeBest at code generation and reasoning
fast / realtime / latest / news / todayGroq (Llama 3)Lowest latency, great for speed-sensitive tasks
research / summarize / analyze / compareGeminiLarge context, strong at synthesis
(everything else)ClaudeDefault — best general-purpose model

You can always override: pass "model": "claude", "groq", or "gemini" explicitly.

Memory — Store

POST/memory/store

Extract 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 — Ask

POST/memory/ask

Natural 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

GET/memory/list?userId=

Return all active memories for a user, ordered by recency.

const all = await ca.memory.list('user_123')

Memory — Profile

GET/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.

OperationFreePro
POST /memory/storeLLM extraction + embedding
500 / moUnlimited
GET /memory/searchEmbedding + pgvector query
500 / moUnlimited
POST /memory/askEmbedding + LLM synthesis
50 / moUnlimited
GET /memory/listDB read only
UnlimitedUnlimited
GET /memory/profileDB read only
UnlimitedUnlimited
DELETE /memory/delete/:idDB write
UnlimitedUnlimited
Need higher limits? Paid plans are coming soon — reach out to get early access.DM on X →

Errors

401Invalid or missing API keyCheck your Authorization header. Key must start with ca_live_
400user_id is required / message is requiredBoth fields are required in the request body
400Invalid JSON bodyEnsure Content-Type: application/json and valid JSON
500Error from model providerTemporary — retry with exponential backoff

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"}'