API Usage
Nex-T1 provides a comprehensive REST API with WebSocket support for real-time operations. All endpoints are documented with OpenAPI/Swagger specifications and include SDKs for Python and TypeScript.
Quick Start
1
Get API Key
Register at app.nex-t1.ai to obtain your API key
2
Authenticate
Login to get a JWT access token for secure API access
3
Create Session
Create a chat session to maintain conversation context
4
Make Your First Call
Base URLs
- Production
- Development
Authentication
Authentication Flow
Nex-T1 uses a two-tier authentication system:- User Authentication: JWT tokens for user login
- Session Authentication: Session-scoped tokens for chat interactions
Step 1: Register (Optional)
Register a new user account:Step 2: Login
Authenticate with your credentials to get an access token:Step 3: Create Chat Session
Create a session to maintain conversation context:Use the session_token (not the access_token) for all chat and multi-agent endpoints. The session token binds messages to a specific conversation context.
Session Management
List User Sessions
List User Sessions
Update Session Name
Update Session Name
Delete Session
Delete Session
Core Endpoints
Chat API
The main conversational interface powered by LangGraph for natural language interactions.Non-Streaming Chat
Streaming Chat (Server-Sent Events)
Get real-time streaming responses for better user experience:Get Session Messages
Retrieve all messages in a session:Clear Chat History
Delete all messages in a session:Multi-Agent APIs
Nex-T1’s multi-agent system provides specialized capabilities for trading, research, risk analysis, and more.Intent Router & Preview
Routes user requests to appropriate specialized agents with intent detection and entity extraction.Preview Run (End-to-End)
Execute a complete preview flow including routing, quote generation, and risk assessment:Research Agent
Aggregate data from multiple sources for comprehensive DeFi analysis.Trading Agent
Handle quotes, execution, and trade optimization across multiple DEXs.Get Pseudo Quote (EVM)
Get a reference quote using Chainlink prices (non-executable):Execute EVM Trade
Execute a trade with confirmation and risk checks:Risk Agent
Evaluate and manage transaction risks before execution.Tool Integration APIs
Nex-T1 integrates with multiple MCP servers and external tools.DefiLlama Tools
List Available Tools
List Available Tools
Invoke Tool
Invoke Tool
Binance Tools
List Tools
List Tools
Subscribe to Real-time Data
Subscribe to Real-time Data
Unsubscribe
Unsubscribe
Bitcoin Tools
List Tools
List Tools
Get Latest Block
Get Latest Block
Decode Transaction
Decode Transaction
Validate Address
Validate Address
Chainlink Tools
Get real-time price feeds from Chainlink oracles:Exa MCP (Optional)
Exa MCP server must be configured in your environment. See EXA_MCP.md for setup instructions.
List Exa Tools
List Exa Tools
Invoke Exa Tool
Invoke Exa Tool
Refresh Exa Connection
Refresh Exa Connection
DexScreener Tools
List Tools
List Tools
Invoke Tool
Invoke Tool
Wallet Management
Get EVM Wallet Balance
Get EVM Wallet Balance
Metrics & Analytics APIs
Track volume, PnL, TVL, and position data.Volume Metrics
PnL Metrics
Realized PnL
Realized PnL
Unrealized PnL
Unrealized PnL
TVL Metrics
Agent TVL
Agent TVL
DefiLlama TVL
DefiLlama TVL
Position Management
List Positions
List Positions
Mark to Market
Mark to Market
Snapshot Wallet
Snapshot Wallet
Ingest Trade
Ingest Trade
Error Handling
Error Response Format
All API errors follow a consistent format:HTTP Status Codes
Error Handling Examples
Rate Limiting
Nex-T1 usesslowapi for rate limiting to ensure fair usage and system stability.
Rate Limit Behavior
- Rate limits are applied per endpoint
- Exceeded limits return HTTP 429 status
- Retry after the specified backoff period
Best Practices
Implement Exponential Backoff
Retry failed requests with increasing delays (1s, 2s, 4s, 8s…)
Cache Responses
Cache frequently accessed data like prices and TVL to reduce API calls
Use Streaming
Use streaming endpoints for chat to reduce multiple request overhead
Batch Operations
Combine multiple operations when possible (e.g., preview/run)
Retry Example
Health Check
Monitor API health and status:- API Health
- Root Health
MCP Server Integration
Nex-T1 exposes MCP (Model Context Protocol) endpoints for integration with MCP clients.SSE Endpoint
Messages Endpoint
API Limits and Quotas
Request Size Limits
- Maximum request body size: 10MB
- Maximum message content: 3,000 characters
- Maximum response size: 50MB
Timeout Limits
- Standard endpoints: 30 seconds
- Chat streaming: Connection timeout after 5 minutes of inactivity
- Research endpoints: 120 seconds
- Execution endpoints: 60 seconds
OpenAPI Documentation
Interactive API documentation is available through OpenAPI/Swagger:Swagger UI
Visit https://api.nex-t1.ai/docs for interactive API documentation
OpenAPI Spec
Download the spec: https://api.nex-t1.ai/openapi.json
Best Practices
Use Session Tokens
Always use session tokens (not access tokens) for chat and multi-agent endpoints to maintain context
Validate Input
Validate all input parameters client-side before making API calls
Handle Errors Gracefully
Implement proper error handling with user-friendly messages
Test in Sandbox
Use development environment for testing before production deployment
Monitor Token Expiry
Track token expiration times and refresh before expiry
Secure Credentials
Never expose API keys or tokens in client-side code or version control
Code Examples Repository
For complete working examples, visit our GitHub repository:Nex-T1 API Examples
Browse full integration examples in Python, TypeScript, Go, and more
Support
API Status
Check status.nex-t1.ai for current API status and incidents
Developer Discord
Join our Discord for real-time support and community discussions
GitHub Issues
Report bugs and request features on GitHub