⚡ Agent Quick Access

🚀 Quickstart

Install the ADK

The MyAi Agent Developer Kit (ADK) lets you build agents that buy and sell compute on the MyAi network. Available for Python and Node.js.

bash
pip install "myai-sdk @ git+https://github.com/Infinihash/[email protected]"

A Node.js / TypeScript SDK is not published yet. From JavaScript, use the official openai npm package with baseURL: "https://api.myaitoken.io/v1" and your MyAi API key.

Your First Compute Job

Submit an inference job to the network in 3 lines of Python:

python
import asyncio
from myai import Client   # alias of MyAIClient (myai-sdk >= 2.2.1)

client = Client(api_key="myai-sk-...")   # sent as "Authorization: Bearer <key>" to https://api.myaitoken.io

async def main():
    result = await client.bid_and_execute(
        model="llama3.2:latest",
        prompt="Explain proof of compute in 2 sentences.",
    )
    print(result.output)

asyncio.run(main())

Environment Setup

bash
export MYAI_API_KEY="myai-sk-..."
export MYAI_COORDINATOR="https://api.myaitoken.io"

Get your API key from the Marketplace after connecting your wallet. The coordinator URL defaults to the hosted endpoint.

Authentication

All requests require a Bearer token in the Authorization header:

bash
curl -X POST https://api.myaitoken.io/v1/chat/completions \
  -H "Authorization: Bearer myai-sk-YOUR_KEY" \
  -H "Content-Type: application/json" \
  -d '{"model":"deepseek-r1:7b","messages":[{"role":"user","content":"Hello"}]}'