API Operator
Standalone AI operator runtime with pluggable adapters. Talk to your HTTP APIs instead of clicking through admin panels.
Works with Laravel, Go, connectivity platforms, or any backend with a REST API.
Install
git clone https://github.com/mohammedelkarsh/api-operator.git
cd api-operator
pip install -e ".[dev]"
Optional OpenAI planner:
pip install -e ".[dev,llm]"
Quick start
api-operator demo
api-operator tools --adapter mock
What ships in the core package
| In core | In your projects |
|---|---|
| Agent runtime (plan, guard, execute) | adapter.yaml per API |
mock adapter (demo + tests) |
OpenAPI specs |
yaml adapter |
API tokens in .env |
| CLI + HTTP server | Optional custom adapters |
Build an adapter without Python
Scaffold template
api-operator scaffold-adapter my-api --output examples
Generate from OpenAPI
api-operator generate-from-openapi openapi.yaml \
--output adapter.yaml \
--base-url http://api.example.test \
--path-prefix /api
Laravel Tenant Kit example
See examples/tenant-kit-adapter/ — pairs with laravel-tenant-kit.
export TENANT_KIT_API_TOKEN="your-sanctum-token"
api-operator chat \
--adapter yaml \
--config examples/tenant-kit-adapter/adapter.yaml \
--base-url http://laravel-tenant-kit.test
adapter.yaml (minimal)
name: my_project
description: My API adapter
base_url: http://api.example.test
auth:
type: bearer
env_token: MY_PROJECT_API_TOKEN
tools:
- name: list_items
description: List items
method: GET
path: /api/items
- name: create_item
description: Create item
method: POST
path: /api/items
dangerous: true
parameters:
title:
type: string
required: true
body:
title: "{title}"
Tenant subdomain APIs:
- name: invite_member
method: POST
path: /api/team/invitations
host: tenant
tenant_param: subdomain
parameters:
subdomain: { type: string, required: true }
email: { type: string, required: true }
HTTP server
api-operator serve --port 8100
POST /v1/chat
{
"adapter": "yaml",
"config_path": "examples/tenant-kit-adapter/adapter.yaml",
"adapter_config": { "token": "YOUR_TOKEN" },
"message": "list workspaces",
"abilities": ["workspaces:read"]
}
Integration test (Tenant Kit)
With Tenant Kit running:
python scripts/integration_tenant_kit.py
# Docker on port 8080:
python scripts/integration_tenant_kit.py --base-url http://laravel-tenant-kit.test:8080
Optional pytest marker (requires env vars):
export TENANT_KIT_BASE_URL=http://laravel-tenant-kit.test
export TENANT_KIT_API_TOKEN=your-token
pytest -m integration -q
Tests
pytest -q
Configuration
Copy .env.example to .env for local defaults (api_operator_PLANNER, port, etc.).
Architecture
api-operator (core) your projects
├── agent runtime ├── adapter.yaml
├── mock + yaml adapters ├── openapi.yaml
└── scaffold / generate CLI └── HTTP APIs (Laravel, Go, …)
License
MIT — see LICENSE.
Metadata
Release files for api-operator 0.10.0
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 | |
|---|---|---|---|---|
| api_operator-0.10.0.tar.gz | 32.8 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| api_operator-0.10.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 63.1 kB
Release files / api_operator-0.10.0.tar.gz
| Download URL | api_operator-0.10.0.tar.gz |
|---|---|
| Size | 32.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
5bf96a7dcfae875e33902c78c124a10a49c77d1d1534d956c380bd1d95a40f0c
|
|
BLAKE2b-256 checksum How to use checksums |
bdf387c9db817e60d846ae69773c2ee038ae1fd8e995f090b9dede730ae7fee0
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.14.0
|
Release files / api_operator-0.10.0-py3-none-any.whl
| Download URL | api_operator-0.10.0-py3-none-any.whl |
|---|---|
| Size | 30.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
f1633f858e9ba1e1f34cd0093ae5974e6e98c591ecb80d5d891b0d4542731e17
|
|
BLAKE2b-256 checksum How to use checksums |
20f9540628842fbaf413a90b00d61a8c86dbab462c0efee7a0403f1e0344d2bd
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.14.0
|
Security for api-operator 0.10.0
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.