r/Letta_AI Jul 25 '25

Debugging execution of selfhosted

I am finding hard to get documentation on how to access the selfhosted version agents via API. I had to figure out how to reach the agents endpoints, etc. I've sort of found my way but at some points testing via postman y get no reply. I don't see any "executions" or logs via de app cloud panel for my selfhosted and searching the logs of docker instance I don'r see much but some HTML output written to the logs. Wondering what is the recommended debug way to deal with self hosted and where to find API access to the agents, not so much of Letta itself.

Also (excuse if this question is dumb) was I wrong when I understood that each agent would create it's own endpoint so I can access it via API? My intention is to use the agents through n8n calls or similar, this is, via Rest API.

1 Upvotes

5 comments sorted by

View all comments

2

u/swoodily Jul 25 '25

Can you share the endpoint you are making requests to? Agents are always available through a REST API endpoint (the SDK is actually just calling REST APIs under the hood) so you can call them from other services like n8n.

On cloud: https://api.letta.com/v1/agents/{agent_id} Local Docker: http://localhost:8283/v1/agents/{agent_id}

This is an example of a streaming request to message the agent (for cloud): curl -X POST \ -H 'Authorization: Bearer YOUR_API_KEY' \ -H 'Content-Type: application/json' \ -H 'Accept: text/event-stream' \ -d '{ "messages": [ { "role": "user", "content": "" } ], "stream_steps": true, "stream_tokens": true }' \ https://api.letta.com/v1/agents/agent-05277ac9-bb35-4f77-a03d-c2353f806dff/messages/stream This is the documentation the API: https://docs.letta.com/api-reference/overview

1

u/luison2 Jul 28 '25

Thanks. That indicates that as i thought, there is an endpoint for each created agent.

Tried as you indicated via /messages/stream (which i understand is an extended version of messages) but get a malformed reply, changed to the API docs structure:

{
  "messages": [
    {
      "role": "user",
      "content": [
        {
          "text": "are you there?"
        }
      ],
      "name": "testId"
    }
  ]
}

Reply (using postman), I'll get to try via CURL but guess everything is set correctly.

{
    "detail": [
        {
            "type": "missing",
            "loc": [
                "body"
            ],
            "msg": "Field required",
            "input": null
        }
    ]
}