Anthropic Messages adapter

If your code already speaks Anthropic Messages (or the Agent SDK), you can call Banana Peel without rewriting onto OpenAI Responses: point the SDK at POST /api/v1/messages and your messages run through the same browser-agent pipeline as Responses. It is a thin adapter — not a full Anthropic API clone, and not a provider wrapper like Browserbase/Steel.

Base URL & auth

  • Anthropic SDK baseURL: https://bananapeel.com/api (SDK appends /v1/messages)
  • Auth: x-api-key: bp_live_… or Authorization: Bearer bp_live_…
  • Model: banana-peel
  • anthropic-version header is accepted and ignored
import Anthropic from "@anthropic-ai/sdk";

const client = new Anthropic({
  apiKey: process.env.BANANA_PEEL_API_KEY, // bp_live_…
  baseURL: process.env.BANANA_PEEL_BASE + "/api",
  // → POST https://bananapeel.com/api/v1/messages
});

const msg = await client.messages.create({
  model: "banana-peel",
  max_tokens: 1024,
  messages: [
    {
      role: "user",
      content: "Extract the title from https://example.com",
    },
  ],
  // Banana Peel extras (SDK-dependent; often extra_body / metadata)
  // @ts-expect-error
  routing: "smart",
});

console.log(msg.content, msg.status, msg.response_id);

What is mapped

  • messages[] + optional system → Responses input
  • Banana Peel fields on the body: routing, url, background, credential_id, success_criteria
  • Output normalization (+$0.10 / run): normalize: true + output_schema (same as Responses). Schema builder: Console → Normalize. Docs: Create a response
  • Response: Anthropic-shaped type: "message" with content[{ type: text }], plus banana_peel, status, and response_id (resp_… for poll/input)
  • HITL: status: requires_action and a tool_use block named submit_input — answer via Responses POST /api/v1/responses/:response_id/input
# When status/stop_reason indicates HITL:
# msg.status === "requires_action"  OR  content has tool_use name submit_input
curl -s -X POST "$BANANA_PEEL_BASE/api/v1/responses/$RESPONSE_ID/input" \
  -H "Authorization: Bearer $BANANA_PEEL_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"code":"123456"}'
# RESPONSE_ID is msg.response_id (resp_…) — not the msg_ id

Keep it thin — intentional limits

  • No Computer Use / native Anthropic tool runtime on this path
  • No prompt caching, batches, or Files API
  • stream: true currently emits OpenAI Responses SSE (prefer background: true + poll for Agent SDK loops)
  • Prefer the first-class OpenAI Responses surface when you can

MCP for Claude Desktop / Cursor: /docs/mcp.

Command Palette

Search for a command to run...