Nebula API Reference
Nebula provides a conversational interface to interact with blockchain data and services, and access to thirdweb tools.
- Base URL
- Authentication
- Sessions
- Context Filters
- Execute Configuration
- Response Handling
- API Endpoints
- Error Handling
All API requests should be made to:
All API endpoints require authentication using the thirdweb secret key. Include this key in your request headers:
Example curl with authentication:
Sessions maintain conversation threads with the AI and can be:
- Created explicitly via the
/session
endpoint - Created automatically when sending a message without a session_id
- Reused to maintain context across multiple messages
- Configured with specific execution parameters
Sessions persist your conversation history and custom configurations for blockchain data and thirdweb tools interactions.
Control what blockchain data informs AI responses through context filtering:
Benefits:
- Filter by blockchain networks using chain IDs
- Target specific contract addresses
- Target specific wallet addresses
- Control context scope for relevant responses
- Optimize token usage and response relevance
Configure transaction execution behavior using the execute config:
Parameters:
mode
: Execution mode (currently supports "client")signer_wallet_address
: Wallet address for transaction signing
When mode is "client", Nebula returns an unsigned transaction for local wallet signing.
Nebula API supports two types of response modes: streaming and non-streaming. The mode is controlled by the stream
parameter in your request.
When stream: false
, the API returns a single JSON response:
When stream: true
, the API uses Server-Sent Events (SSE) to stream the response. You'll need to handle the following event types:
init
: Initializes the stream and provides session informationpresence
: Provides backend status updates about worker processingaction
: Contains blockchain transaction or action datadelta
: Contains chunks of the response message texterror
: Contains error information if something goes wrong
Example SSE Stream:
JavaScript Example for Handling Streams: