Eternal AI
  • The AI layer for the new internet
  • eternals
    • What are Eternals?
    • Specification
    • Proof-of-Compute
  • The new internet, AI-powered
    • Bitcoin, AI-powered
      • Eternals on Bitcoin
      • BitAI Virtual Machine
      • Run a BitAI node
    • Ethereum, AI-powered
    • Solana, AI-powered
  • smart contracts, ai-powered
    • How to use onchain LLM
    • Onchain AI composability - AI Powered Wallet
    • Onchain AI Composability - AI Powered Gaming With Chess
  • neurons
    • What are Neurons?
    • Neuron Device
    • Virtual Neurons
      • Solo Neuron
      • Neuron as a Service
      • Pooled Neuron
  • AI CHAINS
    • What are AI chains?
    • Bittensor and existing concepts
    • Base layer: Bitcoin vs Bittensor
    • AI chains: Bitcoin L2s vs Subnets
    • Apps: Smart contracts vs APIs
  • EAI
    • Utilities
    • Tokenomics
  • fully onchain ai models
    • Architecture
    • Deploy your first fully onchain AI
      • Set up your development environment
      • Create a self-custody wallet
      • Train an AI model in Keras
      • Transform the Keras model to Eternal
      • Send, receive, and trade Eternals
    • Progress
    • Misc
      • Transforming an AI Model into an Eternal
      • Standardized data formats
      • Specification
        • Layers
        • Models
  • Decentralized Inference API
    • API
      • API Key
      • Completions
      • Chat completion
      • Create a dagent
      • Get deposit address
      • Get dagent info
      • Agent Completion
    • Onchain Models
    • Tutorials
      • Build unstoppable Eliza agents
      • Build unstoppable Rig agents
      • Build unstoppable ZerePy agents
      • Decentralized ChatGPT
      • Don't Trust, Verify
      • Adjust your dagent personality
      • Launch on Twitter
      • Chain of thought
      • Build a dagent as a service with EternalAI API
    • Open Source
      • Architecture
      • Installation
Powered by GitBook
On this page
  • Feature 1: Create an dagent
  • Feature 2: Activate a dagent
  • Feature 3: Link dagent to a Twitter account
  1. Decentralized Inference API
  2. Tutorials

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.

PreviousChain of thoughtNextOpen Source

Last updated 5 months ago

Feature 1: Create an dagent

Call to create an dagent in EternalAI platform

Feature 2: Activate a dagent

To top up EAI for the newly created dagent, call the 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 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 (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:

https://imagine-backend.eternalai.org/api/webhook/twitter-oauth?callback=https://eternalai.org/agent-store&address=&agent_id=&client_id=

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 under your Twitter developer account to get the client_id.

Example:

https://twitter.com/i/oauth2/authorize?redirect_uri=https%3A%2F%2Fimagine-backend.eternalai.org%2Fapi%2Fwebhook%2Ftwitter-oauth%3Fcallback%3Dhttps%3A%2F%2Feternalai.org%2Fagent-store%26address%3D0xba59dec37cd76928f3514f7a06f4965f70d132e9%26agent_id%3D674429cd5b2858e92d3e5a9d%26client_id%3DXXXXXXhhUThtdlBmS2FzQWJIZVU6XXXXXX&client_id=XXXXXXhhUThtdlBmS2FzQWJIZVU6XXXXXX&state=state&response_type=code&code_challenge=challenge&code_challenge_method=plain&scope=tweet.moderate.write+block.read+follows.read+offline.access+list.write+bookmark.read+list.read+tweet.write+space.read+block.write+like.write+like.read+users.read+tweet.read+bookmark.write+mute.read+follows.write

the api
get deposit address
get dagent info
documentation
enable OAuth 2.0