The Reliability Layer for Production AI Agents
Project description
StateBase SDKs
This repository contains the official SDKs for StateBase API.
📦 Python SDK
Installation
cd state-base-api-client
pip install -e .
Usage
from state_base_api_client import Client
from state_base_api_client.api.sessions import create_session_v1_sessions_post
from state_base_api_client.models import SessionCreateRequest
# Initialize client
client = Client(base_url="https://api.statebase.org")
client = client.with_headers({"X-API-Key": "your-api-key"})
# Create a session
request = SessionCreateRequest(
agent_id="my-agent",
initial_state={"user_name": "Alice"}
)
session = create_session_v1_sessions_post.sync(client=client, body=request)
print(f"Created session: {session.id}")
Features:
- ✅ Auto-generated from OpenAPI spec (always in sync)
- ✅ Full type hints with Pydantic
- ✅ Sync and async support
- ✅ Complete API coverage
📦 TypeScript SDK
Installation
cd ../statebase-ts-sdk
npm install
npm run build
Usage
import StateBase from './src/index';
// Initialize client
const client = new StateBase('your-api-key', 'http://api.statebase.org');
// Create a session
const session = await client.createSession({
agent_id: 'my-agent',
initial_state: { user_name: 'Alice' }
});
console.log(`Created session: ${session.id}`);
Features:
- ✅ Auto-generated TypeScript types from OpenAPI
- ✅ Clean, intuitive API
- ✅ Full type safety
- ✅ Promise-based async
🔄 Regenerating SDKs
When the API changes, regenerate the SDKs:
TypeScript Types
cd statebase-ts-sdk
npx openapi-typescript ../statebase/openapi.json -o src/schema.ts
Python Client
cd statebase-py-sdk
python -m openapi_python_client generate --path ../statebase/openapi.json
📚 Documentation
- API Docs: http://api.statebase.org/docs
- Full Documentation: https://docs.statebase.org
License
MIT
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
statebase-0.1.0.tar.gz
(5.3 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file statebase-0.1.0.tar.gz.
File metadata
- Download URL: statebase-0.1.0.tar.gz
- Upload date:
- Size: 5.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
37ed25cf907453954012e7ca356163b8bcb1ca07ade622ee20e29132e449e5fd
|
|
| MD5 |
7a4353cb9f4e406ae003d3036aa6f444
|
|
| BLAKE2b-256 |
94c346b9c5eaaf29a19ea811ca710de35239b2df7fc028e21b36bf751621f112
|
File details
Details for the file statebase-0.1.0-py3-none-any.whl.
File metadata
- Download URL: statebase-0.1.0-py3-none-any.whl
- Upload date:
- Size: 6.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
45ea92cec52b5e85f697ee73398b75ec800c18b028d11d06d29705f0671fccb1
|
|
| MD5 |
898332caf4e4c9f699fdf07619e31d95
|
|
| BLAKE2b-256 |
af6712d6a19d983c55333b5163314b609fda97e4ef0b4ceafb8fd6ce5efd276f
|