API REFERENCE

REST API Documentation

Complete REST API reference for Microbix services. Authenticate via the Authorization header using a Bearer token.

POST /api/v1/chat/completions

Creates a completion for the provided prompt and parameters.

cURL
Python
Node.js
curl https://api.microbix.in/api/v1/chat/completions \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer $MICROBIX_API_KEY" \
  -d '{
    "model": "microbix-ultra",
    "messages": [{"role": "user", "content": "Explain quantum entanglement."}]
  }'
import requests

headers = {
    'Authorization': f'Bearer {api_key}',
    'Content-Type': 'application/json'
}
data = {
    'model': 'microbix-ultra',
    'messages': [{'role': 'user', 'content': 'Explain quantum entanglement.'}]
}
response = requests.post('https://api.microbix.in/api/v1/chat/completions', headers=headers, json=data)
print(response.json())
const response = await fetch('https://api.microbix.in/api/v1/chat/completions', {
  method: 'POST',
  headers: {
    'Content-Type': 'application/json',
    'Authorization': `Bearer ${apiKey}`
  },
  body: JSON.stringify({
    model: 'microbix-ultra',
    messages: [{role: 'user', content: 'Explain quantum entanglement.'}]
  })
});
const data = await response.json();

POST /api/voice/translate

Translates audio into text and translates into another language.

cURL
Python
Node.js
curl --request POST \
  --url https://api.microbix.in/api/voice/translate \
  --header "Authorization: Bearer $MICROBIX_API_KEY" \
  --header "Content-Type: multipart/form-data" \
  --form file=@audio.mp3 \
  --form model="microbix-audio-1"
import requests

headers = {'Authorization': f'Bearer {api_key}'}
files = {'file': open('audio.mp3', 'rb')}
data = {'model': 'microbix-audio-1'}

response = requests.post('https://api.microbix.in/api/voice/translate', headers=headers, files=files, data=data)
print(response.json())
const formData = new FormData();
formData.append('file', fileInput.files[0]);
formData.append('model', 'microbix-audio-1');

const response = await fetch('https://api.microbix.in/api/voice/translate', {
  method: 'POST',
  headers: { 'Authorization': `Bearer ${apiKey}` },
  body: formData
});

POST /api/v1/agent/execute

Executes an autonomous agent with a specified goal, tools, and constraints.

cURL
Python
Node.js
curl -X POST https://api.microbix.in/api/v1/agent/execute \
  -H "Authorization: Bearer $MICROBIX_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "agent_id": "data_analyst",
    "goal": "Analyze Q3 revenue from the attached CSV.",
    "tools": ["python_interpreter"]
  }'
import requests

headers = {
    'Authorization': f'Bearer {api_key}',
    'Content-Type': 'application/json'
}
data = {
    'agent_id': 'data_analyst',
    'goal': 'Analyze Q3 revenue from the attached CSV.',
    'tools': ['python_interpreter']
}
response = requests.post('https://api.microbix.in/api/v1/agent/execute', headers=headers, json=data)
print(response.json())
const response = await fetch('https://api.microbix.in/api/v1/agent/execute', {
  method: 'POST',
  headers: {
    'Content-Type': 'application/json',
    'Authorization': `Bearer ${apiKey}`
  },
  body: JSON.stringify({
    agent_id: 'data_analyst',
    goal: 'Analyze Q3 revenue from the attached CSV.',
    tools: ['python_interpreter']
  })
});

Error Codes

Code Description
400 Bad Request - The request was invalid or cannot be otherwise served.
401 Unauthorized - Missing or invalid API key.
429 Too Many Requests - Rate limit exceeded.
500 Internal Server Error - Something went wrong on our end.

Rate Limiting

Rate limits are applied at the IP and API key level. Current limits are 1000 requests per minute. Headers included in the response indicate your current usage: