🐍 Python
import requests
API_KEY = 'evx_your_key_here'
BASE = 'https://evolvixos.com'
# Chat with Mr James AI agent
resp = requests.post(f'{BASE}/api/agent',
headers={'Authorization': f'Bearer {API_KEY}'},
json={'prompt': 'Write a Python function', 'session_id': 'my-app'},
stream=True)
for line in resp.iter_lines():
print(line.decode())
# Generate an image
resp = requests.post(f'{BASE}/api/generate/image',
headers={'Authorization': f'Bearer {API_KEY}'},
json={'prompt': 'A sunset over mountains'})
job_id = resp.json()['job_id']
# List models
resp = requests.get(f'{BASE}/api/models',
headers={'Authorization': f'Bearer {API_KEY}'})
models = resp.json()['models']
💻 cURL
# Chat with agent (streaming)
curl -N -X POST https://evolvixos.com/api/agent \
-H "Authorization: Bearer evx_your_key" \
-H "Content-Type: application/json" \
-d '{"prompt":"Hello Mr James!"}'
# Generate image
curl -X POST https://evolvixos.com/api/generate/image \
-H "Authorization: Bearer evx_your_key" \
-H "Content-Type: application/json" \
-d '{"prompt":"A cat in space"}'
# List all 81 models
curl https://evolvixos.com/api/models \
-H "Authorization: Bearer evx_your_key"
🟢 JavaScript / Node.js
const API_KEY = 'evx_your_key_here';
const BASE = 'https://evolvixos.com';
const resp = await fetch(`${BASE}/api/agent`, {
method: 'POST',
headers: {
'Authorization': `Bearer ${API_KEY}`,
'Content-Type': 'application/json'
},
body: JSON.stringify({prompt: 'Hello!'})
});
const reader = resp.body.getReader();
const decoder = new TextDecoder();
while (true) {
const {done, value} = await reader.read();
if (done) break;
console.log(decoder.decode(value));
}