PHP SDK for Letta AI Agentic Framework.
A robust, well-documented PHP SDK for the Letta AI Agentic Framework. Easily interact with all Letta API endpoints from your PHP applications.
This SDK is not yet published to Packagist. To use it in your project:
1. Clone this repository (or download and extract it) into a directory, e.g., vendor/letta/letta-php-sdk
.
2. In your project's composer.json
, add a path repository:
json
{
"repositories": [
{
"type": "path",
"url": "vendor/letta/letta-php-sdk"
}
],
"require": {
"letta/letta-php-sdk": "*"
}
}
3. Run:
bash
composer update letta/letta-php-sdk
4. Copy .env.example
to .env
and fill in your Letta API credentials:
- LETTA_API_URL
(e.g., https://devletta.zero1.network:8283
)
- LETTA_API_TOKEN
(your API key)
- (Optional) LETTA_TEST_AGENT_ID
for example scripts
5. Load environment variables in your script (see examples below).
See the docs/examples/
directory for ready-to-run scripts. Each script loads credentials from your .env
file and demonstrates a specific SDK feature.
health_check.php
— Check API health statuslist_tags.php
— List all tags in the systemretrieve_agent.php
— Retrieve an agent by IDcreate_and_retrieve_source.php
— Create a source and fetch itcreate_retrieve_delete_block.php
— Full block lifecyclecreate_retrieve_update_delete_tool.php
— Full tool lifecyclelist_retrieve_delete_job.php
— List jobs, fetch and delete onelist_retrieve_delete_run.php
— List runs, fetch and delete oneupload_file_to_source.php
— Create a source, upload a file, poll job status, and delete the filesend_message_to_agent.php
— Send a message to an agent and print the response and conversation historyRun an example:
bash
php docs/examples/health_check.php
Contributions are welcome! Please see the project plan and ensure all new code is fully tested and documented.
CC-BY-SA