> ## Documentation Index
> Fetch the complete documentation index at: https://larkup.de/documentation/llms.txt
> Use this file to discover all available pages before exploring further.

# Agent Server API

> Launch a Larkup Agent Server, customize it, and connect through REST, the SDK, or Scalar.

<Badge color="blue">Developer</Badge>

## Launch locally

Open **Settings → Larkup Server**, switch the toggle to **Agent**, and select **Launch server**. Restart it after changing the Agent's prompt, skills, or tools so the generated runtime picks up the new configuration.

<Frame caption="Settings → Larkup Server showing the local endpoint and API key">
  <img src="https://mintcdn.com/larkup/13l_fOT1PJRw-f4o/documentation/images/deploy/server-on.png?fit=max&auto=format&n=13l_fOT1PJRw-f4o&q=85&s=bc7e37149d4b25e569f9202296d92404" alt="Larkup Server settings with a running server and API key" width="3012" height="1434" data-path="documentation/images/deploy/server-on.png" />
</Frame>

Copy the endpoint and **Server API key** from this page. Every request must include the key in the `Authorization` header.

## Customize the Agent

Open **Settings → Agent Customization**. It has five tabs that control what the Agent knows and can do.

<Tabs>
  <Tab title="Prompt">
    Write the system prompt the Agent follows. Larkup combines it with its own retrieval and tool safety rules.

    <Frame caption="Agent Customization: Prompt tab">
      <img src="https://mintcdn.com/larkup/13l_fOT1PJRw-f4o/documentation/images/customize-agent/customize-prompt.png?fit=max&auto=format&n=13l_fOT1PJRw-f4o&q=85&s=731928b3a7b4e3fc47af1cd50f8869f9" alt="System prompt editor" width="2982" height="1404" data-path="documentation/images/customize-agent/customize-prompt.png" />
    </Frame>
  </Tab>

  <Tab title="Tools">
    Turn built in tools on or off: semantic search, tabular data queries, chart generation, the Python sandbox, indexed data lookup, corpus analysis, and form filling.

    <Frame caption="Agent Customization: Tools tab">
      <img src="https://mintcdn.com/larkup/13l_fOT1PJRw-f4o/documentation/images/customize-agent/customize-tools.png?fit=max&auto=format&n=13l_fOT1PJRw-f4o&q=85&s=f3b1fb50093b5a8cc7c3129b8d806309" alt="Built in tools with enable toggles" width="2982" height="1216" data-path="documentation/images/customize-agent/customize-tools.png" />
    </Frame>
  </Tab>

  <Tab title="Skills">
    Add a Skill in the open `SKILL.md` format: metadata plus task instructions and optional resources. Upload a local file or add a remote one.

    <Frame caption="Agent Customization: Skills tab">
      <img src="https://mintcdn.com/larkup/13l_fOT1PJRw-f4o/documentation/images/customize-agent/customize-skills1.png?fit=max&auto=format&n=13l_fOT1PJRw-f4o&q=85&s=42697fe20f7250586eb24e2673711039" alt="Add an Agent skill dialog" width="2982" height="1282" data-path="documentation/images/customize-agent/customize-skills1.png" />
    </Frame>
  </Tab>

  <Tab title="MCP">
    Connect a remote [Model Context Protocol](https://modelcontextprotocol.io/) server. Add its URL, test it to discover its tools, then enable it. Its tools become available to this Agent, namespaced by connection so they never override a built in tool.

    <Frame caption="Agent Customization: MCP tab">
      <img src="https://mintcdn.com/larkup/13l_fOT1PJRw-f4o/documentation/images/customize-agent/customize-mcp.png?fit=max&auto=format&n=13l_fOT1PJRw-f4o&q=85&s=4355cfa39aaa3f76ad5ba154b0c9fb83" alt="MCP connections list" width="2982" height="1282" data-path="documentation/images/customize-agent/customize-mcp.png" />
    </Frame>
  </Tab>

  <Tab title="Sandbox">
    Give your Agent access to a computer, so it can run code instead of just describing it. Run it locally with Local Sandbox or Local Docker, or hand it to a remote provider such as E2B, Vercel Sandbox, Modal, Daytona, Fly.io Sprites, or Northflank. A remote sandbox is required for a serverless deployment that needs code execution.

    <Frame caption="Agent Customization: Sandbox tab">
      <img src="https://mintcdn.com/larkup/13l_fOT1PJRw-f4o/documentation/images/customize-agent/customize-sandbox1.png?fit=max&auto=format&n=13l_fOT1PJRw-f4o&q=85&s=ae82e2584ee357e46ec57df453451817" alt="Sandbox provider picker" width="2982" height="1384" data-path="documentation/images/customize-agent/customize-sandbox1.png" />
    </Frame>

    Select **Verify** after saving to confirm the chosen sandbox is reachable.
  </Tab>
</Tabs>

## Endpoints

Every generated server serves an interactive reference at `GET /reference` and a machine readable contract at `GET /openapi.json`.

<Frame caption="The interactive API reference for a running Larkup server">
  <img src="https://mintcdn.com/larkup/13l_fOT1PJRw-f4o/documentation/images/rag/scalar-api2.png?fit=max&auto=format&n=13l_fOT1PJRw-f4o&q=85&s=f1c624acbe60d505b5c02d3d14bf02a4" alt="Scalar API reference for the Larkup server" width="3012" height="1442" data-path="documentation/images/rag/scalar-api2.png" />
</Frame>

| Endpoint                           | Purpose                                                     |
| ---------------------------------- | ----------------------------------------------------------- |
| `GET /agent`                       | Read the Agent name, profile, and loaded tools.             |
| `GET /agent/tools`                 | List every loaded tool.                                     |
| `GET /agent/capabilities`          | List enabled skills, sandbox, MCP connections, and plugins. |
| `POST /chat` or `POST /agent/chat` | Stream a response using the AI SDK message protocol.        |
| `POST /v1/chat/completions`        | OpenAI compatible chat completions, streamed by default.    |
| `POST /query`                      | Retrieve the most relevant chunks for a query.              |

## Connect

<CodeGroup>
  ```bash cURL theme={null}
  curl -X POST http://localhost:8080/chat \
    -H "Authorization: Bearer your-api-key" \
    -H "Content-Type: application/json" \
    -d '{"messages": [{"role": "user", "content": "Summarize the Q3 report"}]}'
  ```

  ```typescript TypeScript SDK theme={null}
  import { LarkupAgentClient } from '@larkup/sdk';

  const agent = new LarkupAgentClient({ baseUrl: 'http://localhost:8080', apiKey: 'your-api-key' });
  console.log(await agent.chatText('What can you find in our knowledge base?'));
  ```

  ```python Python SDK theme={null}
  from larkup import LarkupAgentClient

  agent = LarkupAgentClient(base_url="http://localhost:8080", api_key="your-api-key")
  print(agent.chat_text("What can you find in our knowledge base?"))
  ```
</CodeGroup>

The full endpoint list is in the [API Reference](/documentation/documentation/api-reference/overview) tab. To connect from the Vercel AI SDK, see [Vercel AI SDK](/documentation/documentation/sdk/integrations/ai-sdk).

## Authentication

`/health`, `/readiness`, `/reference`, and `/openapi.json` stay public for operations and discovery. Every other Knowledge and Agent request needs `Authorization: Bearer <key>`.

## Deploy and connect remotely

Open **Settings → Larkup Server → Server** and select **Deploy** to choose a cloud provider. Larkup generates the runtime from the same Agent configuration used locally, including skills, MCP connections, and model settings. Use the same SDK client with the deployed URL. See [Deploy Your Server](/documentation/documentation/developer/deploy) for provider details.
