Introduction
The Local Axiom API lets you send conversational prompts to a AI model and receive instant responses. All processing is performed on our own servers, keeping your data private. Requests may be slow, but the API is fully functional over the clearnet right now.
Authentication & Rate Limiting
No API key is required. Instead, each user is identified by a 64-digit account number that you receive when you create an account on
local-axiom.com. The account number is sent in the request body as sessionId.
The server uses this field to enforce per-user rate limits. Requests that omit the field or supply an invalid
account number will be rejected with 401 Unauthorized.
Example request body fragment:
{ "sessionId": "123456789 etc" }
Request Format
Send a POST request with Content-Type: application/json to:
https://local-axiom.com/api/chat
The JSON payload must contain the following keys:
- model name of the model to use (e.g.
qwen3_4b) - sessionId your 64-digit account number
- system_prompt optional system prompt that sets the behaviour of the AI
- messages array of chat messages in the form
{ role: "user" | "assistant", content: "..." }
Below is a minimal example payload.
Response Format
The API returns JSON with a single field message
containing the assistant's reply. If the reply is a JSON object,
the raw string is returned and you should parse it yourself.
Examples
Below are two complete examples: a simple curl
request and a Python agent that interacts with the API in
an automated workflow.
Curl Example
curl -X POST https://local-axiom.com/api/chat \\
-H "Content-Type: application/json" \\
-d '{
"model": "qwen3_4b",
"sessionId": "",
"system_prompt": "You are a helpful programming assistant",
"messages": [
{
"role": "user",
"content": "Write a Python web server"
}
]
}'
Python Agent Example
import requests, json, re, urllib3, os, time
# --------------------------------------------
# Configuration
# --------------------------------------------
urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning)
API_URL = "https://local-axiom.com/api/chat"
MODEL = "qwen3_4b"
# --------------------------------------------
# 64-digit account number
# --------------------------------------------
ACCOUNT_NUMBER = ""
# --------------------------------------------
# System Prompts
# --------------------------------------------
DEV_PROMPT = """
You are a Developer Agent. Your goal is to write code and create files to complete a task.
Respond ONLY with a JSON object:
{"action": "create_file", "path": "file.py", "content": "..."}
{"action": "complete", "message": "finished"}
If you receive 'CRITIC FEEDBACK', use it to fix your code.
"""
CRITIC_PROMPT = """
You are a Senior Code Reviewer.
Review the code provided by the developer.
1. If the code is perfect and meets all requirements, respond ONLY with: {"status": "PASS"}
2. If there are errors, bugs, or missing features, respond with: {"status": "FAIL", "feedback": "Detailed explanation of what to fix"}
"""
def extract_json(text):
try:
match = re.search(r'(\{.*\})', text, re.DOTALL)
return json.loads(match.group(1)) if match else None
except:
return None
def call_axiom(system_prompt, messages, session_id=None):
payload = {
"model": MODEL,
"system_prompt": system_prompt,
"messages": messages,
"sessionId": ACCOUNT_NUMBER,
}
try:
response = requests.post(API_URL, json=payload, verify=False, timeout=60)
response.raise_for_status()
return response.json().get("message", ""), None
except Exception as e:
return f"Error: {e}", None
def run_task(task_description):
dev_messages = [{"role": "user", "content": f"Task: {task_description}"}]
session_id = None
print(f"\n?? Starting: {task_description}")
for step in range(5): # limit to 5 iterations
raw_res, session_id = call_axiom(DEV_PROMPT, dev_messages, session_id)
data = extract_json(raw_res)
if not data:
dev_messages.append({"role": "user", "content": "Please only output JSON."})
continue
if data.get("action") == "create_file":
path, content = data.get("path"), data.get("content")
with open(path, "w") as f:
f.write(content)
print(f"??? Dev: Created {path}")
# Critic review
print(f"?? Critic: Reviewing {path}...")
critic_input = [{"role": "user",
"content": f"Task was: {task_description}\nCode written:\n{content}"}]
critic_res, _= call_axiom(CRITIC_PROMPT, critic_input, session_id)
review = extract_json(critic_res)
if review and review.get("status") == "PASS":
print("? Critic: Code looks good! Task Complete.")
return
elif review and review.get("status") == "FAIL":
feedback = review.get("feedback")
print(f"? Critic Feedback: {feedback}")
dev_messages.append({"role": "assistant", "content": raw_res})
dev_messages.append({"role": "user",
"content": f"CRITIC FEEDBACK: {feedback}. Please fix the code and recreate the file."})
else:
print("?? Critic gave invalid response, assuming pass.")
return
elif data.get("action") == "complete":
print(f"? Dev marked task as complete.")
break
if __name__ == "__main__":
task = input("Enter task: ")
if task:
run_task(task)
FAQ
What models are available?
The API exposes all available models: gpt_oss_20b gemma3_27b gemma3_1b qwen3_30b_a3b qwen3_coder_30b llama3_1_8b chan_AI_Uncensored chan_AI_Censored.
Do I need an API key?
No. The account number is all you need, the API is rate-limited per account.
How do I obtain an account number?
Sign up on local-axiom.com/create-account and you'll receive a 64-digit string. Keep it safe; it's the sole credential for the API.