Developers
Everything a human can do at algor.bet — search markets, price a sentence, book a ticket, check P&L — is available to ChatGPT, Claude, Cursor and headless scripts over MCP or plain REST. Money-moving actions are opt-in per token and hard-capped per day.
Algor exposes a remote Model Context Protocol server at https://algor.world/api/mcp (Streamable HTTP, stateless). Any MCP client can connect with either a personal API key or an OAuth 2.1 login. The same permissions apply to the REST API when you send an Authorization: Bearer header.
bets:write (with a daily stake cap) and plan:write.API keys are the quickest route for Cursor, Claude Code, scripts and CI. Create one under Settings → Agent access, pick scopes, and send it as a bearer token. Keys start with algor_sk_ and are shown once.
OAuth 2.1 is for hosted assistants that log users in themselves (Claude.ai connectors, ChatGPT). Algor is its own authorization server: discovery lives at https://algor.world/.well-known/oauth-authorization-server, PKCE (S256) is mandatory, clients register dynamically or via an https:// client-ID metadata URL, and users approve scopes plus a stake cap on the consent screen at /oauth/authorize. Access tokens last an hour; refresh tokens rotate and last 30 days.
# Discovery
GET https://algor.world/.well-known/oauth-protected-resource
GET https://algor.world/.well-known/oauth-authorization-server
# Endpoints
POST https://algor.world/api/oauth/register # RFC 7591, public clients
GET https://algor.world/oauth/authorize # consent page
POST https://algor.world/api/oauth/token # authorization_code (PKCE) | refresh_token
POST https://algor.world/api/oauth/revoke # RFC 7009| Scope | Grants |
|---|---|
| markets:read | Browse and search prediction markets, order books, price history and news. |
| sports:read | List leagues and fixtures and get Algor prices for matches. |
| agent:compose | Talk to the Algor agent (compose markets, briefs). Uses your daily message quota. |
| portfolio:read | Read open and settled positions, P&L and equity. |
| wallet:read | Read balance, exposure, deposit addresses and recent ledger activity. |
| bets:writemoney | Place bets from your USD balance, up to the daily stake cap you set. |
| plan:writemoney | Buy or renew Algor Max from your wallet balance. |
Every token with bets:write carries a daily stake cap in USD (default $100). Stakes are reserved against the cap before the ledger is debited and released if booking fails; hitting it returns CAP_EXCEEDED. Plan quotas for ask_algor are shared with the website and reported in X-Algor-Remaining headers. Tokens cannot mint other tokens.
Add to .cursor/mcp.json (project) or ~/.cursor/mcp.json (global) with an API key:
{
"mcpServers": {
"algor": {
"url": "https://algor.world/api/mcp",
"headers": { "Authorization": "Bearer algor_sk_..." }
}
}
}Or omit headers and Cursor will run the OAuth flow in your browser the first time it connects.
# API key
claude mcp add --transport http algor https://algor.world/api/mcp \
--header "Authorization: Bearer algor_sk_..."
# OAuth (browser consent on first use)
claude mcp add --transport http algor https://algor.world/api/mcpSettings → Connectors → Add custom connector. Enter https://algor.world/api/mcp and leave the client fields blank; Claude registers itself and opens the Algor consent page. Alternatively paste an API key as a static Authorization header where the connector UI allows it.
Enable Developer mode (Settings → Connectors → Advanced), then Create a connector with the MCP server URL https://algor.world/api/mcp and authentication set to OAuth. ChatGPT discovers our metadata, registers dynamically, and the user approves scopes on the consent page. Tools marked read-only run without confirmation; place_bet and buy_max prompt the user each time.
Clients that only speak stdio can bridge with mcp-remote:
{
"mcpServers": {
"algor": {
"command": "npx",
"args": ["-y", "mcp-remote", "https://algor.world/api/mcp",
"--header", "Authorization: Bearer algor_sk_..."]
}
}
}| Tool | Scope | Does |
|---|---|---|
| whoami | — | Who the token belongs to, its scopes and remaining daily cap. |
| get_plan | — | Current plan, quota and reset time. |
| search_markets | markets:read | Search prediction markets by text, category or tag. |
| get_market | markets:read | One market with outcomes and decimal odds. |
| get_market_book | markets:read | Order book / liquidity snapshot for a market. |
| get_market_history | markets:read | Price history for a market. |
| get_news | markets:read | Recent headlines linked to markets. |
| list_leagues | sports:read | Supported sports leagues. |
| list_fixtures | sports:read | Upcoming fixtures for a league or date. |
| price_fixture | sports:read | Algor's priced lines for a fixture. |
| ask_algor | agent:compose | Plain-English request → priced ticket (same engine as the site). |
| get_brief | agent:compose | Retrieve a brief the agent produced earlier. |
| get_portfolio | portfolio:read | Balance, open positions and P&L. |
| list_positions | portfolio:read | Positions, optionally filtered by status. |
| get_position | portfolio:read | One position by id. |
| get_wallet_summary | wallet:read | Balance, deposits, withdrawals (read only). |
| place_bet | bets:write | Book a ticket. Requires an idempotencyKey; counts against the daily stake cap. |
| buy_max | plan:write | Buy or renew Algor Max from balance. |
Resources: algor://docs/quickstart (this guide, condensed) and algor://market/{id}. Every tool returns both a text summary and structuredContent JSON; failures set isError with a stable code.
// place_bet arguments
{
"legs": [{ "marketId": "…", "event": "Arsenal vs Spurs", "outcome": "Arsenal", "decimalOdds": 2.1 }],
"stakeUsd": 10,
"idempotencyKey": "my-agent-run-42" // retries with the same key return the same position
}The JSON API the website uses accepts the same tokens. Scope rules are identical.
curl -s https://algor.world/api/auth/me \
-H "Authorization: Bearer algor_sk_..."
curl -s https://algor.world/api/compose \
-H "Authorization: Bearer algor_sk_..." -H "Content-Type: application/json" \
-d '{"text":"Arsenal to win this weekend, $10"}'
curl -s https://algor.world/api/bets \
-H "Authorization: Bearer algor_sk_..." -H "Content-Type: application/json" \
-d '{"legs":[{"marketId":"…","event":"…","outcome":"…","decimalOdds":2.1}],"stakeUsd":10,"idempotencyKey":"run-42"}'Read endpoints: /api/portfolio, /api/bets, /api/wallet/summary, /api/wallet/deposits, /api/plan. Write: POST /api/bets (bets:write), POST /api/plan (plan:write). Human-only endpoints return 403 HUMAN_ONLY for any token.
401 — missing or invalid token. MCP responses include a WWW-Authenticate header pointing at the protected-resource metadata.403 SCOPE_DENIED — token lacks the scope for this action.403 HUMAN_ONLY — action requires a browser session (withdrawals, wallet linking, profile).403 CAP_EXCEEDED — stake would exceed the token's daily cap; the response carries remainingUsd.402 INSUFFICIENT_FUNDS — balance too low; deposits are human-only, so surface depositUrl to the user.429 — plan quota reached; see retryAfterSec and upgradeUrl.Questions or a client that doesn't fit these recipes? hello@algor.bet