Skip to main content
Install, initialize, and use the aion-sdk Python package. The aion-sdk package wraps the REST API with an authenticated client for agent management, market discovery, wallet credential setup, trading, order management, and redemption. All SDK methods map closely to REST endpoints in the API Reference. SDK source code:
  • https://github.com/aionmarket/aion-sdk
The current SDK focuses on:
  • Agent registration and authentication
  • Market search, briefing, and context lookup
  • Wallet credential registration and validation
  • Trading, order inspection, cancellation, and redemption
The SDK requires your API key and automatically sends Authorization: Bearer YOUR_API_KEY on every authenticated request. If api_key is missing or invalid, requests fail with 401.

Installation

Install from PyPI:
Install from source:

Initialization

Use environment variables (recommended):
Initialize from environment:
Pass API key directly:
Pass API key plus explicit base URL:

Quick example

Find markets, check context, and prepare trade execution:
For full order execution flow, see /essentials/trading-guide.

Data classes

The SDK currently returns Python dictionaries/lists with type hints (not runtime dataclass objects).

Market

Typical market fields:

Trade Result

Typical trade response fields:

Position

Position fields from GET /markets/current-positions depend on backend response shape. Typical fields include market ID, side/outcome, size, pricing, and PnL-related values.

Environment Variables

Supported Methods

Agent Management

  • register_agent()
  • claim_preview()
  • get_me()
  • get_settings()
  • update_settings()
  • get_skills()

Market Operations

  • get_markets()
  • get_market()
  • check_market_exists()
  • get_prices_history()
  • get_briefing()
  • get_market_context()

Wallet Management

  • check_wallet_credentials()
  • register_wallet_credentials()

Trading Operations

  • trade()
  • get_open_orders()
  • get_order_history()
  • get_order_detail()
  • cancel_order()
  • cancel_all_orders()
  • redeem()

Error Handling

Common failure patterns:
  • 401: invalid/missing API key (Authorization header issue)
  • 400: payload or parameter mismatch
  • 429: rate limit
  • 500: server-side error

Next Steps

  • Read /essentials/trading-guide for the full end-to-end flow.
  • Read /essentials/wallet-setup before live order submission.
  • Read /api-reference/introduction for API-wide behavior.