Developer documentation
AI2me platform API
One endpoint to reach every model. AI2me routes each request to the provider best suited to it, keeps the conversation in a session, and bills a single balance in credits.
Model Context Protocol
Prefer to connect an AI assistant directly?
The MCP server gives Claude, Cursor or any MCP client 24 tools that build in your account — no code required.
Overview
The platform API is a small surface: start a session, continue it, check on it.
Instead of integrating each model provider separately, you send the question to AI2me. It analyses complexity, cost sensitivity and task type, then routes to the provider that fits — and tells you which one it picked in the response.
One integration
Add providers and models without changing your code. Routing is a server-side decision.
Sessions, not prompts
Follow-up questions keep their context, so you never resend the conversation.
One balance
Usage across every provider draws on the same credit balance, itemised in your ledger.
Quickstart
From signup to your first answer in three steps.
- 1
Get an API key
Create one in Dashboard → API Keys. The key is shown once, so store it somewhere safe before you close the dialog.
- 2
Make your first call
Start a sessioncurl -s -X POST https://us.be.ai2me.com/v1/ai/start \ -H "X-API-Key: ai2me_live_YOUR_KEY" \ -H "Content-Type: application/json" \ -d '{ "question": "Summarize the key trends in renewable energy for 2026", "preferences": { "quality_priority": "balanced", "cost_sensitivity": "medium" } }' - 3
Watch it in the dashboard
Every request appears in your usage history with the provider chosen, latency and credits spent.
Authentication
Every request carries an API key. Keys are hashed at rest and shown to you exactly once.
Send the key in the X-API-Key header. Keys can be scoped, given a rate limit and set to expire; rotating one issues a new secret while keeping the same settings.
X-API-Key: ai2me_live_YOUR_KEY
Content-Type: application/jsonSessions
A session is one conversation. Start it once, then continue it as many times as you need.
/v1/ai/start returns a session_id. Pass that to /v1/ai/continue for every follow-up and the earlier turns, attachments and any generated artifacts stay in scope.
How the response arrives
Simple questions answer immediately in the response field. Longer work — a deck, an app, a large analysis — returns the session first and finishes in the background; poll /v1/ai/status until it completes. Set instant_response: true to always return straight away.
{ name, url } or with inline base64. Images are also sent to the model as vision input.{
"question": "Summarize this report and list the three biggest risks",
"attachments": [
{
"name": "annual-report.pdf",
"url": "https://example.com/annual-report.pdf"
}
],
"preferences": {
"quality_priority": "quality"
}
}Endpoint reference
Three endpoints cover the whole flow.
| Endpoint | Purpose | Required fields |
|---|---|---|
POST /v1/ai/start | Begin a session and ask the first question | question |
POST /v1/ai/continue | Ask a follow-up in an existing session | session_id, question |
POST /v1/ai/status | Check a session that is still processing | session_id |
POST /v1/ai/start
Accepts question plus optional attachments, connector_ids, additional_content, preferences and instant_response.
{
"session_id": "8f3c1d90-…",
"query_id": "1fb0f37a-…",
"status": "active",
"response": "Renewable capacity additions in 2026 were led by…",
"ai_provider": {
"provider_name": "anthropic",
"model_name": "claude-sonnet-4-6",
"routing_strategy": "context_driven"
}
}POST /v1/ai/continue
curl -s -X POST https://us.be.ai2me.com/v1/ai/continue \
-H "X-API-Key: ai2me_live_YOUR_KEY" \
-H "Content-Type: application/json" \
-d '{
"session_id": "8f3c1d90-…",
"question": "Now compare that with 2025."
}'POST /v1/ai/status
curl -s -X POST https://us.be.ai2me.com/v1/ai/status \
-H "X-API-Key: ai2me_live_YOUR_KEY" \
-H "Content-Type: application/json" \
-d '{"session_id": "8f3c1d90-…"}'Routing preferences
| Field | Values | Effect |
|---|---|---|
quality_priority | cost · balanced · quality | Trades price against answer quality |
cost_sensitivity | low · medium · high | How hard to optimise for price |
response_time | fast · standard · flexible | Latency preference |
preferred_provider | Provider name | Pins a provider instead of routing |
