Skip to main content

apex-ai-sdk

A Python client for the Apex AI Platform HTTP API, hand-written from the actual apex-server routes (see docs/09-api/openapi.yaml for the full contract) — the same source sdks/typescript was generated from, so the two clients cover identical ground.

Zero runtime dependencies: the HTTP layer is built on urllib from the standard library rather than requests/httpx, so there's nothing to install to use it.

Install

Not yet published; consume from the repo directly (path dependency, or copy apex_sdk/ into your project) until it ships to PyPI.

Usage

from apex_sdk import ApexClient

client = ApexClient(
    "http://127.0.0.1:8080",
    tenant="acme",       # optional, defaults to the server's "default" tenant
    principal="alice",   # optional
)

result = client.agents.run({"manifest": my_agent_yaml, "input": {"message": "Hi"}})
print(result["output"]["message"])

# Streaming:
for frame in client.agents.stream({"manifest": my_agent_yaml, "input": {}}):
    if frame["type"] == "delta":
        print(frame["text"], end="")
    if frame["type"] == "result":
        print("\ndone:", frame["output"]["message"])

Every resource is namespaced on the client: client.agents, client.workflows, client.memory, client.plugins, client.marketplace, client.secrets, client.organizations, client.projects, client.webhooks, client.audit, client.tools.

Errors are raised as ApexApiError (.status, .code, .request_id, .body) mapping the server's {error: {...}} envelope.

Pagination: every list method returns a Page dict (data/has_more/ next_cursor/total_estimate); paginate_all drains every page:

from apex_sdk import paginate_all

for agent_id in paginate_all(client.agents.list, limit=25):
    ...

Development

No package manager is required to run this SDK — it's stdlib-only. To run the tests:

cargo run -p apex-cli -- dev --addr 127.0.0.1:8080 &
python3 -m unittest discover -s tests -v

Tests are integration tests against a real, locally running server (skip cleanly, not failing, if APEX_TEST_BASE_URL — default http://127.0.0.1:8080 — is unreachable), plus a handful of unit tests for the retry/backoff logic against a fake opener (no socket).

One test (test_projects_create_with_stale_if_match_is_rejected) exercises organization/project creation, which — unlike agents/workflows/memory — has no anonymous-default-tenant back-compat bypass; it needs a real org.admin role. Start the server with APEX_PLATFORM_ADMINS=sdk-test-admin for that test to run instead of skip.

Known gaps (v0.1 of this SDK)

  • Synchronous only — no asyncio client.
  • No redocly-style contract test wired against openapi.yaml (the TypeScript SDK's npm test runs one; this package has no npm-equivalent tool available in this environment to wire the same check to).
  • Not published to PyPI yet.

Metadata

Release files for apex-ai-sdk 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for apex-ai-sdk 0.1.0
File Size Uploaded Provenance Actions
apex_ai_sdk-0.1.0.tar.gz 13.7 kB Without provenance Details for apex_ai_sdk-0.1.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for apex-ai-sdk 0.1.0
File Interpreter ABI Platform Actions
apex_ai_sdk-0.1.0-py3-none-any.whl Python 3 none any Details for apex_ai_sdk-0.1.0-py3-none-any.whl

Total release size: 27.0 kB

Release files / apex_ai_sdk-0.1.0.tar.gz

Download URL apex_ai_sdk-0.1.0.tar.gz
Size 13.7 kB
Tags Source
SHA-256 checksum
How to use checksums
32d14cd153582e3baf0618e1275a198a4031bd4a056e94d3ad16ddd934337705
BLAKE2b-256 checksum
How to use checksums
93dea5be792838541005826d8907bb51e0c50868957fce351b1eed6c802ba9af
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.14.4

Release files / apex_ai_sdk-0.1.0-py3-none-any.whl

Download URL apex_ai_sdk-0.1.0-py3-none-any.whl
Size 13.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
795af6d26c4476bb82355b68ebc0530a3de2ede87d6821378f44824a67e22c90
BLAKE2b-256 checksum
How to use checksums
4cb7f2b6186b1082ed7d93e1ceab5efa2347db6939b604bf80dc027b7d59ddd5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.14.4

Security for apex-ai-sdk 0.1.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.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page