# Simulation Environment API
FastAPI-based API service for managing simulation environments for RL agent training. Currently supports Salesforce scratch orgs with browser automation via Browserbase.
**Production API**: `https://api.abundant.systems/`
## Overview
This API provides:
- Isolated browser instances of simulated websites
- Direct CDP access for agent control
- Clean separation between simulated environment and test harness controls
- Realistic environment URLs
## V1 API Endpoints
### Environment Discovery
- `GET /v1/environments` - List available simulation environments
### Instance Lifecycle
- `POST /v1/instances` - Create new environment instance
- `GET /v1/instances/{id}` - Get instance details with CDP URL
- `DELETE /v1/instances/{id}` - Terminate instance
### Control Operations
- `POST /v1/instances/{id}/reset` - Reset instance to clean state
- `POST /v1/instances/{id}/verify` - Run verification function
- `GET /v1/instances/{id}/state` - Get current state
## TODO
### High Priority
- [ ] Implement Salesforce-specific verification functions
### Medium Priority
- [ ] Update authentication to support Bearer token format
- [ ] Create Python client SDK
### Low Priority
- [ ] Remove or deprecate old /salesforce endpoints
- [ ] Add WebSocket support for real-time state updates
- [ ] Multi-region support
## Installation
```bash
uv sync
```
This will install all dependencies including the Foundry SDK from Test PyPI.
## Usage
1. Set up environment variables in .env:
```
API_SECRET_KEY=your_secret_key
FOUNDRY_API_KEY=your_foundry_api_key
BROWSERBASE_API_KEY=your_browserbase_api_key
BROWSERBASE_PROJECT_ID=your_browserbase_project_id
```
2. Run the server:
```bash
uv run simulation-env-api
```
Customize server settings in src/simulation_env_api/uvicorn_config.py if needed.
3. Access docs at http://localhost:8000/docs
## Example Usage
### List available environments
```bash
curl -X GET "http://localhost:8000/v1/environments"
```
### Create an instance
```bash
curl -X POST "http://localhost:8000/v1/instances" \
-H "x-api-key: your_secret_key" \
-H "Content-Type: application/json" \
-d '{"environment": "salesforce_sales"}'
```
### Get instance details (includes CDP URL)
```bash
curl -X GET "http://localhost:8000/v1/instances/{instance_id}" \
-H "x-api-key: your_secret_key"
```
### Reset instance
```bash
curl -X POST "http://localhost:8000/v1/instances/{instance_id}/reset" \
-H "x-api-key: your_secret_key"
```
## Python SDK
A Python SDK is included for easier integration:
```python
import asyncio
from abundant_sdk import Client
async def main():
async with Client(api_key="your_secret_key") as client:
# Create and use an instance
instance = await client.create_instance("salesforce_sales")
print(f"CDP URL: {instance.cdp_url}")
# Verify task completion
result = await instance.verify("opportunity_created")
# Clean up
await instance.terminate()
asyncio.run(main())
```
See `examples/` directory for more detailed examples.
Raw data
{
"_id": null,
"home_page": null,
"name": "abundant-sdk",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.8",
"maintainer_email": null,
"keywords": "api, automation, reinforcement-learning, salesforce, simulation",
"author": null,
"author_email": "Meji Abidoye <pfbyjy@gmail.com>",
"download_url": "https://files.pythonhosted.org/packages/ba/52/3975b58b80e2ac044482d446cf6bf89b1247f814dc1e054d425da8b4143b/abundant_sdk-0.2.4.tar.gz",
"platform": null,
"description": "# Simulation Environment API\n\nFastAPI-based API service for managing simulation environments for RL agent training. Currently supports Salesforce scratch orgs with browser automation via Browserbase.\n\n**Production API**: `https://api.abundant.systems/`\n\n## Overview\n\nThis API provides:\n- Isolated browser instances of simulated websites\n- Direct CDP access for agent control\n- Clean separation between simulated environment and test harness controls\n- Realistic environment URLs\n\n## V1 API Endpoints\n\n### Environment Discovery\n- `GET /v1/environments` - List available simulation environments\n\n### Instance Lifecycle\n- `POST /v1/instances` - Create new environment instance\n- `GET /v1/instances/{id}` - Get instance details with CDP URL\n- `DELETE /v1/instances/{id}` - Terminate instance\n\n### Control Operations\n- `POST /v1/instances/{id}/reset` - Reset instance to clean state\n- `POST /v1/instances/{id}/verify` - Run verification function\n- `GET /v1/instances/{id}/state` - Get current state\n\n## TODO\n\n### High Priority\n- [ ] Implement Salesforce-specific verification functions\n\n### Medium Priority\n- [ ] Update authentication to support Bearer token format\n- [ ] Create Python client SDK\n\n### Low Priority\n- [ ] Remove or deprecate old /salesforce endpoints\n- [ ] Add WebSocket support for real-time state updates\n- [ ] Multi-region support\n\n## Installation\n\n```bash\nuv sync\n```\n\nThis will install all dependencies including the Foundry SDK from Test PyPI.\n\n## Usage\n\n1. Set up environment variables in .env:\n ```\n API_SECRET_KEY=your_secret_key\n FOUNDRY_API_KEY=your_foundry_api_key\n BROWSERBASE_API_KEY=your_browserbase_api_key\n BROWSERBASE_PROJECT_ID=your_browserbase_project_id\n ```\n\n2. Run the server:\n ```bash\n uv run simulation-env-api\n ```\n Customize server settings in src/simulation_env_api/uvicorn_config.py if needed.\n\n3. Access docs at http://localhost:8000/docs\n\n## Example Usage\n\n### List available environments\n```bash\ncurl -X GET \"http://localhost:8000/v1/environments\"\n```\n\n### Create an instance\n```bash\ncurl -X POST \"http://localhost:8000/v1/instances\" \\\n -H \"x-api-key: your_secret_key\" \\\n -H \"Content-Type: application/json\" \\\n -d '{\"environment\": \"salesforce_sales\"}'\n```\n\n### Get instance details (includes CDP URL)\n```bash\ncurl -X GET \"http://localhost:8000/v1/instances/{instance_id}\" \\\n -H \"x-api-key: your_secret_key\"\n```\n\n### Reset instance\n```bash\ncurl -X POST \"http://localhost:8000/v1/instances/{instance_id}/reset\" \\\n -H \"x-api-key: your_secret_key\"\n```\n\n## Python SDK\n\nA Python SDK is included for easier integration:\n\n```python\nimport asyncio\nfrom abundant_sdk import Client\n\nasync def main():\n async with Client(api_key=\"your_secret_key\") as client:\n # Create and use an instance\n instance = await client.create_instance(\"salesforce_sales\")\n print(f\"CDP URL: {instance.cdp_url}\")\n\n # Verify task completion\n result = await instance.verify(\"opportunity_created\")\n\n # Clean up\n await instance.terminate()\n\nasyncio.run(main())\n```\n\nSee `examples/` directory for more detailed examples.\n",
"bugtrack_url": null,
"license": "Apache-2.0",
"summary": "Python SDK for the Abundant Environment API - simulation environments for RL agent training",
"version": "0.2.4",
"project_urls": {
"Documentation": "https://github.com/your-org/simulation-env-api/tree/main/docs",
"Homepage": "https://github.com/your-org/simulation-env-api",
"Issues": "https://github.com/your-org/simulation-env-api/issues",
"Repository": "https://github.com/your-org/simulation-env-api"
},
"split_keywords": [
"api",
" automation",
" reinforcement-learning",
" salesforce",
" simulation"
],
"urls": [
{
"comment_text": null,
"digests": {
"blake2b_256": "13b852ee8f8def4921f5c6bd6e7f6b4fe6c30e44e2ab995adc0ff383f07ba00e",
"md5": "8073dc5bb7d69a365e942606e7e94884",
"sha256": "9207e70446fc066b5418dda864a84badafe663fc294403e17111ab698969240a"
},
"downloads": -1,
"filename": "abundant_sdk-0.2.4-py3-none-any.whl",
"has_sig": false,
"md5_digest": "8073dc5bb7d69a365e942606e7e94884",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.8",
"size": 14204,
"upload_time": "2025-08-07T18:52:17",
"upload_time_iso_8601": "2025-08-07T18:52:17.685325Z",
"url": "https://files.pythonhosted.org/packages/13/b8/52ee8f8def4921f5c6bd6e7f6b4fe6c30e44e2ab995adc0ff383f07ba00e/abundant_sdk-0.2.4-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": null,
"digests": {
"blake2b_256": "ba523975b58b80e2ac044482d446cf6bf89b1247f814dc1e054d425da8b4143b",
"md5": "8216cab6b1f5d3da55a33348f7b1f70d",
"sha256": "ce48823a4004037e9c351305507526b7d881da10359d211e6db772f737269271"
},
"downloads": -1,
"filename": "abundant_sdk-0.2.4.tar.gz",
"has_sig": false,
"md5_digest": "8216cab6b1f5d3da55a33348f7b1f70d",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.8",
"size": 12190,
"upload_time": "2025-08-07T18:52:18",
"upload_time_iso_8601": "2025-08-07T18:52:18.960074Z",
"url": "https://files.pythonhosted.org/packages/ba/52/3975b58b80e2ac044482d446cf6bf89b1247f814dc1e054d425da8b4143b/abundant_sdk-0.2.4.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2025-08-07 18:52:18",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "your-org",
"github_project": "simulation-env-api",
"github_not_found": true,
"lcname": "abundant-sdk"
}