Build a dagent as a service with EternalAI API
In this post, we describe how to use EternalAI API to create an dagent as a service with EternalAI platform by implementing the following features.
Feature 1: Create an dagent
Call the api to create an dagent in EternalAI platform
Feature 2: Activate a dagent
To top up EAI for the newly created dagent, call the get deposit address api.
Your user need to send at least 1 EAI on Ethereum network to the address (eth_address
in the api response) to activate the dagent
To check dagent status, call get dagent info api.
"wallet_balance" = "1"
in the response means that a dagent is activated successfully.
Feature 3: Link dagent to a Twitter account
To let your user connect their Twitter account to a dagent, follow the documentation (see section OAuth 2.0 User Context
)
Important note: when implementing Twitter OAuth 2, you need to construct the redirect_uri
pointing to the following api:
where:
address
: the creator address that can get from response of "Create an dagent" api above.agent_id
: dagent id.client_id
: you have to enable OAuth 2.0 under your Twitter developer account to get the client_id.
Example:
Last updated