Skip to content

kaivyy/lettaproxy

Repository files navigation

Letta Proxy

OpenAI-compatible proxy for Letta Cloud agents.

Point any OpenAI-compatible client (OpenClaw, LangChain, OpenAI SDK, etc.) at this proxy and it will route requests to your Letta agents. Includes a web dashboard for testing.

Features

  • Drop-in OpenAI API/v1/models and /v1/chat/completions (streaming supported)
  • Full tool-calling — bidirectional tool call round-trips
  • Web dashboard — manage API keys, list agents, test chat in-browser
  • Two modes:
    • dashboard — full web UI + API (default)
    • light — API only, minimal dependencies
  • Docker supportdocker run ready

Quick Start

# 1. Clone
git clone https://github.com/kaivyy/lettaproxy.git
cd lettaproxy

# 2. Start (auto-installs dependencies)
./start.sh

# 3. Open dashboard and enter your Letta API key
#    http://localhost:1416

That's it. The dashboard will guide you through connecting your Letta account.

Alternative: Set key via environment variable

export LETTA_API_KEY="***"
./start.sh

Light mode (API only, no dashboard)

./start.sh light

Configuration

Variable Default Description
LETTA_API_KEY (empty) Letta Cloud API key. Get one at app.letta.com
LETTA_BASE_URL https://api.letta.com Letta API base URL (change for self-hosted)
PROXY_PORT 1416 Proxy listen port
PROXY_HOST 0.0.0.0 Proxy bind address

API Endpoints

OpenAI-Compatible

Method Path Description
GET /v1/models List Letta agents as OpenAI models
POST /v1/chat/completions Chat with a Letta agent (streaming supported)

Dashboard (dashboard mode only)

Method Path Description
GET / Web dashboard UI
GET /api/status Connection & agent status
POST /api/set-key Save Letta API key (validates before saving)
POST /api/chat Simple test chat

Both modes

Method Path Description
GET /health Health check

Tool Calling

The proxy supports full bidirectional tool calling:

  1. Client sends tools[] in OpenAI function-calling format
  2. Proxy forwards tools to the Letta agent
  3. Agent may call tools → proxy returns tool_calls with finish_reason: "tool_calls"
  4. Client executes tools and sends results back as tool role messages
  5. Agent produces final text response with finish_reason: "stop"

Using with OpenClaw

Add to your openclaw.json under models.providers:

{
  "letta": {
    "baseUrl": "http://127.0.0.1:1416/v1",
    "api": "openai-completions",
    "models": [
      {
        "id": "<agent-id>",
        "name": "My Letta Agent",
        "reasoning": false,
        "input": ["text"],
        "contextWindow": 128000,
        "maxTokens": 8192
      }
    ]
  }
}

Then add the model to your agent's allowlist and use /model letta/<agent-id> to switch.

Docker

docker build -t letta-proxy .
docker run -p 1416:1416 -e LETTA_API_KEY="***" letta-proxy

Self-Hosted Letta

If you're running Letta locally (not Letta Cloud), set the base URL:

export LETTA_BASE_URL=http://localhost:8283
./start.sh

Requirements

  • Python 3.9+
  • See requirements.txt for dependencies (auto-installed by start.sh)

License

MIT

About

OpenAI-compatible proxy for Letta Cloud agents - exposes Letta agents as standard OpenAI API endpoints with full tool-calling support and a web dashboard.

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors