Download the OriginLink desktop app to share your GPU/RAM compute power with the network, run distributed AI inference jobs, and earn Tensor Credits (TC).
curl -X POST http://localhost:49290/v1/chat/completions \
-H "Authorization: Bearer <YOUR_API_KEY>" \
-H "Content-Type: application/json" \
-d '{
"messages": [{"role": "user", "content": "Hello OBAI Node Network!"}],
"stream": true
}'
Build AI applications & connect autonomous agents to the decentralized P2P compute orchestrator.
The OriginOfAI Orchestrator API provides an OpenAI-compatible REST interface for executing LLM inference across distributed P2P worker nodes. You can seamlessly swap OpenAI endpoint configurations with your local OriginOfAI gateway proxy endpoint.
http://localhost:49290/v1
Local proxy endpoint routing requests to available high-speed P2P GPU nodes.
base_url="http://localhost:49290/v1"
Supports official OpenAI Node.js, Python, and LangChain packages out-of-the-box.
All private API endpoints require your secret developer key passed via the standard HTTP Authorization header:
Authorization: Bearer sk-obai-your-api-key-here
/v1/auth/keys.
Select your language or HTTP library below to view copy-ready integration examples:
import OpenAI from 'openai';
const client = new OpenAI({
baseURL: 'http://localhost:49290/v1',
apiKey: 'sk-obai-your-api-key-here',
});
async function main() {
const stream = await client.chat.completions.create({
model: 'qwen2.5-0.5b',
messages: [
{ role: 'system', content: 'You are a helpful OBAI network assistant.' },
{ role: 'user', content: 'Explain decentralized AI compute in two sentences.' }
],
stream: true,
});
for await (const chunk of stream) {
process.stdout.write(chunk.choices[0]?.delta?.content || '');
}
}
main();
from openai import OpenAI
client = OpenAI(
base_url="http://localhost:49290/v1",
api_key="sk-obai-your-api-key-here"
)
response = client.chat.completions.create(
model="qwen2.5-0.5b",
messages=[
{"role": "system", "content": "You are an AI assistant."},
{"role": "user", "content": "How do P2P compute nodes handle inference?"}
],
stream=False
)
print(response.choices[0].message.content)
import requests
url = "http://localhost:49290/v1/chat/completions"
headers = {
"Authorization": "Bearer sk-obai-your-api-key-here",
"Content-Type": "application/json"
}
payload = {
"model": "qwen2.5-0.5b",
"messages": [
{"role": "user", "content": "Hello OBAI Node Network!"}
]
}
res = requests.post(url, json=payload, headers=headers)
print(res.json())
curl -X POST http://localhost:49290/v1/chat/completions \
-H "Authorization: Bearer sk-obai-your-api-key-here" \
-H "Content-Type: application/json" \
-d '{
"model": "qwen2.5-0.5b",
"messages": [{"role": "user", "content": "Hello from cURL!"}],
"stream": true
}'
package main
import (
"bytes"
"fmt"
"io"
"net/http"
)
func main() {
url := "http://localhost:49290/v1/chat/completions"
jsonStr := []byte(`{"model":"qwen2.5-0.5b","messages":[{"role":"user","content":"Hello OBAI Go!"}]}`)
req, _ := http.NewRequest("POST", url, bytes.NewBuffer(jsonStr))
req.Header.Set("Authorization", "Bearer sk-obai-your-api-key-here")
req.Header.Set("Content-Type", "application/json")
client := &http.Client{}
resp, err := client.Do(req)
if err != nil { panic(err) }
defer resp.Body.Close()
body, _ := io.ReadAll(resp.Body)
fmt.Println(string(body))
}
use reqwest::header::{AUTHORIZATION, CONTENT_TYPE};
#[tokio::main]
async fn main() -> Result<(), Box> {
let client = reqwest::Client::new();
let res = client.post("http://localhost:49290/v1/chat/completions")
.header(AUTHORIZATION, "Bearer sk-obai-your-api-key-here")
.header(CONTENT_TYPE, "application/json")
.body(r#"{"model":"qwen2.5-0.5b","messages":[{"role":"user","content":"Hello Rust!"}]}"#)
.send()
.await?
.text()
.await?;
println!("{}", res);
Ok(())
}
/v1/chat/completions
Bearer Key Required
Executes AI model chat inference across active compute nodes. Supports SSE streaming and standard JSON responses.
| Field | Type | Status | Description |
|---|---|---|---|
model |
string |
Required | Target model identifier (e.g. qwen2.5-0.5b, llama-3.2-3b). |
messages |
array |
Required | Array of message objects: [{"role": "user", "content": "..."}]. |
stream |
boolean |
Optional | If true, returns Server-Sent Events (SSE) stream. Default: false. |
temperature |
number |
Optional | Sampling temperature between 0.0 and 2.0. Default: 0.7. |
/v1/models
Public / Free
Lists all available AI models registered by active worker nodes on the OBAI network.
/v1/health
Public / Free
Returns Orchestrator server status, system uptime, and database connectivity checks.
/api/nodes
Public / Free
Fetches live P2P node mesh telemetry, total connected compute nodes, VRAM, and load status.
/api/stats
Public / Free
Aggregated network throughput statistics, total tokens generated, and active requests per minute.
/v1/auth/keys
Bearer Key Required
Returns list of active developer API keys belonging to the authenticated account.
{
"id": "chatcmpl-obai-89a1f2",
"object": "chat.completion",
"created": 1722256000,
"model": "qwen2.5-0.5b",
"choices": [
{
"index": 0,
"message": {
"role": "assistant",
"content": "Decentralized AI compute routes inference tasks across P2P GPU nodes."
},
"finish_reason": "stop"
}
],
"usage": {
"prompt_tokens": 14,
"completion_tokens": 12,
"total_tokens": 26
}
}
| Status | Error Code | Description |
|---|---|---|
| 200 OK | SUCCESS |
Request completed successfully. |
| 400 Bad Request | BAD_REQUEST / INVALID_MODEL |
Missing or malformed required fields in payload or invalid model. |
| 401 Unauthorized | UNAUTHORIZED / AUTH_FAILED |
Missing, expired, or invalid Authorization header API key / JWT token. |
| 402 Payment Required | INSUFFICIENT_TC |
Insufficient Tensor Credits (TC) balance. Connect a compute node to earn TC or top up your balance. |
| 429 Rate Limited | RATE_LIMITED |
Request rate limit exceeded. Slow down API invocation frequency. |
| 500 Internal Error | INTERNAL_ERROR / NODE_TIMEOUT |
Internal orchestrator exception, GPU out-of-memory, or worker node processing timeout. |
| 503 Unavailable | NODE_OFFLINE / NO_NODES_ONLINE |
No active compute nodes online for requested model, or worker node disconnected mid-stream. |
Execute live test queries directly against your local OBAI Orchestrator gateway (`http://localhost:49290`):
{
"info": "Click 'Send Test Request' to view live response output..."
}