fink.

Documentation Menu

Developer API Reference

Automate, extend, and integrate fink. with your local development environment using our WebSockets API.

The Local Bridge

Because fink. is built for developers, we expose a local WebSocket server on port 1984 that allows you to programmatically control the browser. You can script tab management, inject CSS, or even query the local LLM directly from your terminal.

Authentication

By default, the API requires a Bearer token which is dynamically generated upon browser startup. You can find this token in `~/.fink/session.key`.

Do not share this key. Any script with access to this key has full control over your active browser session.

Example: Spawning a Tab via cURL

You can interact with the API using simple HTTP requests. Here is an example of how to open a new tab silently in the background:

bash
curl -X POST http://localhost:1984/v1/tabs \
  -H "Authorization: Bearer $(cat ~/.fink/session.key)" \
  -d '{"url": "https://github.com", "background": true}'

Example: Querying the Local LLM

You can also pass prompts directly to the on-device AI without opening the UI:

javascript
const response = await fetch("http://localhost:1984/v1/ai/complete", {
  method: "POST",
  headers: { "Authorization": `Bearer ${API_KEY}` },
  body: JSON.stringify({
    prompt: "Summarize the active tab.",
    max_tokens: 150
  })
});

const data = await response.json();
console.log(data.summary);