OP Inference
API reference

MCP endpoint

POST
/v1/mcp

A Model Context Protocol server that offers your key's tasks and your tenant's presets as tools. Stateless: one JSON-RPC 2.0 request or notification per POST, answered as application/json, with no session. Supports protocol versions 2026-07-28, 2025-11-25 and 2025-06-18. A request that carries an Origin header is refused with 403. A tool call is served by the task or chat route and billed as that route is. Only served where the MCP flag is on.

Authorization

bearerAuth
headerAuthorizationBearer <token>

Your API key, sent as Authorization: Bearer <key>.

Request Body

One JSON-RPC 2.0 request or notification. A batch is refused.

application/json
  1. body
jsonrpc*string
id?string|integer
method*string
params?

Response Body

A JSON-RPC response, carrying a result or an error.

application/json
  1. response
curl -X POST "https://example.com/v1/mcp" \  -H "Authorization: Bearer $OP_API_KEY" \  -H "Content-Type: application/json" \  -d '{    "jsonrpc": "2.0",    "id": 1,    "method": "tools/call",    "params": {      "name": "task.sentiment",      "arguments": {        "text": "The battery lasts all day, but the screen scratches easily."      }    }  }'
{}