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 instanceGET /v1/instances/{id}- Get instance details with CDP URLDELETE /v1/instances/{id}- Terminate instance
Control Operations
POST /v1/instances/{id}/reset- Reset instance to clean statePOST /v1/instances/{id}/verify- Run verification functionGET /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
uv sync
This will install all dependencies including the Foundry SDK from Test PyPI.
Usage
-
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 -
Run the server:
uv run simulation-env-api
Customize server settings in src/simulation_env_api/uvicorn_config.py if needed.
-
Access docs at http://localhost:8000/docs
Example Usage
List available environments
curl -X GET "http://localhost:8000/v1/environments"
Create an instance
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)
curl -X GET "http://localhost:8000/v1/instances/{instance_id}" \
-H "x-api-key: your_secret_key"
Reset instance
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:
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.
Metadata
Release files for abundant-sdk 0.2.4
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| abundant_sdk-0.2.4.tar.gz | 12.2 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| abundant_sdk-0.2.4-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 26.4 kB
Release files / abundant_sdk-0.2.4.tar.gz
| Download URL | abundant_sdk-0.2.4.tar.gz |
|---|---|
| Size | 12.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
ce48823a4004037e9c351305507526b7d881da10359d211e6db772f737269271
|
|
BLAKE2b-256 checksum How to use checksums |
ba523975b58b80e2ac044482d446cf6bf89b1247f814dc1e054d425da8b4143b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.11.8
|
Release files / abundant_sdk-0.2.4-py3-none-any.whl
| Download URL | abundant_sdk-0.2.4-py3-none-any.whl |
|---|---|
| Size | 14.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
9207e70446fc066b5418dda864a84badafe663fc294403e17111ab698969240a
|
|
BLAKE2b-256 checksum How to use checksums |
13b852ee8f8def4921f5c6bd6e7f6b4fe6c30e44e2ab995adc0ff383f07ba00e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.11.8
|
Security for abundant-sdk 0.2.4
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.