Interactive API documentation and code examples
from openai import OpenAI
client = OpenAI(
api_key="YOUR_NATARIS_KEY",
base_url="https://api.nataris.ai/v1"
)
response = client.chat.completions.create(
model="llama-3.2-1b-instruct-q4_k_m",
messages=[{"role": "user", "content": "Hello!"}]
)
print(response.choices[0].message.content)# OpenAI-compatible Chat Completions API
curl -X POST https://api.nataris.ai/v1/chat/completions \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "llama-3.2-1b-instruct-q4_k_m",
"messages": [{"role": "user", "content": "Hello, world!"}]
}'llama-3.2-1b-instruct-q4_k_m
Text · 1B
phi-3-mini-4k-instruct-q4_k_m
Text · 3.8B
qwen2.5-0.5b-instruct-q6_k
Text · 0.5B
mistral-7b-instruct-q4_k_m
Text · 7B
Nataris routes your requests to community phone providers — real people running AI models on their devices. With smart failover (5 retries in under 15 seconds) and automatic re-routing, your requests are resilient even when individual devices go offline.
Runs on real phones in the Nataris network. 85% of revenue goes directly to device providers.
If a device fails, the job is instantly re-routed to the next available device. 5 retries, fast linear backoff.
Check response.nataris.inference_type to see if your request was handled by "p2p" or "cloud". Each model's tier field indicates where it can run: P2P, CLOUD, or HYBRID.
| Method | Endpoint | Description |
|---|---|---|
| POST | /v1/chat/completions | Chat completionsRecommended |
| POST | /v1/jobs | Legacy inference job |
| GET | /v1/jobs/:id | Get job status and result |
| GET | /v1/models | List available models |
| GET | /v1/workflows | List workflowsOrchestration |
| GET | /v1/workflows/:id | Get workflow details + steps |
| POST | /v1/workflows/estimate | Estimate orchestration cost |
| POST | /v1/conversations | Create conversationMemory |
| GET | /v1/conversations | List conversations |
| GET | /v1/conversations/:id | Get conversation context |
| POST | /v1/conversations/:id/messages | Add message to conversation |
All API requests require a Bearer token in the Authorization header.
Get your API key from the dashboard after signing up.
Route requests only to providers with verified device integrity via Google Play Integrity API.
{
"modelId": "llama-3.2-1b-instruct-q4_k_m",
"prompt": "Your prompt here",
"privacyLevel": "verified"
}curl -X POST https://api.nataris.ai/v1/chat/completions \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "llama-3.2-1b-instruct-q4_k_m",
"messages": [{"role": "user", "content": "Research renewable energy trends"}],
"orchestration": {
"enabled": true,
"workflow": "research",
"max_steps": 10,
"max_cost_usd": 1.0
}
}'research · code · agent · map_reduce · auto — Billed at 1.5x base ratePass a conversation_id to automatically persist messages server-side. The API maintains conversation context with auto-generated titles and rolling summarization — no need to send full chat history every time.
{
"model": "llama-3.2-1b-instruct-q4_k_m",
"messages": [{"role": "user", "content": "Tell me more about that"}],
"conversation_id": "conv-uuid-from-POST-/v1/conversations"
}Manage conversations via /v1/conversations — create, list, get context, delete.
Explore the full API with request/response schemas using our interactive Swagger documentation.
Open Swagger UI →Ready to get started?
Get Your API Key →