Metadata-Version: 2.1
Name: alter-sdk
Version: 0.13.0
Summary: Alter Vault Python SDK - OAuth token management with policy enforcement
Home-page: https://alterauth.com
Keywords: oauth,tokens,security,policy,vault
Author: Alter Team
Author-email: founders@alterauth.com
Requires-Python: >=3.11,<4.0
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Provides-Extra: aws
Provides-Extra: fastapi
Provides-Extra: langchain
Provides-Extra: mcp
Requires-Dist: boto3 (>=1.28.0,<2.0.0) ; extra == "aws"
Requires-Dist: fastapi (>=0.100.0) ; extra == "fastapi"
Requires-Dist: fastmcp (>=2.14) ; extra == "mcp"
Requires-Dist: httpx[http2] (>=0.25.0,<1.0)
Requires-Dist: langchain-core (>=0.3.85,<2.0.0,!=1.0.*,!=1.1.*,!=1.2.*,!=1.3.0,!=1.3.1,!=1.3.2) ; extra == "langchain"
Requires-Dist: pydantic (>=2.5.0,<3.0.0)
Description-Content-Type: text/markdown

# Alter SDK for Python

Official Python SDK for [Alter Vault](https://alterauth.com) — credential and authorization layer for apps and AI agents that call third-party APIs.

Tokens stay in the vault. The SDK injects the credential, refreshes it, and writes the audit row — application code only calls `vault.request()`.

## Install

```bash
pip install alter-sdk
```

Requires Python 3.10+.

## Quick example

Make an authenticated API call — no token ever touches application code.

```python
import asyncio
from alter_sdk import App, HttpMethod

async def main():
    async with App(api_key="<api-key>") as vault:
        response = await vault.request(
            HttpMethod.POST,
            "https://api.example.com/resource",
            grant_id="<grant-id>",
            json={"example": "payload"},
        )
        print(response.status_code, response.json())

asyncio.run(main())
```

For a full walkthrough — sign-up, key minting, OAuth — see the [First 5 Minutes guide](https://docs.alterauth.com/first-5-minutes).

## Documentation

Full docs are at **https://docs.alterauth.com**.

| Topic | Page |
|---|---|
| Getting started end-to-end | [First 5 Minutes](https://docs.alterauth.com/first-5-minutes) |
| Concepts (principals, grants, identity resolution) | [Concepts](https://docs.alterauth.com/concepts/what-is-alter-vault) |
| OAuth flows (JWT, grant_id, headless) | [OAuth](https://docs.alterauth.com/oauth/overview) |
| Identity Provider setup | [Identity Providers](https://docs.alterauth.com/oauth/identity-providers/overview) |
| Managed secrets | [Managed Secrets](https://docs.alterauth.com/managed-secrets/overview) |
| Agents and workload identity | [Agents](https://docs.alterauth.com/agents/overview) |
| Per-method API reference | [SDK reference](https://docs.alterauth.com/sdks/python/reference/client) |
| Framework integrations | [FastAPI](https://docs.alterauth.com/sdks/python/fastapi) · [MCP](https://docs.alterauth.com/sdks/python/mcp) · [LangChain](https://docs.alterauth.com/sdks/python/langchain) |

## License

MIT. See `LICENSE`.

## Support

Email **founders@alterauth.com** or open an issue at https://github.com/alter-ai/alter-vault.

