Claudia OpenAI-Compatible API
Claudia is an OpenClaw-powered assistant exposed through a private, OpenAI-compatible HTTPS API. Applications can call Claudia using familiar chat-completion request formats while the actual response is generated by the Claudia agent running inside OpenClaw.
Supports POST /v1/chat/completions and a short POST /v1 alias.
The responder is Claudia as configured in OpenClaw, not a raw model endpoint.
Bearer token required. The real token is never published in this documentation.
Base URL
Use this base URL for OpenAI-compatible clients:
https://api.claudia-ai.my.id/v1
Full chat-completion endpoint:
POST https://api.claudia-ai.my.id/v1/chat/completions
Authentication
Every API request must include a bearer token:
Authorization: Bearer YOUR_CLAUDIA_API_TOKEN
Chat Completions
| Method | Path | Description |
|---|---|---|
POST | /v1/chat/completions | OpenAI-compatible chat completion endpoint. |
GET | /health | Service health check. |
Request body
{
"model": "claudia-openclaw",
"messages": [
{ "role": "user", "content": "Hello Claudia" }
]
}
Supported fields
| Field | Status | Notes |
|---|---|---|
model | Supported | Accepted for compatibility. Internally routed to Claudia/OpenClaw. |
messages | Supported | Roles and text content are converted into a Claudia prompt. |
user | Supported | Used to derive a separate OpenClaw session id. |
stream | Not supported yet | Requests with stream: true return an error. |
Short Alias
For simple Bash usage, Claudia also supports a short alias:
POST https://api.claudia-ai.my.id/v1
This accepts the same JSON body as /v1/chat/completions.
cURL Examples
OpenAI-compatible endpoint
export CLAUDIA_API_TOKEN="YOUR_TOKEN_HERE"
curl -X POST https://api.claudia-ai.my.id/v1/chat/completions \
-H "Authorization: Bearer $CLAUDIA_API_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"model": "claudia-openclaw",
"messages": [
{"role": "user", "content": "Summarize this in Indonesian."}
]
}'
Short alias
curl -X POST https://api.claudia-ai.my.id/v1 \
-H "Authorization: Bearer $CLAUDIA_API_TOKEN" \
-H "Content-Type: application/json" \
-d '{"messages":[{"role":"user","content":"Hello Claudia"}]}'
OpenAI SDK Example
JavaScript
import OpenAI from "openai";
const client = new OpenAI({
apiKey: process.env.CLAUDIA_API_TOKEN,
baseURL: "https://api.claudia-ai.my.id/v1"
});
const response = await client.chat.completions.create({
model: "claudia-openclaw",
messages: [
{ role: "user", content: "Hello Claudia" }
]
});
console.log(response.choices[0].message.content);
Python
from openai import OpenAI
import os
client = OpenAI(
api_key=os.environ["CLAUDIA_API_TOKEN"],
base_url="https://api.claudia-ai.my.id/v1"
)
response = client.chat.completions.create(
model="claudia-openclaw",
messages=[{"role": "user", "content": "Hello Claudia"}],
)
print(response.choices[0].message.content)
Response Format
Responses follow the standard chat completion shape:
{
"id": "chatcmpl-claudia-...",
"object": "chat.completion",
"created": 1777145143,
"model": "claudia-openclaw",
"choices": [
{
"index": 0,
"message": {
"role": "assistant",
"content": "Hello. I am Claudia."
},
"finish_reason": "stop"
}
],
"usage": {
"prompt_tokens": 587,
"completion_tokens": 17,
"total_tokens": 13916
}
}
Current Limitations
- Streaming responses are not supported yet.
- Tool-calling JSON compatibility is not implemented yet.
- Vision/audio input is not part of this endpoint yet.
- Latency can be higher than a raw model endpoint because requests are routed through OpenClaw and Claudia's agent session.
Operations
The API wrapper runs as a systemd service:
systemctl status claudia-openai-api.service
systemctl restart claudia-openai-api.service
The HTTPS reverse proxy is handled by Caddy:
systemctl status caddy
systemctl reload caddy
Health check:
curl https://api.claudia-ai.my.id/health
Security Notes
- Keep the OpenClaw Gateway bound to loopback; do not expose port
18789directly. - Only expose the HTTPS wrapper domain through Caddy.
- Use a strong bearer token and rotate it if it is ever shared accidentally.
- Do not put the token in browser/frontend code.
- Add rate limits before exposing this endpoint to untrusted users.