This comprehensive guide covers all essential OKX API endpoints, updates, and error codes for seamless integration with OKX's trading platform. Whether you're a developer, trader, or business integrating with OKX, this documentation provides the technical details you need.
Key API Endpoints and Updates
Futures and Swap Trading Availability (June 2025)
- Available in specific countries/regions (compliance restrictions apply)
- Requires proper account verification before trading
New Withdrawal Endpoint (June 2025)
๐ Withdrawal API documentation
This new REST API endpoint allows programmatic withdrawal requests with enhanced security features.
Bill Details Endpoints (May 2025)
Two significant endpoints added for historical transaction tracking:
Apply Bills Details (Since 2021)
- Request generation of detailed transaction reports
- Supports filtering by date range, asset type, and transaction category
Get Bills Details (Since 2021)
- Retrieve previously generated reports
- Includes comprehensive transaction metadata
Sub-Account Management APIs (April 2025)
OKX has expanded its sub-account functionality with these powerful endpoints:
| Endpoint | Functionality |
|---|---|
| Create Sub-Account | Onboard new sub-accounts programmatically |
| Create API Key | Generate trading keys for sub-accounts |
| Query API Key | Audit existing sub-account permissions |
| Delete API Key | Revoke sub-account access instantly |
Important Implementation Notes:
- Sub-account creation currently requires web/app interface
- API supports subsequent management after initial creation
- All actions are permission-based and audited
Error Code Reference
When working with OKX APIs, you may encounter these specific error conditions:
| Code | Meaning | Resolution |
|---|---|---|
| 59515 | Custody whitelist restriction | Contact OKX support |
| 59516 | Missing Copper custody account | Create funding account first |
| 59517 | Missing Komainu custody account | Create funding account first |
| 59518 | Sub-account creation restriction | Use web/app interface |
| 59519 | Function frozen | Check {freezereason} details |
Announcement System APIs
Access platform notifications programmatically through these endpoints:
Get Announcements
- Retrieve active platform notices
- Filter by type, priority, or date range
Get Announcement Types
- List all notification categories
- Helps build targeted announcement feeds
FAQ Section
Q: Is futures trading available worldwide through the API?
A: No, futures and swap trading are subject to regional compliance restrictions. Always check local regulations.
Q: Can I create unlimited sub-accounts via API?
A: Sub-account creation currently requires web/app interface, but subsequent management is fully API-enabled.
Q: How far back can I retrieve transaction history?
A: The bills detail endpoints support data since 2021, with complete historical records available.
Q: What authentication methods do these APIs support?
A: All endpoints use OKX's standard API key authentication with request signing.
Q: Where can I find the most current API documentation?
๐ Latest OKX API references provide real-time updates.
Best Practices for API Integration
- Rate Limiting: Implement proper request throttling
- Error Handling: Plan for all documented error conditions
- Security: Rotate API keys regularly and use IP whitelisting
- Monitoring: Track both successful calls and errors
- Update Strategy: Subscribe to API change notifications
By following this guide and ๐ OKX's official documentation, you can build robust integrations with one of the leading cryptocurrency trading platforms.