← dApp|ADK Examples
Full Docs →
🛠️ Agent Developer Kit

ADK Integration Examples

The MyAi ADK is OpenAI-compatible — swap your base URL and start running distributed inference at 1/10th the cost.

Quick Start
pip install myai-adkor use the OpenAI SDK with base_url override
Install MyAi ADK (Python)bash
# Install the MyAi Agent Developer Kit
pip install myai-adk

# Verify installation
python -c "import myai; print(myai.__version__)"
# → 2.0.0
Post a Compute Job (curl)bash
curl -X POST https://api.myaitoken.io/v1/chat/completions \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -d '{
    "model": "deepseek-r1:7b",
    "messages": [{"role": "user", "content": "What is decentralized compute?"}],
    "max_tokens": 512
  }'
Post a Compute Job (Python / OpenAI SDK)python
from openai import OpenAI

client = OpenAI(
    base_url="https://api.myaitoken.io/v1",
    api_key="YOUR_API_KEY",
)

response = client.chat.completions.create(
    model="deepseek-r1:7b",
    messages=[{"role": "user", "content": "What is proof of compute?"}],
    max_tokens=512,
)
print(response.choices[0].message.content)
Post a Compute Job (JavaScript)javascript
import OpenAI from 'openai';

const client = new OpenAI({
  baseURL: 'https://api.myaitoken.io/v1',
  apiKey: 'YOUR_API_KEY',
});

const response = await client.chat.completions.create({
  model: 'deepseek-r1:7b',
  messages: [{ role: 'user', content: 'Explain MYAI tokenomics.' }],
  maxTokens: 512,
});
console.log(response.choices[0].message.content);
Check Job Statusbash
curl -H "Authorization: Bearer YOUR_API_KEY" \
  https://api.myaitoken.io/v1/jobs/JOB_ID/status

# Response:
# {"job_id":"abc123","status":"completed","model":"deepseek-r1:7b",
#  "provider":"gpu-agent-07","tokens_used":312,"myai_cost":0.0003}
Claim a Job as a Compute Provider (Agent)python
import httpx, time

API = "https://api.myaitoken.io/v1"
KEY = "YOUR_PROVIDER_API_KEY"

while True:
    r = httpx.post(f"{API}/agent/claim",
                   headers={"Authorization": f"Bearer {KEY}"},
                   json={"model": "deepseek-r1:7b"})
    if r.status_code == 200:
        job = r.json()
        print(f"Claimed job {job['job_id']}")
        # ... run inference with your local model ...
        httpx.post(f"{API}/agent/complete/{job['job_id']}",
                   headers={"Authorization": f"Bearer {KEY}"},
                   json={"output": "Your model response", "tokens": 128})
    else:
        time.sleep(5)
📚
Full ADK Docs
Complete API reference
🐙
GitHub
Open source examples
🚀
Open dApp
Token dashboard & staking