This section provides complete documentation for Ozwell's backend API, enabling server-side integration and custom workflows.
Ozwell's API follows the OpenAI API specification, providing a familiar interface for developers. The API supports:
- Chat Completions — Conversational AI interactions
- File Management — Upload and manage files
- Embeddings — Generate vector embeddings
- Models — List and inspect available models
- Responses — Extended response format with additional metadata
| Resource | Description |
|---|---|
| Endpoints | Complete API endpoint documentation |
| Authentication | API keys and authentication |
| Examples | Code samples and recipes |
| OpenAI-compatible clients | Configure OpenCode, VS Code, and similar tools |
- Log in to Ozwell Manager with your
manager.os.mieweb.orgcredentials - Open agent management
- Ozwell creates your parent key automatically, or use Claim key to link an existing
ozw_key - Use Show key if you need the
ozw_key for server-side API calls
npm install @ozwell/apiimport { OzwellClient } from '@ozwell/api';
const client = new OzwellClient({
apiKey: process.env.OZWELL_API_KEY,
});
const response = await client.chat.completions.create({
model: 'gpt-4',
messages: [
{ role: 'user', content: 'Hello, Ozwell!' }
],
});
console.log(response.choices[0].message.content);All API requests should be made to:
https://ozwellapi.os.mieweb.org/v1
For Ozwell Manager features, use https://ozwellapi.os.mieweb.org/v1. For self-hosted deployments, use your custom base URL.
All requests must include:
- Authorization header with your API key
- Content-Type: application/json for request bodies
curl https://api.ozwell.ai/v1/chat/completions \
-H "Authorization: Bearer ozw_xxxxxxxx" \
-H "Content-Type: application/json" \
-d '{"model": "gpt-4", "messages": [{"role": "user", "content": "Hello!"}]}'Successful responses return JSON:
{
"id": "chatcmpl-xxxxxxxx",
"object": "chat.completion",
"created": 1699000000,
"model": "gpt-4",
"choices": [
{
"index": 0,
"message": {
"role": "assistant",
"content": "Hello! How can I help you today?"
},
"finish_reason": "stop"
}
],
"usage": {
"prompt_tokens": 10,
"completion_tokens": 12,
"total_tokens": 22
}
}Errors return a JSON object with error details:
{
"error": {
"message": "Invalid API key provided",
"type": "authentication_error",
"code": "invalid_api_key"
}
}| Code | Description |
|---|---|
200 |
Success |
400 |
Bad Request — Invalid parameters |
401 |
Unauthorized — Invalid or missing API key |
403 |
Forbidden — Insufficient permissions |
404 |
Not Found — Resource doesn't exist |
429 |
Rate Limited — Too many requests |
500 |
Server Error — Internal error |
API requests are rate-limited based on your plan:
| Plan | Requests/min | Tokens/min |
|---|---|---|
| Free | 20 | 10,000 |
| Pro | 100 | 100,000 |
| Enterprise | Custom | Custom |
When rate limited, you'll receive a 429 response with retry information in headers:
X-RateLimit-Limit: 100
X-RateLimit-Remaining: 0
X-RateLimit-Reset: 1699000060
Retry-After: 30
For long responses, use streaming to receive chunks as they're generated:
const stream = await client.chat.completions.create({
model: 'gpt-4',
messages: [{ role: 'user', content: 'Tell me a story' }],
stream: true,
});
for await (const chunk of stream) {
const content = chunk.choices[0]?.delta?.content;
if (content) {
process.stdout.write(content);
}
}| Language | Package | Status |
|---|---|---|
| TypeScript/JS | @ozwell/api |
✅ Available |
| Python | ozwell |
🚧 Coming Soon |
You can use the official OpenAI SDK with Ozwell:
import OpenAI from 'openai';
const client = new OpenAI({
apiKey: process.env.OZWELL_API_KEY,
baseURL: 'https://api.ozwell.ai/v1',
});