Brian - Documentation
  • đŸ–ī¸Welcome
  • 👀Prompt-to-earn
  • 🤖Why an Intent Recognition Engine?
  • 🌐Brian AI models
  • 📜Prompt Guide
  • 🧠Use Cases
  • đŸ’ģPowered by Brian
  • â‰ī¸FAQ
  • Brian API
    • âš™ī¸APIs
      • đŸ’ģAPI Swagger
      • 💸/transaction
        • â›“ī¸Actions, Networks, and Tokens supported
          • Deposit and Withdraw to/from DeFi protocols
        • Transactions flow
          • EVM
          • Solana
          • Starknet
      • 📚/knowledge
        • 📑Knowledge Boxes
        • 🐝Public Embeddings
      • đŸ§™â€â™‚ī¸/agent
      • 🧑‍đŸ”Ŧ/parameters-extraction
      • 👨‍đŸ’ģ/smart-contract (alpha)
      • 📰/networks
      • â„šī¸/actions
    • đŸĨŗWhat's New?
    • 🔑API key
  • Brian SDK
    • 📚Brian Typescript SDK
  • AI AGENTS
    • 🤖LangChain<>Brian SDK
  • Brian App
    • 🍀Overview
    • 📤Send Transactions
    • 🙏Ask Brian
    • 🚚Deploy Smart Contracts
  • Misc.
    • Telegram Dev community
    • Website
    • Github
    • Medium
    • Twitter
    • HuggingFace
Powered by GitBook
On this page
  1. Brian API
  2. APIs

/smart-contract (alpha)

Generate solidity code from a prompt.

POST https://api.brianknows.org/api/v0/agent/smart-contract

Allows you to send a prompt to Brian and generate a Solidity Smart Contract. The code is encapsulated in a markdown code tag. You can also request the ABI and bytecode of the compiled smart contract in the same API call.

Headers

Name
Type
Description

x-brian-api-key*

String

Brian API key.

Content-Type*

application/json

Body content type.

Request Body

Name
Type
Description

prompt*

String

User input prompt.

compile

Boolean

If true, it compiles the contract and returns the ABI and bytecode

messages

array object[]

messages exchanged between the user and Brian (conversation history).

Requesting information

curl https://api.brianknows.org/api/v0/agent/smart-contract \
  --request POST \
  --header 'Content-Type: application/json' \
  --header 'X-Brian-Api-Key: ' \
  --data '{
  "prompt": "",
  "compile": true,
}'
Response

{
  "result": "```solidity\nCODE_HERE```",
  "abi": "abi_here",
  "bytecode": "bytecode_here"
}
Previous/parameters-extractionNext/networks

Last updated 5 months ago

âš™ī¸
👨‍đŸ’ģ